Jake Fairbairn
Jake Fairbairn

Reputation: 223

C# Setup Project Installer Not Removing Previous Version

I want to write an msi installer that uninstalls the previous version when it is run. I have a setup project in VS 2013 with DetectNewerInstalledVersion=True and RemovePreviousVersions=True. Here is what I do:

  1. I change the version number (eg from 1.0.3 to 1.0.4).
  2. I make sure the ProductCode changes and the UpgradeCode does not.
  3. I right click the setup project and click Build.
  4. I run the msi file in the Debug folder.

The msi runs just fine, but the old EXE is still in the programs folder. It successfully installs the program if it's a fresh installation though. What am I doing wrong?

Upvotes: 3

Views: 4493

Answers (2)

SACn
SACn

Reputation: 1924

Why don't you plant a custom action to backup and delete previous installation folder for additional safety :)

Upvotes: 0

Jake Fairbairn
Jake Fairbairn

Reputation: 223

I've finally found the answer actually, and I'll post it here for people who stumble across this. Here's the one step I was missing:

You need to go to Properties > AssemblyInfo.cs in your project and update the AssemblyVersion and AssemblyFileVersion numbers. Otherwise your EXE for this project won't actually update. Hope this helps!

Upvotes: 8

Related Questions