1

I have a wxs-file containing the following snippet:

<Upgrade Id="{FE576A6C-AF60-4569-B81D-1B025F88F9D7}">
    <UpgradeVersion Property="LCGUID" OnlyDetect="yes"
        Minimum="0.0.0" IncludeMinimum="yes"
        Maximum="9.0.0" IncludeMaximum="no" />
</Upgrade>

This will look for another piece of installed software (named LC) and set the upgrade version guid to the property LCGUID. This is later used to verify that for example the correct LC is installed.

This works when "installing" or "upgrading" the software. I can see this in the logs:

MSI (c) (9C:A8) [02:28:48:422]: PROPERTY CHANGE: Adding LCGUID property. Its value is '{8023DC00-D425-4DE8-808C-C78FAD649A2F}'.

Now, when I try to do a repair, I also need this property to be filled, but the log doesn't say anything about LCGUID.

I suspect that the "Upgrade" element isn't executed when repairing. Can someone verify this and provide a possible solution?

1 Answer 1

3

If you look in the log you should see something like "Skipping FindRelatedProducts action: not run in maintenance mode", and that's what does the UpgradeCode search, so you're correct in that it does not run in maintenance/repair modes.

At first install you when upgrade searches are done, you could save that property in the registry, use a WiX 'remember property' pattern. It does mean you'll need two separate searches, when during fresh install and one for maintenance mode. In general you'd use another property for the registry search, and then have a custom action property set that just sets LCGUID to REGISTRYGUID conditioned on Installed.

1
  • This was the solution I initially had, but I didn't like the use of the registry when "search component" functionalities are available. We switched from using the remember property pattern to the use of the upgrade GUID because it seemed a better solution. Until we found out that it didn't work for repairs. Eventually, I'm still not using the remember property pattern. The end goal was to use the retrieved product GUID to locate some file that we needed. In my new solution I simply added a component with a GUID for which I then search. This seems to work in all circumstances! Thanks though!
    – Gurdt
    Dec 29, 2014 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.