WiX Installer: How to switch to repair-mode if already installed?
Asked Answered
U

1

5

I am new to WiX 3.0 and writing my first installer based on WiX (coming from Wise).

If the product is already installed (in the current version), I want the installer to switch to "repair"-mode automatically. It should behave exactly like as if I would have clicked "repair" in the Windows software dialog.

It must behave like this to fit in the overall installation process of the system.

I read the documentation but can't get hold of the problem...

Undergrowth answered 26/7, 2010 at 12:4 Comment(2)
As far as I understand you need to change the sequence of the UI dialogs. I don't know how can this be done conditionally, so let's wait for answers.Zeeba
Note: the installer is without UI.Undergrowth
D
7

You can use the Installed property to conditionalize a SetProperty element for REINSTALL and REINSTALLMODE properties. Be careful to test upgrades to ensure that you add the other parts of the condition (REMOVE<>"ALL") so that the upgrade of the old product stays an uninstall and doesn't flip to repair. :)

Dolan answered 26/7, 2010 at 15:42 Comment(2)
Thanks Rob. This solution seems to work: <SetProperty Id="REINSTALL" Value="ALL" After="FindRelatedProducts" >Installed AND REMOVE&lt;&gt;"ALL"</SetProperty> <SetProperty Id="REINSTALLMODE" Value="vamus" After="FindRelatedProducts">Installed AND REMOVE&lt;&gt;"ALL"</SetProperty>Undergrowth
Be sure to test upgrade and patching before releasing to make sure everything is good. You won't be able to fix it later. :)Dolan

© 2022 - 2024 — McMap. All rights reserved.