views:

133

answers:

1

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...

+2  A: 

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. :)

Rob Mensching
Thanks Rob. This solution seems to work:<SetProperty Id="REINSTALL" Value="ALL" After="FindRelatedProducts" >Installed AND REMOVE<>"ALL"</SetProperty> <SetProperty Id="REINSTALLMODE" Value="vamus" After="FindRelatedProducts">Installed AND REMOVE<>"ALL"</SetProperty>
Stiefel
Be sure to test upgrade and patching before releasing to make sure everything is good. You won't be able to fix it later. :)
Rob Mensching