We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

NorthGates
Posts: 5
Joined: Sat Feb 16, 2013 8:44 am

VS 2012 Problem with upgrading app.exe.config

I tried pretty much everything to have my app upgrade keep user config changes but so far, once the user installs a newer version, the user config file no longer updates.

I am using a combination deploy setup.exe for language choice, myappsetup.msi and myappsetup1.cab.

In my deploy project, I included myapp.exe.config and when I upgrade the deploy project I choose Major Upgrade.

Anyone has resolved the deployment where the myapp.exe.config actually migrates?

Visual Studio 2012, .NET 4.0 Deployment, AI PRO Trial v9.9
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: VS 2012 Problem with upgrading app.exe.config

Hello,

I'm afraid I don't fully understand what you want to achieve. Do you want to overwrite the related file on upgrade or to preserve it during upgrade? If you want to preserve its content you can take a look on our "Prevent Repair or Uninstall" article which debates a similar issue.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
NorthGates
Posts: 5
Joined: Sat Feb 16, 2013 8:44 am

Re: VS 2012 Problem with upgrading app.exe.config

Upgrading a Visual Studio App creates a folder where the user configuration settings are copied. My problem is I cannot figure out how to properly make my AI Project do an upgrade.

In other deployment package application, you would add the previous MSI package to tell the deployment this is an upgrade.

Any forum section or keyword I can search for Visual Studio Deployment Example, your software is so great, there must be a lot of WinForms developers :-)
NorthGates
Posts: 5
Joined: Sat Feb 16, 2013 8:44 am

Re: VS 2012 Problem with upgrading app.exe.config

Ok, the problem was inside my main application form where I must tell it to upgrade, all is well.

Just in case others would like to know how I set my Visual Studio 2012 (VS2012) Advanced Installer Project (AIP).

In my VS2012 app main form I added:

Code: Select all

        public frmMain()
        {
            InitializeComponent();
            //[b]IsFirstLaunch[/b]is a boolean set to true in settings
            if (Properties.Settings.Default.IsFirstLaunch )
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.IsFirstLaunch = false;
                Properties.Settings.Default.Save();
            }
        }
The scenario below is ideal if you have many files in your VS2012 project that the 'Build Action' for those files is set to 'Content'.

In AIP Files and Folders:
- I only added my main app exe from my bin\release folder so I can point shortcuts to it.
- I then created a folder called 'Release' that points to my main project bin\release folder then made that folder a Sync folder, I told the folder to Install folder content into the parent folder and then added some exclusion files and file extensions as well as excluding my main app exe as it is already included in the deployment package.

Before I create a deployment package:
In VS2012
- I change my build from Debug to Release
- I increase my application assemblies and files version
- I Clean then rebuild my main project

In AIP:
- Under Product Information - Product Details, I increase the Product Version and answer 'Major Upgrade' when asked.
- Under Resources - Files and Folders, I click my Release Sync folder and in the toolbar Files and Folders Tools, I click the Refresh button.

I can now build and run my deployment!

Return to “Building Installers”