Hi,
I have written an opsi script to apply Windows updates that are downloaded and installed using wsusoffline update. There is only 1 script - setup.ins - that reads install options from product properties, then launches the wsusoffline DoUpdate.cmd script.
The exit codes can be read and checked. 1641 and 3010 request a reboot, for which I issue 'ExitWindows /Reboot', and 3011 means it wants a reboot and to run again. For this I tried 'ExitWindows /ImmediateReboot' with the theory that the script status will not update and therefore cause it to run again. But, in practice, this is no good.
Windows 7 waits until the PC is shutting down to finish the install of the patches. With the ImmediateReboot it kills Windows and does not allow this to complete. As a result, the patches are not applied, and the temporary install folders are left orphaned on the C: drive.
So, I have 2 questions.
1. How can opsi handle the shutdown to play nice with Windows 7 updates?
2. How can I make the setup script run again (by itself) to finish the job?
Regards,
Stephen Jones
How to make a script re-run?
Re: How to make a script re-run?
ExitWindows /ImmediateReboot is the right way, but you must take care of finding the entry point by yourself. Check the manual, it shows an example:lloydsystems hat geschrieben: 1. How can opsi handle the shutdown to play nice with Windows 7 updates?
http://download.uib.de/opsi_stable/doc/ ... nds-reboot
We use offline updates + wsus in one package ... see the snippet below.2. How can I make the setup script run again (by itself) to finish the job?
Code: Alles auswählen
(...)
set $WinstRegKey$ = "HKLM\SOFTWARE\opsi.org\winst"
set $Flag$ = GetRegistryStringValue32 ("[" + $WinstRegKey$ + "] " + "WUStatus")
if ($Flag$ = "")
set $Flag$ = "0"
endif
set $FlagValue$ = "3000"
if ($Flag$ INT<= $FlagValue$)
sub_DoUpdate
if ($ExitCode$ = "3010")
set $Flag$ = "3010"
Registry_SaveWUStatus
Sub_Reboot
else
(...)
HTH, Lorenzo