Hello,
1) The installer should reboot after every UNINSTALL ONLY
In order to reboot after uninstall you can go in the “Install Parameters” page and select for the “Reboot Behavior” the “Prompt for Reboot when required” option. Also you can enable “Perform the reboot if required without showing any prompts” if you want to reboot automatically without prompting the user.
In the “Custom Actions” page you add a
Set installer property predefined custom action
with sequence. You should add it before “Install Execution Stage” >> “Finish Execution” stage. You can also disable the “Install” option from the “Execution Stage Condition” label.
You can edit its event options like that:
Property: field:
REBOOT
Argument: field:
Force
Condition: field:
AI_MAINT AND ( (Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" )) )
2) During upgrade, it should uninstall the previous version, REBOOT, and then continue installing the new version after reboot
Unfortunately we don't have predefined support for this. As a workaround I suggest you to add manually in the “Table Editor” page in the “InstallExecuteSequence” table a new row:
ForceReboot. The ForceReboot action must come between
InstallInitialize and
InstallFinalize in the action sequence of the
InstallExecuteSequence table.
For the ForceReboot action you can have something like that:
Action field:
ForceReboot
Condition field:
( NOT Installed AND OLDPRODUCTS ) AND ( NOT AFTERREBOOT = "1")
Sequence field:
1501
Please note that the “Table editor” feature is available only in an “Enterprise” or higher project type.
Also you can take a look on
ForceReboot Action article which may be helpful to you.
Let us know if that helped otherwise give us more details about your specific scenario!
Best regards,
Dan