BCh
Posts: 63
Joined: Wed Jan 17, 2007 6:32 am
Location: Australia

Scripting during prerequisite install

Hi,

I need to check, prior to any install procedure, if the PC needs to be rebooted (looking at a couple of register settings).


This can be done as a first step of the prerequisite process if possible but I cannot see how.



Is there any way I can run a script prior / as part of prerequisite install or check a register setting and based on setting reboot PC and continue install.



Thanks,
Brian
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Scripting during prerequisite install

Hi Brian,

You can try something like this:

- create a new AIP that builds and empty MSI. Uncheck the option to "Register with Windows Installer" from Product Details page
- in this MSI add a custom action (your script/DLL) that checks for the pending restart
- add an Error Message predefined custom action that informs the user a restart is pending, if it is the case - use a property set by
your script/DLL to condition the execution of this custom action
- set this MSI as the first prerequisite, inside your main package. This way, your check will run first.
- disable the option "Continue with the main installation even if this prerequisite is not installed". So if your error message appears,
thus the MSI does install, the rest of the package does not install either.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”