conditional reboot - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

conditional reboot

Hi,

I want my installer to reboot after installation completed if we are on a prior to win7 PC, and not to reboot on win7 or higher.

Is there an 'easy' way to do that?

Thanks,
Alex.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: conditional reboot

Hello Alex,

Here is the how to from our user guide that can help you achieve the reboot functionality.

You should also modify the condition field of the SetProperty published event so that the event will trigger depending on the operating system. Here is another how to that can help you understand and implement this condition as well.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

Re: conditional reboot

Thanks Mihai,

Exactly what I was looking for.

Alex.
doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

Re: conditional reboot

The install is fine now.
However, I still get reboot prompt on uninstall regardless what OS I am on. In 'Install Parameters' I have the 'Reboot behavior' set to 'Force Reboot after install', and I overwrite it in the handler for the 'Finish' button in the 'First Time Install' dlg, OS dependent. How do I overwrite it to behave differently during uninstall (/repair) action (the 'First Time Install' dialog is not suitable for this, as it has the 'AI_INSTALL' flag hardly bound to it, and there is no uninstall related dialog)?

Thanks,
Alex.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: conditional reboot

Hello Alex,

This is a normal behavior because the ExitDialog is the same for the first install, uninstall and remove.
Here are a couple of conditions you can add to your events so that they will be triggered when you need them( some of them are also mentioned in the Edit Condition dialog under the Predefined Conditions section ): Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

Re: conditional reboot

Hello Mihai,

but, if I understood it correctly, all published events for the 'Finish' button on ExitDialog have the 'AI_INSTALL' condition preset, if I add another condition, it will be 'AND'ed with the 'AI_INSTALL'. So, whatever condition I add, it may or may not trigger _on_install_only_ because I cannot remove/overwrite that preset 'AI_INSTALL'.

Does the above mean that the reboot behaviour on uninstall/remove cannot be overwritten?

Thanks,
Alex.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: conditional reboot

Hi Alex,

You are correct about the AI_INSTALL, but this is the default condition only in the First Time Install category ExitDialog published events. You don't want to add the remove event in the ExitDialog from the First Time Install category.
Does the above mean that the reboot behaviour on uninstall/remove cannot be overwritten?
Yes, it can. The right approach is to add the condition for the remove operation in the Maintenance dialogs category ExitDialog.
In the Maintenance category ExitDialog you have 3 possible operations:
  • Modify
  • Repair
  • Remove
Please note that the categories are a GUI feature in Advanced Installer, in fact Windows Installer uses the same ExitDialog throughout the setup.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

Re: conditional reboot

Hello Mihai,

I tried to add that condition into maintenance dlg, but no effect - still reboot is requested after uninstall completes.

Thanks,
Alex.
doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

Re: conditional reboot

Hello Mihai,

in the Help I found this topic: 'How do I uninstall another MSI package when my application is uninstalled?' - there is a vbs sample, overwriting UNINSTALL_PREREQ property.

Could AI_INSTALL property be overwritten the same way in order to suppress a reboot?

Thanks,
Alex.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: conditional reboot

Hello,

Please send us the .AIP (project) to support at advancedinstaller dot com so we can investigate it.
Also, please be more specific about what what you are trying to achieve. What is your desired dependency logic between the REBOOT property set on the ExitDialog, the OS and the maintenance install mode?

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

Re: conditional reboot

Hi Mihai,

I sent the file (called File001.zip) to the support email.
What I want to achieve is the following:
1. if I install my product on Win7 or upward machine, I don't want a reboot after installation, otherwise a reboot must happen.
2. if I uninstall my product from Win7 or upward machine, I don't want a reboot after uninstall, otherwise a reboot must happen.

I achieved the point 1 above, following your previous instructions, but cannot get the point 2.

Thanks,
Alex.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: conditional reboot

Hello Alex,

The AIP you sent seems to have the correct settings. All except the two "ReallySuppress"(with two 'p') SetProperty events which I guess you added for testing purposes.
I have implemented the functionality in my own project and everything seems in order. I attached it to the post so you can test it as well.
Can you please send us the verbose log of the uninstallation for us to investigate?

My guess is the WFP public property has something to do with the behavior but I cannot be sure until I see the log file. Please investigate this yourself considering the possibility and also try the package on a different Windows 7 machine.
You can also try to remove the WFP property from the condition and see the behavior. Let us know what you find.

Regards,
Mihai
Attachments
test.aip
(8.66 KiB) Downloaded 348 times
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”