Skip to content
⌘ NSIS Forum Archive

Possible to make a config file writable?

4 posts

wrybread#

Possible to make a config file writable?

I'm using NSIS to install a program under Windows 10, and it installs to C:\Program Files (x86)\MyProgram

It creates a config file in that folder:

C:\Program Files (x86)\MyProgram\configs.txt

But I need to be admin to modify that file. Is there some way for NSIS to create that file with user control permissions?

If not, is there some other directory I should be creating that file in?

Thanks for any help.
Anders#
The AccessControl plug-in can change the security but application configuration files that users modify should be stored in %AppData% ($AppData).

Your program should create this file, not the installer.
wrybread#
The AccessControl plug-in can change the security but application configuration files that users modify should be stored in %AppData% ($AppData).
Thanks for that. I'd much prefer the program is "portable", with all the files in one location, so hoping to avoid that. But I guess that's a good fallback.

Your program should create this file, not the installer.
If my program creates the config file in it's program directory, would that file then be writable?
Anders#
$ProgramFiles is not writable for normal users. If multiple users run your program at the same time from program files you will get issues. Portable programs should not be installed in Program Files for this reason.

Some programs support normal and portable mode by looking in a config file in the same folder as the .exe.