Yeah, you probably can't write to the program installation directory without elevated rights. To that point you shouldn't be saving settings to the program directory, either create a directory in C:\ProgramData if you want the settings to be available for all users or save into your user appdata\local\<programname> directory