Changes

Heise Offline-Update

950 bytes added, 12:22, 25 October 2009
Cleaned up links and some information, and added ctcheck.js
Silent installer for Heise WSUS Offline-Update.This software installs the latest Security Updates and Service Packs for Windows and Office
Download the [http://wwwdownload.h-onlinewsusoffline.com/security/Offline-Update--/features/112953net] 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.
<install cmd='cmd /c %WPKGROOT%\scripts\offlineupdate.cmd' />
<install cmd='cscript "%SOFTWARE%\ctcheck.exejs"' />
<upgrade cmd='cmd /c %WPKGROOT%\scripts\offlineupdate.cmd' />
<upgrade cmd='cscript "%SOFTWARE%\ctcheck.exejs"' />
<remove cmd='cmd /c %WPKGROOT%\tools\rm.exe -f "%SystemDrive%\netinst\wpkg\ctupdate.done"' />
:: 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 %WPKGROOT%\wsusoffline\ntinstall\offlineupdateclientcmd /c cmd\DoUpdate.cmd /instie8 >%SystemDrive%\netinst\wpkg\offlineupdate.logpopd %WPKGROOT%\wsusoffline\ntinstall\offlineupdateclient
date /T >%SystemDrive%\netinst\wpkg\ctupdate.done
</source>
Delphi source code for ctcheck.exe (ctcheck.dpr):
cscript.js:
<source lang="javascript">
//delete ctupdate.done if a reboot is scheduled
 
var WshShell = WScript.CreateObject("WScript.Shell");
var fso = WScript.CreateObject("Scripting.FileSystemObject");
 
var ForReading = 1;
var BasePath = WshShell.ExpandEnvironmentStrings("%SystemDrive%\\netinst\\wpkg\\");
var LogFilePath = BasePath + 'offlineupdate.log';
var CtupdatePath = BasePath + 'ctupdate.done';
var LastLine = '';
 
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }
 
try {
var f = fso.OpenTextFile(LogFilePath, ForReading);
while (!f.AtEndOfStream) {
var r = f.ReadLine();
//ignore last lines that are blank
if (r.trim() != '') {
LastLine = r;
}
}
if (LastLine.search(/reboot/i) != -1) {
fso.DeleteFile(CtupdatePath,true);
}
}
catch (e)
{
WScript.Quit(1);
}
 
</source>
 
 
Delphi source code for ctcheck.exe (ctcheck.dpr)(from previous version):
<source lang="pascal">
program ctcheck;
{$APPTYPE CONSOLE}
{
This program loads the ctupdate log file, then checks for the word "recallreboot" 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.
}
begin
s := sl[sl.Count -1];
if(AnsiPos('recallreboot', LowerCase(s)) > 0)
then
begin
3
edits