I have an Inno Setup installer for an app that offers the user a choice between "Install for all users" and "Install just for me". If it is installed for all users, the INI file is placed in commonappdata and the settings are shared (this is a customer requirement). If it is installed for the current user, it is placed in Local settings appdata.
Once the app has been installed, what's the cleanest way for the app to "know" at run-time what the installation option used was and thus where it should read and save the INI file from? Also, I want the 'default' folder (the one the user is placed in the first time they try to open a data file) to be MyDocs for the single user install, and SharedDocs for the all users install, and I'm assuming the solution will work for that also.
Let setup write a registry value under HKCU if "install just for me" is chosen. Query the key at program startup and determine the default folder accordingly.
If you're using a task to let the user choose the installation type, you can use a registry entry like this:
Then at application startup you can do something like:
You can of course also read the registry value if you like.