Difference between revisions of "Heise Offline-Update"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
((dumb) Merging ctupdate and Heise Offline-Update)
(Heise website changed domain name, possibly ownership?)
Line 1: Line 1:
 
Silent installer for Heise Offline-Update.
 
Silent installer for Heise Offline-Update.
  
Download the [http://www.heise.de/ct/projekte/offlineupdate/download_uk.shtml Offline-Update] scripts.  Run the downloader and select the products you want updates for.  One note: if you're using the [http://wpkg.org/MS_Office_2007_Compatibility_Pack Compatibility Pack for the 2007 Office System] then download the updates for Office 2007.  Those patch the Compatibility Pack as well as Office 2007.
+
Download the [http://www.h-online.com/security/Offline-Update--/features/112953] scripts.  Run the downloader and select the products you want updates for.  One note: if you're using the [http://wpkg.org/MS_Office_2007_Compatibility_Pack 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 share name is "offlineupdate" and the server name is "ntinstall".  You also need "rm.exe" and "mkdir.exe" from [http://gnuwin32.sourceforge.net/packages/coreutils.htm GnuWin32] in your "tools" folder.
 
Once all of the downloads are complete copy the contents of the "client" folder to your server.  These scripts assume the share name is "offlineupdate" and the server name is "ntinstall".  You also need "rm.exe" and "mkdir.exe" from [http://gnuwin32.sourceforge.net/packages/coreutils.htm GnuWin32] in your "tools" folder.

Revision as of 00:26, 2 September 2009

Silent installer for Heise Offline-Update.

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 share name is "offlineupdate" and the server name is "ntinstall". You also need "rm.exe" and "mkdir.exe" from GnuWin32 in your "tools" folder.

Note: I increment the revision each Patch Tuesday. If you want this to run every time wpkg is run add 'execute="always"' to the package tag and disable the reboot.

offlineupdate.xml:

<?xml version="1.0" encoding="UTF-8"?>
<packages>
<package
	id="offlineupdate"
	name="offlineupdate"
	revision="200805131"
	reboot="true"
	priority="0">

	<check type="file" condition="exists" path="%SystemDrive%\netinst\wpkg\ctupdate.done" />

	<install cmd='cmd /c %WPKGROOT%\scripts\offlineupdate.cmd' />
        <install cmd='"%SOFTWARE%\ctcheck.exe"' />
	<upgrade cmd='cmd /c %WPKGROOT%\scripts\offlineupdate.cmd' />
        <upgrade cmd='"%SOFTWARE%\ctcheck.exe"' /> 
	<remove cmd='cmd /c %WPKGROOT%\tools\rm.exe -f "%SystemDrive%\netinst\wpkg\ctupdate.done"' />

</package>
</packages>

offlineupdate.cmd:

@echo off

:: Make sure that the log directly exists and is hidden
%WPKGROOT%\tools\mkdir.exe -p %SystemDrive%\netinst\wpkg
attrib +H %SystemDrive%\netinst

:: Update the system and log it
pushd \\ntinstall\offlineupdate
cmd /c cmd\DoUpdate.cmd >%SystemDrive%\netinst\wpkg\offlineupdate.log
popd \\ntinstall\offlineupdate
date /T >%SystemDrive%\netinst\wpkg\ctupdate.done

Delphi source code for ctcheck.exe (ctcheck.dpr):

program ctcheck;
{$APPTYPE CONSOLE}
{
  This program loads the ctupdate log file, then checks for the word "recall" in the last non-empty line.
  If the word "recall" is found it then deletes the "ctupdate.done" file, so that wpkg will run ctupdate again.
}
uses Windows,classes,sysutils;

function GetDrv(): string;
const
 s = 'SYSTEMDRIVE';
var
  BufSize: Integer; 
begin
  BufSize := GetEnvironmentVariable(PChar(s), nil, 0);
  if BufSize > 0 then
  begin
    SetLength(Result, BufSize - 1);
    GetEnvironmentVariable(PChar(s),
      PChar(Result), BufSize);
  end
  else
    Result := '';
end;

var
s:String;
fpath:String;
sl:TStringList;
begin
   sl := TStringList.Create;
   try
      fpath := getDrv() + '\netinst\wpkg\';
      sl.LoadFromFile(fpath + 'offlineupdate.log');
      while(sl.Count > 0) and(trim(sl[sl.Count -1]) = '')do
       sl.Delete(sl.Count -1);
      if(sl.Count > 0) then
      begin
       s := sl[sl.Count -1];
       if(AnsiPos('recall', LowerCase(s)) > 0)
       then
       begin
          if not(DeleteFile( fpath + 'ctupdate.done')) then Halt(1);
       end;
      end
      else Halt(1);
   except
   end;
   sl.Free;
end.


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...