Prevent overwriting the .NET configuration file during installation

I am using InstallShield 2010 Express to install the .NET WinForms application. The latest InstallShield project is a major upgrade, so I used the Upgrade Paths section to upgrade versions from earlier versions of my application.

The problem is that the configuration settings made during the initial installation (recorded in Program Files \ MyCompany \ MyApp \ myapp.exe.config) are overwritten when the last update was installed. This means that the user must complete all configuration settings again - not good.

In the InstallShield project, myapp.exe.config is configured to use the Windows Installer Version Rules . I even tried to set the creation date / mod myapp.exe.config to be very old (1/1/1999) so that it would not overwrite the file on the target system.

In addition, the installer works fine. How can I prevent this file from being overwritten?

+4
source share
4 answers

set the condition in isxmlinstall in sequence with "NOT Installed AND NOT PATCH" isxmlinstall - the function for updating xml does not start when updating.

+1
source

Check the attributes of the .config file in the installer if it is marked as an element , and the user changed it from the moment of its installation, the system will use MSI to replace it, believing that it is to be damaged and in need of repair.

+1
source

Does Installsheild have a "before_install" section of the script? You can copy the existing configuration file and overwrite the new one after installation.

0
source

Try using ApplicationSettingsBase.Upgrade () or ApplicationSettingsBase.GetPreviousVersion ()

http://msdn.microsoft.com/en-us/library/system.configuration.applicationsettingsbase.upgrade.aspx

0
source

All Articles