0
votes

After using the free version of InstallShield and installing my app on my machine I noticed that my data file (a sqlite .db file) is being saved in a different location than when I run it under Visual Studio. Basically instead of being saved in the directory with the .exe file it is being saved here: C:\Users\blaaah\AppData\Local\VirtualStore\Program Files (x86)\MyAppA\MyAppA

My .exe file with its .dll files is being saved here: C:\Program Files (x86)\MyAppA\MyAppA

I am curious as to why that is happening? I am also curious on how to get that directory that contains my data file with code.

1
Because InstallShield is smart. Google for AppData (to example, here is something). - Sinatr

1 Answers

1
votes

The VirtualStore folder is caused by file system redirection done by UAC. By doing this, Microsoft was able to lock down the Program Files directory without sacrificing too much backward compatibility. Any time an application tries to write to the program files location, the write will be redirected to the Virtual Store.

A decent writeup on this on MSDN can be found in the User Account Control For Game Developers article.

To quote that article:

Virtualization affects the file system and registry by redirecting system-sensitive writes (and subsequent file or registry operations) to a per-user location within the current user's profile. For example, if an application attempts to write to the following file:

C:\Program Files\Company Name\Title\config.ini

the write is automatically redirected to:

C:\Users\user name\AppData\Local\VirtualStore\Program Files\Company Name\Title\config.ini

Likewise, if an application attempts to write a registry value like the following:

HKEY_LOCAL_MACHINE\Software\Company Name\Title

it will be redirected instead to:

HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\Software\Company Name\Title