Skip to content
⌘ NSIS Forum Archive

Manage user profile

3 posts

alecs26#

Manage user profile

Hello,

My software use some parameters which can be configured by each person. I keep the user profile in text or xml files. My software default installation location with NSIS is Program Files.

The problem is that the user can't modify his profile since the user configuration file is in ProgramFiles (even if he is admin, it does not work).

The easy solution would be to install the program to somewhere accessible such as C:\Users\Public. I don't know if there's a way to set this folder as default but I could just write I guess: InstallerDir "C:\Users\Public\MyProgram" instead of InstallerDir "$PROGRAMFILES".

However, I am not sure that it is the clean/good way of doing this. I guess the good way would be to install my program in ProgramFiles and to set up another folder (such as Users\Public) to place the profile files.
However, I don't know how to
1) Set this up with NSIS
2) I don't understand how I will tell my program to go get the files in this folder since the path to the user profile is already compiled in my program.

Thank you very much !

Alex
Anders#
Application data should be stored in $AppData and/or $LocalAppdata. Use SHGetFolderPath to get this path in your application.