1

I am having trouble detecting the repair in my msi condition.
In installshield cheat sheet is written:

REINSTALL~="ALL" AND NOT REINSTALLMODE><"v"

Which means REINSTALL is case insensitive equals to "ALL" and REINSTALLMODE does not contains "v" letter.
In my MSI, this values are set to REINSTALL="ALL" and REINSTALLMODE="ocmusv". Why is the v letter there? Is the cheat sheet wrong? What is the correct way to detect reinstall?

Marek
  • 486
  • 7
  • 19
  • This should help: http://stackoverflow.com/questions/320921/how-to-add-a-wix-custom-action-that-happens-only-on-uninstall-via-msi – Yan Sklyarenko Feb 12 '14 at 12:01
  • Thank you, but i was hoping for some best practice answer. According to the post i should use: REINSTALL AND NOT REMOVE~="ALL" AND UPGRADINGPRODUCTCODE AND NOT INSTALLED. Which I have high expectation it wont work correctly in all desired cases. Mainly I wanted to know why http://resources.flexerasoftware.com/web/pdf/archive/IS-CHS-Common-MSI-Conditions.pdf is wrong in my case. – Marek Feb 12 '14 at 12:14
  • I suppose you can check this little chart (first answer): http://stackoverflow.com/questions/320921/how-to-add-a-wix-custom-action-that-happens-only-on-uninstall-via-msi?lq=1 – Stein Åsmul Feb 20 '14 at 14:29

2 Answers2

3

The cheat sheet is likely to be wrong for some repairs, those that are initiated by the system, because REINSTALL will not be "ALL" - it will be a feature name. The issue with that other condition is that property names are case-sensitive and the installed condition is not spelt "INSTALLED", it is fact "Installed". UPGRADINGPRODUCTCODE is not relevant because it is set when the product is being upgraded by an incoming major upgrade, which nothing to do with repair. Also, I think that not all repairs set "v" because I think I've seen a repair command line of "omus".

It's often futile to try to detect repair, and my advice is to forget trying to distinguish repair. All that's happening is that the component is being installed again and it might be broken. The Installed property will be set, so you know it's not a fresh install, and REINSTALL will be set because one or more features are being installed. Without knowing what you're trying to accomplish with that condition I don't know what else to say. Sometimes it's more useful to say what problem you're trying to solve.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
  • Thank you for your answer. I was trying to resolve my confusion because in cheat sheet is written something and it doesnt work for the basic scenario where I only click Repair in add or remove programs. – Marek Feb 13 '14 at 10:36
  • Yup, repair in Add/Remove Programs is where I've seen that "omus" command line. – PhilDW Feb 13 '14 at 18:14
  • I generally just disable custom actions that don't need to re-run during self-repair with Not Installed and whatever other condition is needed. Need more details about what the guy wants to achieve. – Stein Åsmul Feb 20 '14 at 14:26
0

I suppose you can check this little chart (first answer): How to add a WiX custom action that happens only on uninstall (via MSI)?

I haven't tested the accuracy of the information, but it looks ok. UPDATE: I just pointed directly to the answer that appears to be the better one in the "thread".

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