Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring InstallShield LE to remove previous versions built using Visual Studio Setup Projects

Using Visual Studio 2010, I would like to switch over to using InstallShield LE instead of the Visual Studio Setup Project.

In the Setup Project, an option RemovePreviousVersions existed which was great for making an installer that would essentially do an in-place upgrade when a new version is released.

Now with InstallShield LE, I've updated the version and generated a new ProductCode, but after running the installer, the previous version is still present.

What do I need to do so that the InstallShield-built project can remove the previous version which was built with the VS Setup Project?

like image 353
JYelton Avatar asked Jun 22 '11 22:06

JYelton


3 Answers

This drove me crazy when I first started with a project in Visual 2012. I kept getting duplicate copies in the add/remove programs, and the old version wasn't updated. Here's what I found I needed to do.

Under The Upgrade Paths, create a new path. Leave the min version blank (unless you need it), include min version yes, Max version should be set to the version YOU ARE INSTALLING NOW. Include max version to yes.

Each time you are installing an update, advance the Product version in the General Information section. Click on a new Product Code in the General Information Section DO NOT CHANGE the upgrade code

Go back to the upgrade path, and set the Max version to the same version you are deploying now. This was key to getting this working for me.

This process uninstalls previous version, and installs the latest. No duplicates in add/remove programs.

Hope this helps.

like image 184
user2321103 Avatar answered Sep 28 '22 05:09

user2321103


You can try this:

  • open your old MSI with Orca and get its UpgradeCode from Property table
  • in your InstallShield LE project go to "General Information" in solution explorer
  • make sure that the "Upgrade Code" field is set to your old MSI UpgradeCode

You should also make sure that ALLUSERS property has the same value for both versions (it's the same approach). You can read more about upgrades here: http://msdn.microsoft.com/en-us/library/aa369786(VS.85).aspx

like image 35
rmrrm Avatar answered Sep 28 '22 07:09

rmrrm


user2321103's answer is excellent, creating the new upgrade entry in Upgrade Paths is the key thing. It is unfortunate that this option is hidden away as it is required in order to produce what most people would naturally expect to be the normal default behaviour for a setup program.

The reason for this new answer is that I found that I could set the Max Version in the Upgrade Entry to a higher number rather than the current version. This means I won't have to remember to update this for every new release. My current version is 2.1.8 so I set Max Version to 2.1.9999. In the unlikely event that I might want different behaviour in some future release I can up my version to 2.2.x

The Microsoft Setup Project would automatically update the Product Code whenever you altered the version number, but Installshield LE doesn't, so will need to remember to do this every time.

As the other answers state, it is important that the Upgrade Entry uses the Upgrade code from the previous installed versions. I haven't tried this, but presumably if for some reason you have more than one previous version with different upgrade codes, then you can create a separate upgrade entry for each.

I don't understand why you can't just set both Include Min Version and Include Max Version to No, but this doesn't seem to work. I have not tried every combination of these different parameters but as stated in the other answer the following settings seem to do the trick:

  • Min Version: blank
  • Include Min Version: Yes
  • Max Version: >= current version
  • Include Max Version: Yes

It also seems to be important not to change Lang Search Criterion to Exclude. I have also set Ignore remove failure to Yes. I have Migrate Feature States set to No, but I don't think this is relevant for the LE edition anyway.

like image 27
Phil Preen Avatar answered Sep 28 '22 07:09

Phil Preen