[wpkg-users] Conditional reboot

Rainer Meier r.meier at wpkg.org
Thu Sep 4 14:20:10 CEST 2008


Hi Johannes,

Johannes.Brix at evidian.com wrote:
> Is it possible to make the reboot attribute conditional for a package ?
> E.g. on some PCs I do not need to reboot and on others I want to reboot on
> each package which is installed.

If a package needs immediate reboot, please specify reboot=true, if a 
reboot can be scheduled to the end of the synchronization process 
specify reboot=postpone (requires WPKG 1.1.x pre-release).

You can use the exit value of an installer (or install-script) to 
evaluate if a reboot should be executed. For example you can run a cmd 
script instead of the installer directly. This script can evaluate as 
many checks as required to determine if a reboot should be executed. If 
it requires a reboot it can exit with exit code 99 (or something else). 
Then the package definition just defines that exit code 99 requires 
immediate reboot. Using this method you can do any check (without having 
to implement every OS-specific/machine-specific/customer-specific check 
mechanism into WPKG.

So feel free to build your own mapping. Define an install command like
%SOFTWARE%\softwarexy\unattended.cmd

then define the exit codes
exit code 99: immediate reboot
exit code 98: postponed reboot
exit code 0: no reboot

The script can also launch any number of additional tools to determine 
which exit code it should return to WPKG.

This method is extremely flexible and allows to integrate into any 
environment using any number of checks.

In general I don't think it is required often since for most 
applications you know if it installs withiout a reboot. The ones 
requiring a reboot might either require an immediate reboot or a 
postponed reboot. Usually an additional reboot during installation is 
not really a problem and not worth the effort to do extensive checking 
if it is REALLY REALLY required or not. Just do it (postponed reboot 
might be a good idea in most cases).

Remember that such an extended check script also requires maintenance 
and in case of a new release it requires extensive testing with quite a 
large risk that you need to change your checks. So the effort might not 
be worth it. Personally I schedule a reboot if I know that an 
application "might" require a reboot on some machines. If it does not on 
some machines, then there is just one reboot too much - nobody really 
cares these days. In any case most applications can be 
installed/upgraded without reboot.

> Is it possible to use a variable here ?

No.

br,
Rainer



More information about the wpkg-users mailing list