Squirrel / Squirrel.Windows

An installation and update framework for Windows desktop apps
MIT License
7.36k stars 1.03k forks source link

Installing .config file to another location #1550

Open BlagoCuljak opened 5 years ago

BlagoCuljak commented 5 years ago

Hi there, I have an WPF app that uses .config files in which are located URL to API services to connect.

If I update application, it runs over the .config, and URL is not valid for that user anymore.

If I move selected .config file to another folder as suggested here, how can I put the config file to some other folder outside of installation of Squirrel folder?

Do I need to connect to users and put the config file in some folder, each and every time someone installs my app?

Thieum commented 5 years ago

You can set the app.config to another arbitrary file that could be located anywhere outside of the install folder: https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/appsettings/appsettings-element-for-configuration

BlagoCuljak commented 5 years ago

Yes, I understand that, but do I need to put that file out of install folder, manually?

Thieum commented 5 years ago

You can create it from your program if it doesn't exist (first use of your program) with default values. If it does exist (next use), you can load it and read the config. It can be done without going the AppSettings way, with a file that you manage yourself.