Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Cannot upgrade app.exe.config during install if it has been modified by the user
 

Cannot upgrade app.exe.config during install if it has been modified by the user

I want my installer to upgrade files on the client. To do that I increment the Version and Product Code, but leave the Upgrade Code unchanged. It works fine, but if users modify anything in the app.exe.config file then the next time they try to install a newer installer then that file won't get upgraded.
Is there any way to always upgrade the app.exe.config file during installation regardless whether it has been touched/untouched by the end user?

Thanks.
TDN  Monday, June 30, 2008 8:53 PM

The update behavior of VS 2008 setup projects uses file update rules, and this means that files updated by the user won't be replaced. This is normally what people want, so that databases and so on don't get completely replaced.

The only way I know of is to modify your MSI file with Orca. In the InstallExecuteSequence table, delete the InstallExecute row (probably at 6500) and change the sequence of RemoveExistingProducts so that it is immediatly after InstallInitialize. This will result in the uninstall of the old product (the RemoveExistingProducts) being done before your files are installed.

PhilWilson  Thursday, July 03, 2008 8:14 PM

Hi TDN,

I assume you mean the User-Scope Application Settings since that Application- Scope Application Settings cannot be set by the users. I don’t think it is good idea to override the User-Scope Application Settings when upgrade an application. The User-Scope Application Settings is set by the end users and provide the users functionalities to custom the application. If you overwrite these settings, these configurations will be lost.

If you still want to overwrite these settings, you can save these setting to an individual file. And this file will be overwritten by default when you upgrade the application.

Hope this helps.
Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Thursday, July 03, 2008 1:09 PM

The update behavior of VS 2008 setup projects uses file update rules, and this means that files updated by the user won't be replaced. This is normally what people want, so that databases and so on don't get completely replaced.

The only way I know of is to modify your MSI file with Orca. In the InstallExecuteSequence table, delete the InstallExecute row (probably at 6500) and change the sequence of RemoveExistingProducts so that it is immediatly after InstallInitialize. This will result in the uninstall of the old product (the RemoveExistingProducts) being done before your files are installed.

PhilWilson  Thursday, July 03, 2008 8:14 PM

You can use google to search for other answers

Custom Search

More Threads

• Windows Installer deployment
• Hosting ClickOnce in Server 2008/IIS 7.0 Windows Activation Services??
• How to Attach .mdf file to SQL Server during installation of software and more..
• Is the 2.0 Framework required on the deployment server?
• Renewing an expired ClickOnce certificate
• Errors after deployment
• Populating InstallLocation in a VS Setup Project
• loose focus on vista
• Visual Studio 2005: Setup project. Installation location and creating shortcuts
• BMG System Checks