heise Security IT security news and services at heise Security UK

Offline Update

Home-made Service Pack

Automated verions 13 December 2006 06:45

First of all - very cool - a big time saver as I have to constantly
keep many variations of vms up-to-date prior to rebuilding out test
enviornments (a tedious task for all of the base vms which we run our
stuff off of).

I was looking at the au3 script and wrote the following to leverage
off of your existing code. Basically I wanted it such that you call
the au3 file and it would go ahead and download with user input (i.e.
I will be calling this remotely on a vm in order to get the latest
downloads for language 'x'). After which I will run update.cmd to
apply updates.

Its a very simple implementation of the au3 script - just makes it so
that user input is not required for updating a vm at run time.

#include <GUIConstants.au3>
Dim $commandline
Dim $OS_ver = @OSVersion
Dim $options = " " & _OS() & " " & _Language()
$error = RunWait(@ComSpec & " /C DownloadUpdates.cmd" & $options,
@ScriptDir & "\cmd", @SW_SHOW)
If $error <> 0 Then
MsgBox(0x2010, "Error", "Error downloading updates for "&$options)
EndIf
Func _OS()
Select
    Case StringInStr("WIN_2000", @OSVersion)
Return "w2k"
    Case StringInStr("WIN_XP", @OSVersion)
Return "wxp"
    Case StringInStr("WIN_2003", @OSVersion)
Return "w2k3"
    Case Else
Return "Other (can determine with @OSVersion directly"
    EndSelect
EndFunc
Func _Language()
Select
    Case StringInStr("0413,0813", @OSLang)
Return "deu"
    Case StringInStr("0409,0809,0c09,1009,1409,1809,1c09,2009,_
    2409,2809,2c09,3009,3409", @OSLang)
Return "enu"
    Case Else
Return "Other (can determine with @OSLang directly"
    EndSelect
EndFunc

I'll inform my test team of this utility and we'll go about adding
additional language support as we come across them - currently we
have clients in Russia, Germany, China, and Japan so I hope we could
be of help in getting this going on more languages.