Always perform removal/reinstallation during upgrade
Asked Answered
I

2

6

I'm having a little trouble understanding how InstallShield treats upgrades.

What I want is to be able to increment the version number on the installer, recompile, and distribute my installer. This should automatically remove any previous version of the application, and install the latest version (and it should be presented to the user as an "upgrade").

This is a very straightforward installer, it just takes output from a few Visual Studio projects (an application EXE, some DLLs and so forth) and installs them all into Program Files. There is only one feature and it is always installed.

I don't want to change the upgrade code of the product because I would then have to create new upgrade paths (one for each previous version), which is messy.

I've tried this before (incrementing the version number, but not changing either the Product Code or the Upgrade Code), but each time I do, when I run the installer to "upgrade" the product, it says "Resuming the wizard for [ProductName]", and sometimes some of the files are not replaced with their newer counterparts from the newer installer.

I am not incrementing the "revision" number of the version number. I know that's ignored. Typically, I will try something like 2.0.3 => 2.0.4.

How can I set up InstallShield so that it automatically removes any previous versions, installs the newest version, and presents this to the user as an "Upgrade" or "Update" if they already have a previous version installed? If not, it should install like normal (an "Install", not an "Update").

I'm using InstallShield 2013 Pro (Version 20 SP1), and I stick to using the InstallShield Editor within Visual Studio 2010.

Ind answered 30/4, 2014 at 17:35 Comment(6)
What project type are you using? Installscript MSI, Basic MSI, pure Installscript?Flexed
I believe it's a Basic MSI project, but I'm not that familiar with InstallShield so I don't know for certain. It has an .isproj file and an .ism file in the project folder.Ind
I think you may be able to achieve what you want by just updating the Upgrade table in addition to what you are already doing. Read this thoroughly please: apprepack.blogspot.no/2012/06/msi-upgrade-table.html . Essentially update the VersionMax field. This assumes the setup is already set up for a major upgrade scenario.Flexed
I still don't understand how that translates to what I'm supposed to do inside of InstallShield. Have you used the InstallShield Editor inside of Visual Studio? i.imgur.com/MJdq2lM.pngInd
You can update the Upgrade table from the Direct Editor in Installshield. Or you should be able to do the same from the Upgrades view, but the Direct Editor gives you the raw MSI tables. It is down to the metal so to speak and there are no intervening variables. The Upgrades view is essentially a shell that upgrades the property table, the Upgrades table and parts of the InstallExecuteSequence.Flexed
Think of Upgrade code as identifying a family of products, and a product code as identifying a single product installation.Flexed
S
6

What you need is a major upgrade. This is essentially an automatic uninstall of the existing version and reinstall of a new version done as one operation by the Windows Installer Engine itself after you author the Upgrade table of the MSI, set a new ProductVersion and change the package and product code. This is the least error prone update mechanism in Windows Installer. To implement a major upgrade in Installshield go to the Upgrades view and add an upgrade item. Then you follow the GUI wizard or pages and set upgrade options. I will see if I can find a better link for you now, but this should get you going.

To really understand Windows Installer Upgrades you should read this book chapter. Or this Microsoft MSDN page.

Just for completeness: a minor upgrade - which is upgrading the existing install without uninstalling it, is generally more difficult to get right in the beginning. A number of technical restrictions apply. Here is a very good summary of what is required for a minor upgrade to work (as well as other details): http://www.installsite.org/pages/en/msi/updates.htm

Stiffen answered 30/4, 2014 at 18:59 Comment(2)
That's the thing, though ... we push out frequent versions of products and creating an Upgrade Path/Upgrade Item for each product inside the InstallShield project is cumbersome. The application should support upgrading from any previous version, so this would require an item for every previous version in existence.Ind
Update: This is actually correct, we were changing the upgrade code, not the product code (the names of these properties are confusing, and seem backwards!). Our major upgrades now work from any previous version.Ind
S
0

In that case you can use COM automation to automate the release process using Javascript or VBScript. This is a familiar process if you have automated other products before such as Word or Excel. Here are some resources to get going:

I made a build process once using this kind of VB scripting and also a build tool called FinalBuilder that took care of the rest of the build process. I guess FinalBuilder might have an action for Installshield by this point so you can bypass the scripting altogether. I don't know for sure. Just wanted to link to the GUI so you can see what the tool looks like. Further screenshots.

Stiffen answered 30/4, 2014 at 19:10 Comment(3)
We already use TFS for build automation, which also has InstallShield integration. I am not a build engineer, so I'm struggling to understand what this has to do with building self-updating installers? We usually hand-build our installers using Visual Studio (we're a small team).Ind
That build process should be able to spit out an MSI that performs a major upgrade of all previous versions on demand - or it is not a complete build process. I have not used TFS and can not describe how things are done there.Flexed
I guess that's my question - how can I do that without a build process? How can I create a setup executable that will major upgrade itself from any previous version... but only using the InstallShield editor?Ind

© 2022 - 2024 — McMap. All rights reserved.