A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.
Can anyone offer advice on the best practice? I prefer not to use the registry. In the past, I could place my app and data files in a single folder. With Vista, certain folders (under Program Files, for example) are "read-only". If I use an INI file to point to the data location, it can't go in the folder under Program Files without being virtualized, and I use the INI file for window position settings and other user preferences. What about a separate folder off of the root for everything? Also, if I give the end user a choice of locations during setup, how do I protect them from a bad choice - one which will break when they exit admin mode to run the app? Any thoughts would be appreciated...
Use the Documents and Settings\%user%\Application Data folder. There is an API to get it automatically.
I hate programs that create things on the root for me. And you can't guarantee that you can write to the root either. You can guarantee you can write to the App Data folder (it's what it's designed for).
Read the docs in the "Get technical guidance" section of this link.
Friday, April 27, 2007
You can't use 'Program Files' in XP Limited User accounts either, so this is nothing particularly new. Vista just imposes the same restrictions on all accounts and programs, except Installers.
Use the Documents and Settings\%user%\Application Data\CompanyName\AppName folder as mnetioned above.
Sunday, April 29, 2007
I suppose that the API to use is
WINSHELLAPI HRESULT WINAPI SHGetSpecialFolderLocation(
And the nFolder parameter is CSIDL_COMMON_APPDATA. I am already testing, because all my apps have to be redesigned.
Is this the correct way?
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz