[Qt-interest] Windows 7 and VirtualStore woes

Chris W qtinterest at psychogeeks.com
Thu Sep 10 23:40:40 CEST 2009


Noah wrote:
> Don't write to the Program Files directory. Use the %APPDATA% directory 
> instead.

Unfortunately, the common app data directory (CSIDL_COMMON_APPDATA) is
also not writable to a standard user and therefore gets the virtual
store treatment.  The user's app data directory (CSIDL_APPDATA or
CSIDL_LOCAL_APPDATA) is writable.  However, the UAC elevated updater
program does not necessarily see the user's app data directory or
virtual store when elevated (similar problems are encountered  when
creating a user-specific shortcut from an elevated installer).

> The VirtualStore was created as a compatibility layer for software
> that (incorrectly) writes to the program files directory. In an
> ideal world it wouldn't exist and all the software that was designed
> to write user data to the program files directory would be thrown out.

Perhaps, but these "incorrect" programs would have been fixed a lot
sooner if they had failed, or if Windows popped up a big warning banner
the first time a freshly started exe did something that was virtualised.

> Microsoft has a
> long history of preferring backwards compatibility over idealism.

After my past two days of wasted effort, I wish they'd applied some of
this to the CreateProcess() and ShellExecute() ;)


My suggestions for the OPs problem are:
Have the updater extract the version number directly from the executable
resources, or
Have the updater also write the VERSION file when it replaces the
executable.



More information about the Qt-interest-old mailing list