Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent .NET config file being overwritten during install

I'm using InstallShield 2010 Express to install a .NET WinForms app. The latest InstallShield project is a major upgrade, so I've used the Upgrade Paths section to allow upgrades from earlier versions of my app.

The problem is that config settings made during the initial install (written to Program Files\MyCompany\MyApp\myapp.exe.config) are being overwritten when installing the latest upgrade. This means that the user has to make all of the config settings again - not good.

In the InstallShield project, myapp.exe.config is set to use Windows Installer Versioning Rules. I've even tried setting the create/mod date of myapp.exe.config very old (1/1/1999) so that it shouldn't overwrite the file on the target system.

Other than this the installer works fine. How can I prevent this file from being overwritten?

like image 273
Richard B Avatar asked Nov 05 '22 20:11

Richard B


2 Answers

set condition at isxmlinstall in sequence with "NOT Installed AND NOT PATCH" isxmlinstall is function for upgrade xml will not launch when upgrade.

like image 108
P_Sumantri Avatar answered Nov 15 '22 10:11

P_Sumantri


Check the attributes of the .config file in the installer, if its marked as a key item and the user has modified it since it was installed the system will use the MSI to replace it believing it to be damaged and in need of repair.

like image 38
Pete Stensønes Avatar answered Nov 15 '22 11:11

Pete Stensønes