Hello,
- on the Custom Actions page, under InstallUISequence, make the FindRelatedProducts standard action visible
- place a Script Inline custom action immediately after FindRelatedProducts
- set the custom action's Script Text to:
Code: Select all
Session.Property("RESULT") = CStr( MsgBox("Do you want to remove the previous version?",vbYesNo,"Previous version of this product detected") )
and the condition to:
This will prompt the user whether to uninstall the old version. The result of the user's choice is stored in the RESULT property. It will have the value "6" if Yes is selected, "7" if "No is selected
- add an "Uninstall Previous Versions" custom action right after the first two. Set the condition to:
This will uninstall the previous versions. Make sure this custom action is set to synchronous.
- add another "Launch file or Open URL" custom action and set the Command Line field to:
and the condition to:
this will restart the computer.
You will have to make sure that your installer starts again, since it will not start by default after the computer is restarted. To achieve this, write the SOURCEDIR property to the
Run Key so your installer starts again after the restart. Delete the key when the install is finished.
Regards,
Gabriel