eshiva
Posts: 23
Joined: Tue Jul 09, 2013 12:35 pm

Problem when uninstalling from Control Panel

Hi,
Can you tell me how can i add a restart dialog for uninstall my MSI from the control panel. For uninstall using startmenu shortcut i have added a /forcereboot in the commanline arguments of uninstall shortcut. And from the MSI uninstall i have manually added a checkbox and set property to "REBOOTPC". These two cases are working fine.

The problem is when i uninstall my MSI from control panel how can i invoke "reboot PC" dialog.

Regards,
Shiva
Teodor
Posts: 73
Joined: Thu Jul 25, 2013 9:56 am

Re: Problem when uninstalling from Control Panel

Hi

The reboot prompts showed sometimes by Windows Installer are controlled by the REBOOT property. The REBOOT property's possible values are explained in the Restart the machine after the installation page.
eshiva wrote:Can you tell me how can i add a restart dialog for uninstall my MSI from the control panel.
You can easily achieve this behavior by adding a Custom Action that will set the REBOOT property after Uninstall. For this go to Custom Actions page and from Add Custom Action tab click on Set installer property with sequence button. Define this property with the following values:
- Property: REBOOT
- Value: Force or F
- Execution Stage Condition: Uninstall [x], Condition: "Application is being uninstalled"

Last step is to move the SetProperty custom action under Install Execution Stage just before Finish Execution standard action.

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

Re: Problem when uninstalling from Control Panel

Thanks for replay.
I can add a custom action but it has to be executed only when i uninstall from control panel. As from UI on exit dialog i am rebootin the PC based on checkbox. So if the user is not selected the checkbox (Reboot) this custom action will not execute. How can i achieve this?

I tried by adding my checkbox property name to the custom action conditions though it is not working as expected.

Regards,
Shiva
Teodor
Posts: 73
Joined: Thu Jul 25, 2013 9:56 am

Re: Problem when uninstalling from Control Panel

Hi
eshiva wrote:I can add a custom action but it has to be executed only when i uninstall from control panel.
The Uninstall operation should perform the same actions no matter how it was invoked. Being executed from command line or from Control Panel should make no difference.
eshiva wrote:As from UI on exit dialog i am rebooting the PC based on checkbox. So if the user is not selected the checkbox (Reboot) this custom action will not execute. How can i achieve this?
You just need to add a condition to the Custom Action previously created for reboot after Uninstall:

Code: Select all

UILevel = "2" OR UILevel = "3" OR UILevel = "4" OR (UILevel = "5" AND MY_PROP)
The UILevel property gives the user interface type. You need to replace MY_PROP with your checkbox property name.

Let us know if you have other questions.

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

Re: Problem when uninstalling from Control Panel

Thanks Teodor,

It works great. I used UILevel = "3" OR UILevel = "4" for my custom action (Reboot). From the UI i already set checkbox property to REBOOT.

Thanks,
Shiva

Return to “Common Problems”