开发者

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 Insta开发者_高级运维llShield 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?


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.


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


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.


If I can throw one more answer in the hat, I was able to make an upgrade path that does not require setting/updating a specific Upgrade Code, Min or Max Version based on the generic ISPreventDowngrade upgrade path. According to the cautionary note in the Max Version description, You must specify a value for at least one of the version settings: Min Version, Max Version, or both. So I set the Max version to a generic placeholder. This done, I am not required to set a Max Version. So my configuration is as follows:

  • Upgrade Code: {00000000-0000-0000-0000-000000000000} (generic placeholder that will be replaced with current installer's upgrade code)
  • Min Version: blank
  • Include Min Version: No
  • Max Version: ***ALL_VERSIONS*** (version placeholder)
  • Include Max Version: Yes

All other fields I left unchanged. See http://helpnet.flexerasoftware.com/installshield23helplib/helplibrary/PreventingDowngrades.htm for more information, but beware the typos. Both the placeholders above are mistyped; I obtained them from the data used in the ISPreventDowngrade upgrade path.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜