Heise Offline-Update

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

Silent installer for WSUS Offline Update. This software installs the latest Security Updates and Service Packs for Windows and Office

Download the [1] scripts. Run the downloader and select the products you want updates for. One note: if you're using the Compatibility Pack for the 2007 Office System then download the updates for Office 2007. Those patch the Compatibility Pack as well as Office 2007.

Once all of the downloads are complete copy the contents of the "client" folder to your server. These scripts assume the %PACKAGES% environment variables have been set in the client service or some other launch script.

Note: I increment the revision each Patch Tuesday.

offlineupdate.xml:

<?xml version="1.0" encoding="UTF-8"?>
<packages>
<package id="wsusoffline" name="Windows Offline Updates" revision="3" priority="90">
  <check type="file" condition="exists" path="%SYSTEMDRIVE%\netinst\wpkg\ctupdate.done" />

  <install cmd='%COMSPEC% /C %PACKAGES%\wsusoffline\offlineupdate.cmd'>
    <exit code='0' /><exit code='3010' reboot='true' />
  </install>

  <upgrade include="install" />

  <remove cmd='%COMSPEC% /C del /f "%SYSTEMDRIVE%\netinst\wpkg\ctupdate.done"' />

</package>
</packages>

offlineupdate.cmd:

@echo off
 
:: Make sure that the log directly exists and is hidden
mkdir  %SystemDrive%\netinst\wpkg
attrib +H %SystemDrive%\netinst
del %SystemDrive%\netinst\wpkg\ctupdate.done
 
:: Update the system and log it
:: details for parameters http://forums.wsusoffline.net/viewtopic.php?f=7&t=2691
pushd %PACKAGES%\wsusoffline\client
cmd /c cmd\DoUpdate.cmd /instie11 /updatercerts /verify /updatecpp /updatedx /instdotnet4 /updatetsc /instofc /instofv >%SystemDrive%\netinst\wpkg\offlineupdate.log

if %errorlevel% equ 0 (
    date /T >%SystemDrive%\netinst\wpkg\ctupdate.done
    exit /b 0
)

:: return reboot required exit code
exit /b 3010

Older solution without an exe file:

CTUpdate is an alternative method for applying Windows and Office hotfixes and service packs. It consists of two parts:

  1. A program to automatically queries and downloads the latest packages into a repository.
  2. A program that reads the repository and applies any updates to the local machine.

Download it here: http://www.heise.de/ct/projekte/offlineupdate/download_uk.shtml

Note 1: CTUpdate cannot be run from a non-mapped drive, so make sure you map your repository first. The bat-file below expects %WPKG_DRIVE% to be set to this drive. Alternatively, you can modify the bat-file to temporarily map the drive. (net use x: \\ntinstall\wpkg /PERSISTENT:no)

Then run it in order to create a repository containing the languages and systems you want, but you do NOT need to create ISO files. The repository will be placed in the client subfolder. Then copy the entire tree over to the WPKG software folder and use the following entries:

<package id="ctupdate" name="Windows and Office hotfixes and service packs" revision="0" reboot="true" priority="0">
  <!--
  The bat-file touches a statefile after each successful run.
  
  Increment revision each time the CTUpdate repository is updated, and it will be run
  again by wpkg and figure out what needs to updated itself.
  
  Prioritize below Office, as Office is updated by this as well.
  
  The uninstall simply removes the statefile - we don't provide for uninstalls of
  patches, however one might want to reinstall the package in order to rerun it.

  See ctupdate4\client\cmd\doupdate.cmd for other possible flags (IE7 install etc.)
  -->
   <check type="file" condition="exists" path="%windir%\ctupdate.done" /> 
   <install cmd='cmd /c "%SOFTWARE%\ctupdate4\runwpkg.bat" /nobackup' />

   <upgrade cmd='cmd /c "%SOFTWARE%\ctupdate4\runwpkg.bat" /nobackup' />
   <remove cmd='cmd /c del %windir%\ctupdate.done'/>

</package>

The referenced bat-file:

%WPKG_DRIVE%
cd %SOFTWARE%\ctupdate4\client\cmd
del %windir%\ctupdate.done
cmd /c doupdate.cmd %*

For proper reboot cycles you will need to add a line to ctupdate4/client/cmd/DoUpdate.cmd. See diff: (make sure you don't add it to the SuggestRecall part)

--- C:/Users/Kalmi/Desktop/DoUpdate.cmd	Sat Sep 13 19:41:10 2008
+++ G:/wpkg/software/ctupdate4/client/cmd/DoUpdate.cmd	Sat Jan 31 21:57:03 2009
@@ -736,6 +736,7 @@
 echo Installation successful. Please reboot your system now.
 echo %DATE% %TIME% - Info: Installation successful >>%UPDATE_LOGFILE%
 echo.
+date /T > %windir%\ctupdate.done
 goto EoF
 
 :Cleanup

This will ensure that wpkg will only consider the install successful when ctupdate ends up in InstSuccess (and not in SuggestRecall). So if a restart is needed wpkg will restart(saying the the install failed, but it requires a resart, so I'm going to restart now) and try the install again...