views:

758

answers:

1

I have a Windows Installer MSI package that installs drivers which sometimes require a restart before they can be upgraded; the drivers are installed by a deferred custom action after WriteRegistryValues. When a reboot IS needed there's a rollback and the user is told to reboot and run the install again.

In the InstallExecuteSequence the RemoveExistingProducts action is between InstallValidate and InstallInitialize, so when an upgrade signals that it needs a restart, the previous package has been removed. So when a reboot's needed, after the rollback and the error message saying "reboot and re-run this" our software is no longer installed. If the user reboots and repeats the install things work fine.

I need to automate rebooting and resuming the install, so the user doesn't have to actually do anything (apart from agreeing to the restart of course.)

A command written into the registry's RunOnce key can run the install again after the reboot, but I'm thinking it will be tricky to condition ForceReboot on what happens in the deferred custom action that does the driver install. Also maybe tricky to decide what to do in the resumed install.

Advice on best practices or pointers to potential problems will be very welcome.

+1  A: 

RemoveExistingProducts before InstallInitialize or after InstallFinalize will not put the Action in the audit script of the new product, so as you said the old product is removed before the Upgrade is done.

So you might want to try to put the RemoveExisitngProducts execution between InstallInitialize and InstallFinalize, that way it's in the remove is in the audit scripted part, so it will track, the reboot and resume.

have a look at the system reboot properties here

CheGueVerra

related questions