Mein Arbeitgeber hat vor ein paar Wochen OPSI in Betrieb genommen und wir testen gerade schön vor uns hin... Ich bin als Paketentwickler dabei und habe eine Frage dazu... Ist es möglich, mit OPSI die laufenden Prozesse zu durchsuchen? Mit <killtask "prozess.exe"> kann ich zwar ein Programm abschießen, aber wie ermittle ich vorher, ob es überhaupt noch läuft?
Hintergrund meiner Frage ist folgender: Wir nutzen das ABO "PatchManagement" und als Zusatz zum Firefox-Paket habe ich ein Paket "ffconfig" geschrieben, dass zwei Dateien im Installationsverzeichnis von Firefox ablegt:
* {Installationsordner}\defaults\pref\local-settings.js
* {Installationsordner}\mozilla.cfg
Solange ich dieses Paket standardmäßig vor dem Login installiere, brauche ich mir keine Sorgen zu machen, dass Firefox laufen könnte - aber "on demand" schon. Wie kann ich mich hier also galant durch das Problem durchwurschteln?
Schöne Grüße,
SKr
PS.: Hier mein Quelltext
Code: Alles auswählen
[Initial]
SetLogLevel=notice
ExitOnError=false
ScriptErrorMessages=false
FatalOnSyntaxError=true
FatalOnRuntimeError=false
TraceMode=off
requiredWinstVersion >= "4.11.4.6"
StayOnTop=false
AutoActivityDisplay=true
[Actions]
DefVar $LogDir$
DefVar $ProductID$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $InstallationSwitch$
Set $InstallationSwitch$ = GetProductProperty("strongsecurity", "true")
Set $LogDir$ = "%opsiLogDir%"
; ----------------------------------------------------------------
; - 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$ = "ffconfig"
Set $MinimumSpace$ = "1 MB"
Set $InstallDir$ = "%ProgramFiles32Dir%\Mozilla Firefox"
; the path were we find the product after the installation
; ----------------------------------------------------------------
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough free disk space on %SystemDrive%. " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductID$ +"."
isFatalError "Disk full" ; Stop process and set installation status to failed
else
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductID$ + ".png" "Firefox Config Stadt Solingen"
Message "Installing " + $ProductID$ + " ..."
Pause "Bitte beenden Sie Firefox jetzt, falls er laufen sollte, und klicken anschließend auf 'OK'."
WinBatch_Dummy /WaitForProcessEnding "firefox.exe" /TimeOutSeconds 30
KillTask "firefox.exe"
comment "Copy configuration files"
Files_CopyLocalSettings
if ($InstallationSwitch$ = "true")
Files_CopyLockPref
else
Files_CopyDefaultPref
endif
comment "Check successful installation"
if not(FileExists($InstallDir$ + "\mozilla.cfg"))
isFatalError "Installation not successful: mozilla.cfg missing!"
else
if not (FileExists($InstallDir$ + "\defaults\pref\local-settings.js"))
isFatalError "Installation not successful: local-settings.js missing!"
endif
endif
endif
[WinBatch_Dummy]
; nothing to do here, just waiting for "firefox.exe" to end
[Files_CopyLocalSettings]
copy %ScriptPath%\local-settings.js $InstallDir$\defaults\pref
[Files_CopyLockPref]
copy %ScriptPath%\lockPref\mozilla.cfg $InstallDir$
[Files_CopyDefaultPref]
copy %ScriptPath%\defaultPref\mozilla.cfg $InstallDir$