-2

I have a project with a lot of MSIs (installed with a bootstrapper). Recently, after a major upgrade, I noticed that the previous version wasn't being uninstalled in Programs and Features (Win 7). That is, after upgrading from Version 1 to Version 2, both Version 1 and Version 2 are in Programs and Features.

This is a common problem, but it's a problem with a lot of different shades of grey -- I have an uncommon shade of this problem.

The problem may lie in a specific MSI. This MSI can only run during the initial install. Therefore I never change its version number. Here is what it looks like (to show that it's a legit Major Upgrade):

    <Product Id="*"
         Name="MSI"
         Language="1033"
         Version="1.0.0.0"
         Manufacturer="Bob"
         UpgradeCode="GUID-HERE">
    <Package InstallerVersion="200"
             Compressed="yes"
             InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes"/>
    <FeatureRef Id="ReferenceToFeature"/>
</Product>

Here's why I think this is the MSI that's causing the problem: when I run the major upgrade, I have Version 1 and Version 2 in Programs and Features. When I run the uninstaller with verbose log, I can see that it uninstalls all of the MSIs, in that I get the boostrapper uninstall log file, then I get separate uninstall log files for the rest of the MSIs.

If I look at the log file for this MSI, I noticed a problem. Here's the part of the log file that I think may be the problem:

                             ...
PROPERTY CHANGE:  Adding INSTALLLEVEL property.  It's value is '1'.
Disallowing uninstallation of component: {GUID-HERE} since another client exists
Disallowing uninstallation of component: {GUID-HERE} since another client exists
                             ...

I recognize the GUIDs. They are GUIDs for components in my MSI. I know that this means that another program is using the resource -- that's why it won't uninstall -- but for the life of me I can't think of what program that would be! I'm installing on a clean virtual machine, and the program that my installer installs isn't running when I uninstall!

Some more info that makes me think that this MSI is causing the Programs and Features doubling-up: after I uninstall Version 2, I'm left, of course, with Version 1. When I uninstall Version 1 with verbose logging, the only log for an MSI that pops up is for the MSI in question! No other MSIs are uninstalled during that uninstallation.

I've tried adding the attribute AllowSameVersionUpgrade="yes" to the element to the MSI -- this

<MajorUpgrade AllowSameVersionUpgrade="yes" 
              DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

-- and that actually breaks my installer, because it makes the MSI install during the update installation, where I only want the MSI to install during the initial installation. It also doesn't fix the problem, in that both version still show up in Programs and Features.

However, it does cause the MSI to be uninstalled the first time through. That is, before, when I didn't put in the AllowSameVersionUpgrade="yes" attribute, the MSI wouldn't successfully uninstall during Version 2 uninstallation, and then when I uninstalled Version 1 I would get a log file uninstalling it. When I add the attribute, I still get the doubled up versions in Programs and Features, except this time I can uninstall the MSI during the first uninstallation, and then, during the second uninstallation (the version that shouldn't be there in the first place), I don't get any MSI log files -- all I get is the bootstrapper log file.

Can anyone shed light on this problem?


OK! I managed to recreate the problem in a toy program, so, hopefully, solving this problem should be much simpler!

Mr. Asmul, I appreciate your interest. However, I solved the problem. I made a very, very dumb mistake that I'm far too embarrassed to admit. Safe to say I've been chasing my own tail for two days and costing my employers money because... well, I was dropped on my head as a baby, and as a result I'm none too bright.

Bob
  • 369
  • 1
  • 4
  • 24
  • 3
    I would urge you to either share your fix as an answer to your question (however dumb you think the mistake was, it doesn't mean others won't make it as well), or consider deleting the question. There's little that's more frustrating when researching a problem than to come across traces of "I solved it [but won't tell you how]!" – Michael Urman Sep 13 '17 at 12:41

2 Answers2

2

Your problem is indeed common, at least on the face of it, but I don't quite understand the whole problem scenario. When you have two versions of the same MSI in add/remove programs your major upgrade has failed. When you then uninstall one of the versions, you will get the log file entry you indicate:

Disallowing uninstallation of component: {GUID-HERE} since another client exists

Essentially each MSI component is installed twice with a ref-count of 2 because two versions of the same MSI is installed. Uninstalling both MSI setup versions should correctly remove the components in question (because then the ref-count goes down to 0 for the components).

"This MSI can only run during the initial install" - what does this mean exactly? I have read it again, and I am afraid things are just not clear to me.

These other MSI files, the suite - what are they, what do they install, do they install to the same or different locations? Why are they separate MSI files if they always install together?

Please prefer to update your question rather than adding too many comments.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
0

While not strictly the same as the question, I'll add a variant of the same problem. I was using my own custom bootstrapper application (BA) and getting the same problem. This was because I hadn't added support to the BA to process command line args and run silently. Specifically the upgrade will run the old BA telling it via the command line to run silently and do an uninstall (which I wasn't handling).

As an aside if you are implementing your own BA, I highly suggest you download the WIX source code as it also implements a custom BA.

PS: This thread provides a range of options for getting upgrades working correctly. Note that some of the options like using the Upgrade/UpgradeVersion pre-date other options like the MajorUpgrade element.

How to implement WiX installer upgrade?

donovan
  • 1,442
  • 9
  • 18