Program folder on Windows Vista
hi,
Everyone knows that Windows Vista is no longer advisable to keep the details of an application in the same folder of the executable. I seem to have identified a good place to keep local database, configuration files and other files read / written by the program, in a subfolder of "ProgramData" but I do not think that there is either an environment variable or a function that bullet APIs to this path. Yet InnoSetup allows you to install files using the default constant common appdata (). Someone knows how I can locate the program? Thanks in advance.
Re: Program folder on Windows Vista
Code:
System.Environment.GetFolderPath
You can identify a large number of system folders, including:
Code:
Environment.SpecialFolder.ApplicationData
namely that relating to application data. The folder is the user currently logged on.
Re: Program folder on Windows Vista
But this returns me something else, namely:C: \ Users \ Arthur \ AppData \ ...
I was interested to get to C: \ Program Data ie to the folder that happens to the files installed by specifying the constant InnoSetup commonappdata ().
Re: Program folder on Windows Vista
With ALLUSERPROFILE get the All Users folder in Document and Settings. AppData instead provides you with the Application Data folder on the user currently logged on. Environ queries with the collection of environment variables that, theoretically, could not be set on another PC. Probably would have better security and better reliability by using the appropriate API to find the Special Folder: PI: Retrieving a Special Folder's location.Using the API you can get the Application Data folder in the All User, then common to all users, with the constant CSIDL_COMMON_APPDATA.
Re: Program folder on Windows Vista
It depends on what data do you refer: ALLUSERSPROFILE \... is the folder for the data common to all users, eg. If you use a local DB, you can put it there. If instead we talk about personal data of AppData, then you should use, or in the My Documents folder of the current user. The difference between the two is that AppData is hidden to the user, and you can get, unless you know how to change the option to make it visible. In the documents, however, the user can see the folder and files that you install. In short, depends on the type of access to the files you want to give to you. Note that in the constant InnoSetup commonappdata () is an internal name, that name does not exist in Windows, as there is the C: \ ProgramData. InnoSetup in the guidance indicates that the constants refer to the same folder: userappdata () & () commonappdata The path to the Application Data folder.