ashraf798
Posts: 11
Joined: Mon Apr 23, 2012 10:58 am

Reboot after uninstall and during upgrade

Dear Team,

I have a requirement that has to be done. The requirement is as follows:
1) The installer should reboot after every UNINSTALL ONLY
2) During upgrade, it should uninstall the previous version, REBOOT, and then continue installing the new version after reboot

We need to have this feature because we have drivers that are unstopabble and they require a reboot to uninstall otherwise they are marked for deletion and when the new drivers are installed during upgrade they are deleted as they were marked previously.
Shania
Posts: 17
Joined: Thu Apr 25, 2013 12:10 pm

Re: Reboot after uninstall and during upgrade

1) During the installation process set installer propertu value REBOOT=ReallySuppress. For example, a button "Install" (Published Events). AND Set reboot Behavior = Force Reboot after install. Result: Window reboot after every UNINSTALL ONLY.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Reboot after uninstall and during upgrade

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
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ashraf798
Posts: 11
Joined: Mon Apr 23, 2012 10:58 am

Re: Reboot after uninstall and during upgrade

Dear Dan,
I have tried and implemented the suggestions provided by you and both the solutions for problem 1) and 2) has not worked. I am attaching the project file for your reference.
Attachments
setup.aip
This is my project file which has changes suggested by you.
(44.53 KiB) Downloaded 961 times
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Reboot after uninstall and during upgrade

Hello,

First of all I apologize for my mistake. There is no need for the [ ] in the property field.

1)Can you please try to edit the “Set installer property” custom action fields like that:
Property field: REBOOT
Argument field: Force
Condition field: (Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ))

2)Please note that in your InstallExecuteSequence table from the project the sequence number 1501 is duplicated. The sequence number 1501 already existed in your project and it was assigned to AI_AiBackupRollback action.
Can you please try to edit the Sequence number to 1503 of the ForceReboot action and see if the behavior persist?

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ashraf798
Posts: 11
Joined: Mon Apr 23, 2012 10:58 am

Re: Reboot after uninstall and during upgrade

Thanks Dan, it worked!! I mean the behaviour is working, during upgrade it uninstalls the previous product and asks for restart. Once restarted, the installer starts and says "Unable to find the package". My setup type is .exe and mixed mode. Other than that, the rest of the things are working.
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Reboot after uninstall and during upgrade

Hello,

I'm not sure why you encountered this behavior.

Indeed, you are using “Mixed 32/64-bit matching the platform” option for the “Package Type” although you don't have any component marked as a 64 bit component and neither you have any feature marked as 64 bit. Can you please try to use the “32-bit package” option for the “Package Type” and see if the behavior persist?

Let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
eshiva
Posts: 23
Joined: Tue Jul 09, 2013 12:35 pm

Re: Reboot after uninstall and during upgrade

Hi,
I used this behavior for my upgrade. It works great. And also i want add this to "Repair" also. So that we i do repair it will uninstall, reboot the PC and install the same version after reboot.
How can i achieve this?

Regards,
Shiva
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Reboot after uninstall and during upgrade

Hello Shiva,

Please note that this behavior cannot be implemented from your main package.

You can try to create another package(.EXE which will have the “run as admin” option enabled and also you can enable the “Limit to user interface(simple progress and error handling)” option) which implement this behavior.
In this .EXE you will have three custom actions in the “Install UI sequence” from the dialogs page:
1) First custom action that will uninstall the application.
2) Second custom action will reboot the PC
3) Third custom action will launch the installation of the application.

Please note that this will not work with the “Repair” option from Control Panel list. So you should enable the “Disable Repair” option from “Product Details” tab from your main application.
You should add this .EXE in the “Files and Folders” page and it will be deployed at install time. You can have a shortcut to this .EXE.
Please note that you also have to deploy your .MSI because the custom action that execute the install from the .EXE needs it. So that means you will have a double size for your package.

Another approach is the one where you create your own .EXE which implement this scenario.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zli
Posts: 4
Joined: Mon Mar 02, 2015 11:14 pm

Re: Reboot after uninstall and during upgrade

Dan wrote: 2)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.
How can I do this with the Professional version?

Return to “Building Installers”