Click to See Complete Forum and Search --> : [RESOLVED] Vista System Restore/Shadow Copy again...
Set me As newtype
Apr 9th, 2009, 05:37 PM
Gents,
I have one user who is experiencing a data problem with my app on both of his Vista Home Premium computers...
I'm using a non-registered, non-"associated," file extension for a database. It seems that each day when he boots the computers (both) an older version of his data gets "restored."
This has suddenly started, only very recently, and I suspect a virus???
System Restore is not supposed to affect "personal files, such as e-mail, documents, or photos." Does that only apply to "associated" file types???
Any thoughts/suggestions? I am thinking about having him disable System Restore, but don't really want to go there!
si_the_geek
Apr 9th, 2009, 05:40 PM
Where are the files stored?
Does the user log in to Windows using different accounts?
Set me As newtype
Apr 9th, 2009, 05:51 PM
Where are the files stored?
Does the user log in to Windows using different accounts?
This database file is installed to the Program Files folder.... I install other (only temp) files to the common Application Data folder. Perhaps I should try installing it there, instead? I'm not entirely clear on the "rules" for such... No other Vista users have had this problem... yet.
This user operates only as admin.
si_the_geek
Apr 9th, 2009, 06:07 PM
That would almost certainly cause the problem - and switching to CommonAppData should solve it.
For more information, see the article Where should I store the files that my program uses/creates? from our Classic VB FAQs (in the FAQ forum, which is shown near the top of our home page)
Set me As newtype
Apr 9th, 2009, 06:39 PM
That would almost certainly cause the problem - and switching to CommonAppData should solve it.
For more information, see the article Where should I store the files that my program uses/creates? from our Classic VB FAQs (in the FAQ forum, which is shown near the top of our home page)
Very helpful, Si. Thank You.
Why in the wide world of sports did M$ invent 'Virtualisation'???? Allowing a guy to think things are OK, only to later find out that he's hosed? I'd kinda expect some kinda warning if I was the user, before entering data into oblivion... Would be better of M$ to "Just Say No!" :sick:
Set me As newtype
Apr 9th, 2009, 11:54 PM
I'll mark this Resolved for now...
Thanks again, Si!
si_the_geek
Apr 10th, 2009, 07:10 AM
As explained in the article, Virtualisation is there to allow poorly written/tested programs to work - when really they should never have worked in the first place anyway.
If you had done reasonable testing on XP or 2000 (ie: running as a non-Admin user), you would have had problems back then - and presumably corrected them, so Virtualisation would not have affected you.
Microsoft make the Windows developer guidelines widely available, and the version that came with VB6 way back in 1998 gave explicit instructions about where data files should and should not be stored. They didn't explicitly warn about Virtualisation, but did make it very clear that you should expect problems if you store data files in places like ProgramFiles.
Allowing a guy to think things are OK, only to later find out that he's hosed? I'd kinda expect some kinda warning if I was the user, before entering data into oblivion... I'm pretty sure I've read that even after a System Restore the data is still there - but only available to the user who saved it.
I'm afraid I have no idea how to get to it, as I have had no reason to find out.
Would be better of M$ to "Just Say No!" :sick:They did - to malware.
One of the main reasons for locking down ProgramFiles this way (after years of warning us about it) is because that was a key way for malware to do its thing - and that entry point is now almost completely eliminated.
Believe it or not this is actually better for poorly written programs than XP was - I lost count of the number of programs that crashed or hung for me (I didn't log in as Admin), whereas the Virtualisation in Vista stops that from happening to them.
Set me As newtype
Apr 10th, 2009, 07:21 AM
They didn't explicitly warn about Virtualisation, but did make it very clear that you should expect problems if you store data files in places like ProgramFiles.
This was my point, and probably one of the biggest reasons so many people hate Vi$ta...
Rather than a polite message that says, "Danger, this is a potentially dangerous program (or some such)," M$ lets a guy think everything's OK - until suddenly there's a problem with figuring out where his data went!
So, for me, like many others, M$ and Vi$ta are losing favor...
Set me As newtype
Apr 10th, 2009, 07:28 AM
Microsoft make the Windows developer guidelines widely available, and the version that came with VB6 way back in 1998 gave explicit instructions about where data files should and should not be stored.
I'm still using VB5, and will continue as long as I can. Sorry I missed the bit about M$ changing the rules...
But you got me straightened out - some 11 years later! :bigyello::thumb:
Thank you, Si.
si_the_geek
Apr 10th, 2009, 08:13 AM
Microsoft did warn about Virtualisation a long time before Vista, just not in detail back in 1998 (when they "only" reminded us of the rules it helps enforce). ;)
The FAQ article links to the Windows 2000 developer guidelines (I find it much easier to read than the other versions!), and it's probably a good idea for you to read some of it - as it not only explains about the folders, but also several other issues that Vista gets wrongly blamed for (but occur on XP/2000 too for non-Admins), such as Registry permissions.
After literally hundreds of threads claiming that Vista is somehow at fault for problems with programs, I've only seen 2 genuine issues - the rest, including this one, have been due to the programs not being designed to work properly on Windows, and only worked for previous versions under certain conditions.
Set me As newtype
Apr 10th, 2009, 12:43 PM
After literally hundreds of threads claiming that Vista is somehow at fault for problems with programs, I've only seen 2 genuine issues - the rest, including this one, have been due to the programs not being designed to work properly on Windows, and only worked for previous versions under certain conditions.
Si,
I am not blaming M$ or Vi$ta for the problem! I simply asked why they are being so hard-a$$ed (pardon the French) about the way they "ENFORCE ZE RULES" (with a thick Nazi-German accent)... Yawol? :D
Set me As newtype
Apr 10th, 2009, 03:17 PM
The FAQ article links to the Windows 2000 developer guidelines (I find it much easier to read than the other versions!), and it's probably a good idea for you to read some of it - as it not only explains about the folders, but also several other issues that Vista gets wrongly blamed for (but occur on XP/2000 too for non-Admins), such as Registry permissions.
I did some reading, per your suggestion (thanks again!). Here's what I found that pertains:
Which folder(s) should be used?
Microsoft provides Developer Guidelines to explain to programmers (of all languages, not just VB6) how to interact with Windows - things such as where to place files, and how to install your program without affecting other programs that are already installed.
A good explanation of where your program should store files (and Registry settings) can be found in section 4.2 of the Application Specification for Microsoft Windows 2000 for Desktop Applications, which was provided with some editions of VB6.
In summary, these three special folders are the valid locations:
AppData - for the current Windows user, on any computer on the network
Local_AppData - for the current Windows user, on this computer only
CommonAppData - for all Windows users on this computer
You should create your own sub-folders within these folders (eg: AppData\YourProgramName) to put files in to, otherwise you might find that your files are edited/deleted by other programs!
If you want the user to be able to navigate to the files using Explorer/My Computer, it is appropriate to save them to the Documents folder (known as "My Documents" in Windows XP and 2000), but note that the user can easily edit or delete them without using your program.
Most tools for creating an installation package provide options for placing files in these folders.
Note that the CommonAppData folder needs care, as the security settings of the folder affect who can edit the files. If you create the folder as part of the installation, you may be able to get the installer to set the security so that all users can edit the files - if not you will need to add code to your program to do that.
I really need to put the database in a location that's easy for an inexperienced guy to find, for networking purposes, without cluttering the Desktop (and I don't want to put it in the dreaded Documents folder, for reasons explained in FAQ's, above).
On my XP Pro system, the paths returned for AppData and Desktop are the same. Is that the same with Vista???
How does the Program Data folder fit into this scheme? Does it only exist on Vista systems, and how is it found (i.e. SpecialFolder_AppData...)?
What do you think would be the best folder for my needs? Thanks again!
Set me As newtype
Apr 10th, 2009, 03:48 PM
Gents,
I have one user who is experiencing a data problem with my app on both of his Vista Home Premium computers...
I'm using a non-registered, non-"associated," file extension for a database. It seems that each day when he boots the computers (both) an older version of his data gets "restored."
This has suddenly started, only very recently, and I suspect a virus???
Si,
Can you please tell me why this suddenly occurred after about 3 months of everyday usage?
si_the_geek
Apr 11th, 2009, 07:27 AM
I am not blaming M$ or Vi$ta for the problem! I simply asked why they are being so hard-a$$ed (pardon the French) about the way they "ENFORCE ZE RULES" (with a thick Nazi-German accent)... Yawol? :DThat is still blaming Microsoft - whether you like it or not, the issue is entirely your own fault.
You have written a program that is designed to run on Windows, but violate the developer rules that are published for it. They were public knowledge for at least 9 years before Vista came out - is that (plus the two years since) really not enough time to take a look at them, and correct your mistakes?
I'm willing to bet that you haven't event tested your program on XP (or 2000) under a limited user account - as that would almost certainly get problems too (slightly different issues, but same cause and solution).
The way they did it is probably the best they could have done, as it copes with most cases of badly-written programs (in a better way than XP did!), while still giving several benefits to the user (such as added virus protection).
Given that we have had warnings many years in advance, it is far from "hard" enforcement!
I really need to put the database in a location that's easy for an inexperienced guy to find, for networking purposes,Erm... why?
Whatever the reason, I suspect there is a better method than intentionally making it easy to find.
On my XP Pro system, the paths returned for AppData and Desktop are the same.That should definitely not happen, as they are completely different folders.
What code are you using to find them?
How does the Program Data folder fit into this scheme? Does it only exist on Vista systems, and how is it found (i.e. SpecialFolder_AppData...)?It is Common_AppData.
The name/location are different to earlier versions of Windows, but the way to find it is the same.
What do you think would be the best folder for my needs? Thanks again!It depends on your answer to the "networking" question, but I strongly suspect one of the *AppData folders (which one is up to you, based on the differences explained in the FAQ article).
Can you please tell me why this suddenly occurred after about 3 months of everyday usage?There are several possibilities, but it is a waste of time to even think about them - just fix your mistakes. ;)
Set me As newtype
Apr 11th, 2009, 08:28 AM
That is still blaming Microsoft - whether you like it or not, the issue is entirely your own fault.
Si: My ignorance is my fault (not knowing the rules). I'm not blaming anyone.
What I'm asking is why they wouldn't simply provide a user-friendly warning, like "Hey! This app is trying to write data to a file in a verboten folder! We will let the app run, but the data will be written to C:\AppData where you can find it."
Instead, M$ lets the app run, but the data is stowed somewhere else, in a hidden location that a user and his friends can't find or access. Does that really seem user-friendly and right?
Erm... why?
Whatever the reason, I suspect there is a better method than intentionally making it easy to find.
What could possibly be better?
That should definitely not happen, as they are completely different folders.
What code are you using to find them?
This:
Public Function GetSpecialFolder() As String
Dim sPath As String
Dim pidl As Long
'AppData: This returns Desktop path on XP Pro!!!!
If SHGetSpecialFolderLocation(0, CSIDL_APPDATA, pidl) = ERROR_SUCCESS Then
sPath = Space$(MAX_LENGTH)
If SHGetPathFromIDList(ByVal pidl, ByVal sPath) Then
GetSpecialFolder = Left$(sPath, InStr(sPath, Chr$(0)) - 1)
If Right(GetSpecialFolder, 1) <> "\" Then GetSpecialFolder = GetSpecialFolder & "\"
AppData = GetSpecialFolder & "My App\"
If Dir(AppData, vbDirectory) = "" Then
MkDir (AppData)
End If
End If
End If
'CommonAppData:
If SHGetSpecialFolderLocation(0, CSIDL_COMMON_APPDATA, pidl) = ERROR_SUCCESS Then
sPath = Space$(MAX_LENGTH)
If SHGetPathFromIDList(ByVal pidl, ByVal sPath) Then
GetSpecialFolder = Left$(sPath, InStr(sPath, Chr$(0)) - 1)
If Right(GetSpecialFolder, 1) <> "\" Then GetSpecialFolder = GetSpecialFolder & "\"
CommonAppData = GetSpecialFolder & "My App\"
If Dir(CommonAppData, vbDirectory) = "" Then
MkDir (CommonAppData)
End If
End If
End If
'Desktop:
If SHGetSpecialFolderLocation(0, CSIDL_DESKTOP, pidl) = ERROR_SUCCESS Then
sPath = Space$(MAX_LENGTH)
If SHGetPathFromIDList(ByVal pidl, ByVal sPath) Then
GetSpecialFolder = Left$(sPath, InStr(sPath, Chr$(0)) - 1)
If Right(GetSpecialFolder, 1) <> "\" Then GetSpecialFolder = GetSpecialFolder & "\"
DesktopPath = GetSpecialFolder
End If
End If
End Function
Can you please tell me why this suddenly occurred after about 3 months of everyday usage?
There are several possibilities, but it is a waste of time to even think about them - just fix your mistakes.
No, it is not a waste of time! Please explain... Or at least point me to where M$ has provided an explanation? (I am very much interested in this!!!)
Thank you.
si_the_geek
Apr 11th, 2009, 09:18 AM
Si: My ignorance is my fault (not knowing the rules). I'm not blaming anyone.
What I'm asking is why they wouldn't simply provide a user-friendly warning, like "Hey! This app is trying to write data to a file in a verboten folder! We will let the app run, but the data will be written to C:\AppData where you can find it."
Instead, M$ lets the app run, but the data is stowed somewhere else, in a hidden location that a user and his friends can't find or access. Does that really seem user-friendly and right? It should clearly not be written to the AppData folder, as the app may also write a file there with the same name.
As to showing a message, there are several reasons against it, including:
It is what you want, but what about the other people who foolishly wrote files there? Do they really want the user to know where the file is? In many cases the answer is no.
Does the user actually want to know where the file is? Probably not. Do they want to be shown lots of extra warning messages? Almost certainly not!
Why should Microsoft put in even more effort to correct your mistakes? Your program fails because of mistakes you made. Having an MS message pop up makes it look like it is somehow their fault - whereas the user should be clear that it is your fault, so they can come to you and you can fix it.
As to being "user-friendly and right", Microsoft kindly put something in place so that bad programs would work fine in many cases, and don't fail completely - as they do on XP and 2000 for limited users.
Whether you like it or not, Virtualisation is a favour to people like you, and it is better than the alternatives - which will come back in to effect in later versions of Windows.
What could possibly be better?Well for a start, answering the question I asked - because unsurprisingly that is what my answer will be based on. ;)
This:
Public Function GetSpecialFolder() As String
...Are you using Option Explicit?
You should be, and I'm fairly sure it will point out the issue to you.
No, it is not a waste of time! Please explain... Or at least point me to where M$ has provided an explanation? (I am very much interested in this!!!)It definitely is a waste of time, because it will give you no benefit whatsoever.
You know the root cause of the issue, and are fixing it. You don't need to spend hours working out the specific cause in this case, because it wont happen again.
I certainly wont waste any of my time thinking about it.
Set me As newtype
Apr 11th, 2009, 12:31 PM
I really need to put the database in a location that's easy for an inexperienced guy to find, for networking purposes,
Erm... why?
Whatever the reason, I suspect there is a better method than intentionally making it easy to find.
For networking, as I wrote initially. People need to network computers and share the same database. There is not always a guy as smart as you around, so it needs to be easily explained to, or figured out by, an inexperienced user.
So what could be better, pray tell?
It definitely is a waste of time, because it will give you no benefit whatsoever.
The answer might help me to see Vi$ta as something better than it is.
You know the root cause of the issue, and are fixing it. You don't need to spend hours working out the specific cause in this case, because it wont happen again.It happens all the time to many Vi$ta users who try to run their "good old programs that always worked before Vi$ta!"
Why would M$ want to give the appearance of a virus attack (after several months, in this case) with no explanation?
Again, I'm really looking to find something actually helpful about this Virtualisation, but I can't!
si_the_geek
Apr 11th, 2009, 02:47 PM
Why on earth are you still trying to make out that Vista (rather than your program) is bad? :confused:
Badly written programs only worked on earlier versions of Windows under certain conditions - if you had bothered doing reasonable testing on XP or 2000 you would almost certainly see that your program fails in a much worse way under different conditions.
Programs that were written properly do not encounter Virtualisation at all. The vast majority of programs work absolutely fine on Vista (including all the ones I've written in the last 5-10 years, and the many programs from other sources I've installed).
As I explained earlier, Virtualisation is better than what was on XP/2000, because it allows the bad programs to run under almost all conditions. It isn't perfect, but given the amount of permutations of what programs do (and knowing that they contain at least some badly designed/written code) it is about as good as it could be, and is better than people like you deserve.
Why would M$ want to give the appearance of a virus attack (after several months, in this case) with no explanation?It is not the appearance of a virus attack, it is the appearance of a badly written program - which to some degree it is.
Since post #4 you have known the reason for your program messing up (you put a file in a place it didn't belong), and how to fix it (put it somewhere valid). Working out the specific details of the cause in this case blatantly wont help you to do that, so stop using that (or anything else) as an excuse to pretend that Vista is in any way worse than XP.
The problem is entirely of your own making - you should have known about it (and fixed it) before giving the program out, or at least when you became aware that people were going to be using it on Vista.
Rather than putting all this effort into being a bad programmer (writing bad code, then making excuses to pretend that somebody else is in any way to blame), admit that your program is what looked bad, and fix the mistakes you made.
I've wasted far too much time on your childish claims, I'm out of here.
Set me As newtype
Apr 11th, 2009, 03:43 PM
Why on earth are you still trying to make out that Vista (rather than your program) is bad? :confused:
I am trying to overcome the obvious conclusion that Virtualisation is nothing but Malware:
"Malware, a portmanteau from the words malicious and software, is software designed to infiltrate or damage a computer system without the owner's informed consent. The expression is a general term used by computer professionals to mean a variety of forms of hostile, intrusive, or annoying software or program code.[1] "
By allowing programs to run and then suddenly cause a loss of data "without the owner's informed consent" pretty well describes Virtualisation, eh?:wave:
Rather than putting all this effort into being a bad programmer (writing bad code, then making excuses to pretend that somebody else is in any way to blame), admit that your program is what looked bad, and fix the mistakes you made.
Si, as I told you, I made an ignorant mistake. It is fixed and I never blamed anyone for it. (Every programmer is on a constant learning curve - that does not make everyone a bad programmer.)
I am interested in learning more about Virtualisation so I can inform my customers of its ways and help them understand why they dislike Vista - not for anything else. Once they understand how it works they will be more at ease and freed from worry that other viruses might be causing certain problems... That is my hope, anyway.
Why have you put so much effort into name calling and talking in circles and not answering my questions?
Thanks for the help you did provide, though!:D
si_the_geek
Apr 12th, 2009, 07:12 AM
Your program is the malware (writing data where it isn't allowed to), Virtualisation protected the computer from it.
Virtualisation did not delete the data, something else did. It doesn't matter what, because you have made your program less malicious - so it wont happen again.
If you genuinely wanted to know more about Virtualisaion, you would have found out (the info is very easy to find), but instead keep on making completely unfounded accusations about it.
We are all on learning curves, but only bad programmers put in a ridiculous amount of effort pretending that something else is at fault - everyone else focuses on correcting their mistakes, and fixing the damage that their mistakes caused.
You haven't even attempted to get the data back, you have only looked for excuses to blame Microsoft.
In my experience of hundreds of users, they don't dislike Vista at all - what they dislike the badly written programs that fail on it, and the childish programmers who try to blame Vista for their mistakes (when the majority of programmers don't have the same problems).
If your users feel differently, it almost certainly due to what you have told them - and based on the things you have posted here, I suspect it is mainly lies.
Why have you put so much effort into name calling and talking in circles and not answering my questions?That is not the case.
You have been doing a huge amount of name calling (against Microsoft) based on unfounded claims - I have put lots of effort in to correcting those claims (which you ignored), and trying to get you to focus on sorting out the problems that you caused.
Your ridiculously childish and idiotic refusal to stop passing the buck is why I said you are a bad programmer - and the vast majority of people would agree with that.
There is only one valid question I haven't answered (at the start of post #17), because by then you had pushed the stupidity to a point where I want nothing more to do with you.
You have made it extremely clear that you don't want to sort the issues out, but instead will just continue to make ridiculous claims. As such, there is no point in allowing this thread to continue.
Thread closed.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.