[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

Create an installer with VS.Net that replaces/unistalls existing versions

Hi all,

I need to create an installer/setup project with VS.Net that will overwrite, update or uninstall any existing versions.  

I've set the property RemovePreviousVersions to true but if the installed version is different than the version I'm installing I get a popup saying "Another version is installed.  Installation cannot proceed etc etc".
0
alexatsearidge
Asked:
alexatsearidge
1 Solution
 
igor_alphaCommented:
Hi, alexatsearidge!
Your problem cannot be solved by using VS setup project properties and installer class. It's because custom action will start after version validating.
It's not enough to just set RemovePreviousVersions Property to true.
1. You need to set RemovePreviousVersions Property to true.
It specifies whether an installer will remove previous versions of an application during installation. If this property is set to True and an earlier version is detected at installation time, the previous version's uninstall function will be called.
2. The installer checks UpgradeCode and ProductCode properties to determine whether the earlier version should be removed. The UpgradeCode must be the same for both versions, the ProductCode must be different.

So, on new version of app when preparing setup you just changing setup version and product code, leaving UpgradeCode same. The old app would be overwrited with new version.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now