Wir haben das eine Zeit lang für die Verteilung von MS Patchen genutzt, die via WSUS Offline Downloader heruntergeladen wurden. Die lagen auf einem Netzwerkshare, der wurde einfach gemountet und das Update angeworfen.
Konfigurierbar war das via product properties.
Hier mal meine beiden zuständigen Files, vielleicht hilft es dir ja:
opsi control file
Code: Alles auswählen
[Package]
version: 10
depends:
incremental: False
[Product]
type: localboot
id: mspatches
name: Microsoft Patche (WSUSOffline basiert)
description: Installiert Microsoft Patche (WSUS Offline Download basierend)
advice:
version: 1.0
priority: -62
licenseRequired: False
productClasses:
setupScript: setup.ins
uninstallScript:
updateScript:
alwaysScript:
onceScript:
customScript:
userLoginScript:
[ProductProperty]
type: unicode
name: options
multivalue: True
editable: False
description: Install options
values: ["/instdotnet4", "/instie10", "/instie8", "/instie9", "/instmsse", "/instmssl", "/instpsh", "/instwd", "/nobackup", "/updatecpp", "/updatedx", "/updatercerts", "/updatetsc", "/updatewmp"]
[ProductProperty]
type: unicode
name: laufwerk
multivalue: True
editable: False
description: Temporärer Laufwerksbuchstabe für Patchinstallation
values: ["K:", "O:", "P:", "X:", "Y:", "Z:"]
default: ["K:"]
[ProductProperty]
type: unicode
name: share
multivalue: False
editable: True
description: Netzwerkshare, auf dem die Patche liegen
values: ["[\"\\\\server\\share\"]"]
default: ["[\"\\\\server\\share\"]"]
[ProductProperty]
type: unicode
name: pfad
multivalue: True
editable: True
description: Pfad (ohne Laufwerksbuchstaben), in dem das Client Unterverzeichnis des WSUSOffline Downloaders liegt
values: ["[\"Patche\\Win2008Srv\"]", "[\"Patche\\WinXP\"]"]
[ProductProperty]
type: unicode
name: benutzer
multivalue: False
editable: True
description: Netzwerkbenutzer, mit der Share zugeordnet wird
values: ["benutzer"]
default: ["benutzer"]
[ProductProperty]
type: unicode
name: passwort
multivalue: False
editable: True
description: Passwort
values: ["p@ssw0rt"]
default: ["p@ssw0rt"]
[Changelog]
mspatches (1.0-9) testing; urgency=low
* Initial version
-- Holger Pandel <holger.pandel@volksbank-niederrhein.de> Thu, 28 Feb 2013 16:39:36 + 0100
setup.ins
Code: Alles auswählen
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
[Actions]
requiredWinstVersion >= "4.10.8.6"
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $ExitCode$
;
; get product properties for options and install
;
; multi-value values are return as string, seperated by ",", eg. "value1,value2,value3",
; therefore we replace "," by " " (split, compose)
;
DefVar $Options$
DefVar $updLfw$
DefVar $updShare$
DefVar $updUser$
DefVar $updPass$
DefVar $updPath$
Set $Options$ = composeString( splitString ( GetProductProperty("options",""), "," ), " " )
Set $updLfw$ = GetProductProperty("LAUFWERK","X:")
Set $updShare$ = GetProductProperty("SHARE","\\Server\Share")
Set $updUser$ = GetProductProperty("BENUTZER","benutzer")
SetLogLevel=0
Set $updPass$ = GetProductProperty("PASSWORT","p@ssw0rt")
SetLogLevel=5
Set $updPath$ = GetProductProperty("PFAD","wsusoffline")
comment "options: " + $Options$
Set $LogDir$ = "%SystemDrive%\tmp"
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator
Set $ProductId$ = "mspatches"
Set $MinimumSpace$ = "1000 MB"
; ----------------------------------------------------------------
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError
; Stop process and set installation status to failed
else
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" "Microsoft Patche"
comment "installing"
Message "Installing " + $ProductId$ + " ..."
comment "Start setup program"
SetLogLevel=0
Winbatch_link_share
SetLogLevel=5
ExecWith_install "cmd.exe" /C
Sub_check_exitcode
Winbatch_unlink_share
endif
[Winbatch_link_share]
net use $updLfw$ $updShare$ /user:$updUser$ $updPass$ /persistent:no
[Winbatch_unlink_share]
net use $updLfw$ /d
[ExecWith_install]
;"%ScriptPath%\exit-wrapper.cmd" "$updLfw$\$updPath$\client\cmd\DoUpdate.cmd" $Options$
"%ScriptPath%\exit-wrapper.cmd" "$updLfw$\$updPath$\client\cmd\DoUpdate.cmd" $Options$
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
comment "Looks good: setup program gives exitcode zero"
else
comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
if ($ExitCode$ = "1605")
comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
comment "Uninstall of a not installed product failed - no problem"
else
if ($ExitCode$ = "1641")
comment "looks good: setup program gives exitcode 1641"
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
ExitWindows /Reboot
else
if ($ExitCode$ = "3010")
comment "looks good: setup program gives exitcode 3010"
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
ExitWindows /Reboot
else
if ($ExitCode$ = "3011")
comment "looks good: setup program gives exitcode 3011"
comment "ERROR_SUCCESS: wsusoffline requires reboot and rerun."
ExitWindows /ImmediateReboot
else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
isFatalError
endif
endif
endif
endif
endif