Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Prevent installing and old version of a product


2 replies to this topic

alexrait1

alexrait1
  • Full Members
  • 2 posts

Posted 05 January 2011 - 11:46

I have a basic MSI project in Installshield 2011 with version 1.1.0
When creating an upgrade I am adding a new MajorUpgrade,
changing the product code (new GUID) and the product version to 1.1.1
(keeping the upgrade code as is).

When installing the newer version on top of the old one it succeeds and in the add/remove programs I can see one entry of the application with the new version - 1.1.1.

However when trying to install again the old version on top of the new one, it doesn't show an alert saying that a new version is already installed, but completes the installation and now in the add/remove programs I can see two entries of the application - one for each version.

Question: How do I prevent installing any earlier versions of the application?


lilache

lilache
  • Full Members
  • 40 posts

Posted 06 January 2011 - 12:55

There is a built in custom action called "ISPreventDowngrade" and the conditions to using it should be something like this:
(ISFOUNDNEWERPRODUCTVERSION And IS_MAJOR_UPGRADE<>"Yes") Or INSTALLED_VERSION > CURRENT_VERSION.

You should locate this action after the action "FindRelatedProducts"

hope it helps

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 06 January 2011 - 17:06

You will also need to add a Major Upgrade item that actually only checks for a newer version and then sets this property. This Major Upgarde items needs to be in the older version of your project, so if the old version already shipped it's too late.
InstallShield adds this by default when you create a new project, so you can look at it in a new test project (to see the custom action you need to check "show all custom actions" in custom action view)