1

I use a program called MSICREATE to generate msi packages for a piece of software. I then use orca to transform the msi package. Things work ok but users must delete the existing product before installing an update. I'd like to modify the msi package so the installer recognizes a newer or different version is being installed and removes the current version and then installs the new msi package.

What property table entries are needed?

=========

The answer given below has helped me get beyond my original problem and I thank Ciprian for his help. My major upgrade msi now deletes the existing product BUT does not completely re-install the product. My product consists of some text files, a help file, and a .exe file. The .exe file is not re-installed.

For whatever it's worth, I added answer below which summarizes what I added to my msi using orce.

Mike D
  • 2,753
  • 8
  • 44
  • 77
  • Create an installation log for more details: http://stackoverflow.com/questions/7126077/create-an-msi-log-file – Ciprian Feb 08 '12 at 06:40
  • @ciprian: I may not have changed the PackageCode. Is that required? I will try again later this afternoon. – Mike D Feb 08 '12 at 13:14
  • No it is not required. PackageCode uniquely identifies a MSI file so it should differ, but it does't affect the upgrade process. – Ciprian Feb 08 '12 at 13:19
  • I created a new msi as described above, assigned it a new packagecode and put a new valid productcode in the property table. When I run directly or using msiexec, I see only the delete and repair options. The new files do not get installed. The log file is here https://mywebspace.wisc.edu/mdorl/msilog/log.log IMHO, msiexec seems to have determined the software ok and identified the old and new msi packages. – Mike D Feb 10 '12 at 16:51
  • I'm beginning to get the idea that the only way to do an update is through use of msiexec with the proper remove parameters. Is that right? Or is it possible to do a major update using only the .msi file? I'm reluctant to release an update in the form of setup.exe and accompanying .ini and .msi file since that seems to invite the user to meddle. – Mike D Feb 10 '12 at 21:01
  • After examining your log I noticed that the FindRelatedProducts and RemoveExisting products actions are not present. You should also add them to the MSI because they are actually doing the upgrade. http://msdn.microsoft.com/en-us/library/windows/desktop/aa368600(v=vs.85).aspx – Ciprian Feb 11 '12 at 06:39
  • Thanks, nothing changed after the following. Taking a hint from orca.msi and a look at the docs, I added FindRelatedProducts to the InstallExecuteSequence table with sequence 200 right after LaunchConditions and to the InstallUISequence table with sequence 200 right after LaunchConditions (there being no PrepareDLG in my msi as there is in Orca). I added RemoveExisting products to the InstallExecuteSequence table at the very end with sequence 6700. – Mike D Feb 11 '12 at 12:10
  • I also tried moving the RemoveExistingProducts between the InstallValidate and InstallInitialize with sequence 1450 but still no joy. – Mike D Feb 11 '12 at 12:20
  • The log file from above is here mywebspace.wisc.edu/mdorl/msilog/log.log I see the FindRelatedProducts action BUT nothing on RemoveExistingProducts; it goes directly from InstallValidate to InstallInitialize. The msi is here mywebspace.wisc.edu/mdorl/msilog/sbl_Major.msi. – Mike D Feb 11 '12 at 12:48
  • I cannot find the FindRelatedProducts action in the log. May you have not posted the correct log – Ciprian Feb 11 '12 at 15:42
  • I discovered that I had not changed the PackageCode so I did so. Running the .msi then looked different. I was not presented with the repair/remove screen but with what looked like a normal nothing there install. BUT none of the files were replace and there was no mention of removing old versions. – Mike D Feb 11 '12 at 16:53
  • Continue previous comment. I then found two entries in add/remove programs, the new one being smaller than the old one. When I deleted the old one, nothing happened to the files. When I deleted the smaller new one I saw a configuring dialog of some sort flash by and then everything went away. – Mike D Feb 11 '12 at 17:11
  • The log file from the above is here https://mywebspace.wisc.edu/mdorl/msilog/log2.log – Mike D Feb 11 '12 at 19:37
  • The FindRelatedProducts action doesn't seem to find the already installed MSI. Do they share the same UpgradeCode – Ciprian Feb 11 '12 at 20:55
  • Yes, the UpgradeCode in both the installed and the new msi have {71D2224D-1BA7-46E9-B403-A4A54D5B87B4}. This also appears as the Upgrade code for the first and only line in the new msi's upgrade table. I now realize I have bad ProductVersion such as 2012.0207; could that be the problem? – Mike D Feb 11 '12 at 23:13
  • I changed the Upgrade table attributes from 769 to 1 with no effect. Will try later with legal ProductVersion. – Mike D Feb 12 '12 at 00:27
  • Changed both old and new versions to have valid ProductVersion Eg. 12.02.07. Also change Upgrade table ActionProperty to SOLARUPGRADE & added SecureCustomProperties property to Property table in new msi. Same results. – Mike D Feb 12 '12 at 00:46
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/7585/discussion-between-mike-d-and-ciprian) – Mike D Feb 12 '12 at 14:09

2 Answers2

2

I don't know how MSICREATE handles the upgrade scenario. However you could achieve this using ORCA. Here is a detailed upgrade example from MSDN.

Long story short both your packages must share the UpgradeCode. Also you must author an entry in the Upgrade table of the second package.

Ciprian
  • 3,533
  • 1
  • 18
  • 22
0

Here are the things I added to my msi using orca to effect a major upgrade. As I said above I still have a problem in that my .exe file is not reinstalled on a major upgrade. The .exe is added if one does a repair.

InstallExecuteSequence Table

  • added FindRelatedProducts with sequence 400
  • added RemoveExistingProducts with sequence 1450

InstallUISequence Table

  • added FindRelatedProducts with sequence 200

PropertyTable

  • added RemovePreviousVersions TRUE
  • added SECURECUSTOMPROPERTIES SOLARUPGRADE
  • had a existing UpgradeCode with guid created by MSICREATE
  • had a existing ProductVersion 12.2.12.0 created my MSICREATE

Added a Upgrade Table

  • UpgradeCode same value as Upgrade in Property Table
  • VersionMin null
  • VersionMax 99.12.31
  • Attributes 1
  • ActionProperty SOLARUPGRADE (same value as SECURECUSTOMPROPERTIES in Property Table)

I also assigned a new PackageCode and a new ProductCode so the new msi had different values of PackageCode, ProductCode, and ProductVersion than the previously installed product.

Mike D
  • 2,753
  • 8
  • 44
  • 77