Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Doug Hennig
  Where is Doug Hennig?
 Regina
 Canada
 Doug Hennig
 To: George Kelly
  Where is George Kelly?
 Dromore
 United Kingdom
 George Kelly
 Tags
Subject: RE: Installation problem - on Vista
Thread ID: 129129 Message ID: 129165 # Views: 102 # Ratings: 9
Version: Visual FoxPro 9 Category: Distribution and InstallShield
Date: Tuesday, April 17, 2007 5:37:40 PM         
   


Hi George.

> Vista (?) seems to be caching the original files somewhere, pulling them out of the ashes and restoring THEM again, rather than my populated tables.

I assume you're storing the data tables in a subdirectory of the program directory, which is a subdirectory of Program Files. Under Vista, you can no longer do that, as Program Files is considered to be a protected resource. Normally, this would cause your application to get a "file access denied" error when you try to write to the tables, but through a process called virtualization, Vista redirects writes (and later reads) to another folder. For example, it redirects writes to a file in C:\Program Files\Some Folder to C:\Users\username\AppData\Local\VirtualStore\Program Files\Some Folder, where username is the name of the logged-in user. For more information on virtualization, see http://msdn2.microsoft.com/en-us/library/aa905330.aspx.

When the user adds records to your tables, they're actually updating the virtualized copies, not the ones in your app directory. When they uninstall the application, those virtualized tables aren't removed. When they reinstall, Vista finds the virtualized tables and uses them. So, the user sees old data.

The solution is to change your application to not store its tables in Program Files, but instead in another folder the user can write to. You shouldn't hard-code the path because it may be different on Windows XP and Vista. You can use the code I published on my blog (http://doughennig.blogspot.com/2007/01/finding-paths-for-special-folders.html) to obtain the folder for a specific location.

> The user has administrator status.

You think they do, but they don't really. The MSDN article I mentioned above discusses the concept of a split token, in which when an administrator logs in, they actually use a standard user token for desktop application. This means they don't have administrative rights unless they elevate when prompted, so they don't have the permissions necessary to perform certain tasks, such as writing to protected resources.

Vista changes the way developers do things, but only because we didn't follow the rules before (we assumed everyone had admin rights to their systems). I highly recommend reading the MSDN article and test your app on a Vista system.

Doug



COMPLETE THREAD
Installation problem - on Vista Posted by George Kelly @ 4/17/2007 12:58:19 PM
RE: Installation problem - on Vista Posted by Doug Hennig @ 4/17/2007 5:37:40 PM
RE: Installation problem - on Vista Posted by George Kelly @ 4/17/2007 6:00:18 PM
RE: Installation problem - on Vista Posted by Doug Hennig @ 4/17/2007 9:17:51 PM
RE: Installation problem - on Vista Posted by George Kelly @ 4/18/2007 12:03:41 AM
RE: Installation problem - on Vista Posted by Doug Hennig @ 4/18/2007 5:08:56 PM
RE: Installation problem - on Vista Posted by George Kelly @ 4/19/2007 1:31:20 AM
RE: Installation problem - on Vista Posted by Dennis Longfellow @ 4/17/2007 6:07:17 PM
RE: Installation problem - on Vista Posted by Eric den Doop @ 4/17/2007 6:17:57 PM
RE: Installation problem - on Vista Posted by Doug Hennig @ 4/17/2007 9:18:34 PM
RE: Installation problem - on Vista Posted by Mike Gagnon @ 4/17/2007 9:59:59 PM
RE: Installation problem - on Vista Posted by Brad Schulz @ 4/17/2007 6:47:52 PM
RE: Installation problem - on Vista Posted by Doug Hennig @ 4/17/2007 9:12:09 PM
RE: Installation problem - on Vista Posted by George Kelly @ 4/18/2007 3:36:42 PM
RE: Installation problem - on Vista Posted by Doug Hennig @ 4/18/2007 5:16:58 PM
RE: Installation problem - on Vista Posted by George Kelly @ 4/19/2007 1:48:00 AM
RE: Installation problem - on Vista Posted by Ken Murphy @ 4/18/2007 5:34:46 PM
RE: Installation problem - on Vista Posted by George Kelly @ 4/19/2007 1:28:17 AM
RE: Installation problem - on Vista Posted by tushar @ 4/19/2007 6:52:50 AM
RE: Installation problem - on Vista Posted by George Kelly @ 4/19/2007 11:41:41 AM
RE: Installation problem - on Vista Posted by tushar @ 4/19/2007 2:14:41 PM
RE: Installation problem - on Vista Posted by George Kelly @ 4/19/2007 11:17:58 PM
RE: Installation problem - on Vista Posted by Ken Murphy @ 4/20/2007 1:45:39 PM
RE: Installation problem - on Vista Posted by George Kelly @ 4/20/2007 5:42:57 PM
RE: Installation problem - on Vista Posted by George Kelly @ 7/12/2007 1:55:03 AM