[Gelöst] Ausführen von Scripten

Antworten
MeisterM
Beiträge: 3
Registriert: 27 Jun 2013, 09:36

[Gelöst] Ausführen von Scripten

Beitrag von MeisterM »

Hallo,

ich habe eine OPSI Installation laufen, die die Scripte auf den Client PCs ausführt. Nun habe ich festgestellt, dass sämtliche subs etc. gar nicht ausgeführt werden. Im nachfolgenden findet ihr die Fehlerlog.
[6] [Jun 27 08:56:42:929] Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion] opened
[6] [Jun 27 08:56:42:929] Key closed
[4] [Jun 27 08:56:42:989] Warning: depricated: <LogLevel=> please use <setLogLevel=>
[1] [Jun 27 08:56:42:989] LogLevel was 6
[1] [Jun 27 08:56:42:989] LogLevel set to 6
[5] [Jun 27 08:56:42:989] ExitOnError was True is set to false
[5] [Jun 27 08:56:42:989] ReportMessages was True is set to false
[5] [Jun 27 08:56:42:992]
[5] [Jun 27 08:56:42:992] Execution of Winbatch_produkt_silent_install
[6] [Jun 27 08:56:42:992] Call "comment "kill a running firefox""
[6] [Jun 27 08:56:42:992] Waiting until the called process is finished
[6] [Jun 27 08:56:42:993] Start process as invoker: SYSTEM
[3] [Jun 27 08:56:42:994] Exception in StartProcess_cp: Failed to execute comment "kill a running firefox" : 2
[6] [Jun 27 08:56:42:994]
[6] [Jun 27 08:56:42:994] Call "killtask "firefox.exe""
[6] [Jun 27 08:56:42:994] Waiting until the called process is finished
[6] [Jun 27 08:56:42:994] Start process as invoker: SYSTEM
[3] [Jun 27 08:56:42:994] Exception in StartProcess_cp: Failed to execute killtask "firefox.exe" : 2
[6] [Jun 27 08:56:42:994]
[6] [Jun 27 08:56:42:994] Call "msiexec /i X:\flashplayer\install_flash_player_11_plugin.msi /qn"
[6] [Jun 27 08:56:42:994] Waiting until the called process is finished
[6] [Jun 27 08:56:42:994] Start process as invoker: SYSTEM
[6] [Jun 27 08:56:53:032] ExitCode 0 Executed process "msiexec /i X:\flashplayer\install_flash_player_11_plugin.msi /qn"
[6] [Jun 27 08:56:53:032] Call "sub_check_exitcode"
[6] [Jun 27 08:56:53:032] Waiting until the called process is finished
[6] [Jun 27 08:56:53:033] Start process as invoker: SYSTEM
[3] [Jun 27 08:56:53:033] Exception in StartProcess_cp: Failed to execute sub_check_exitcode : 2
[6] [Jun 27 08:56:53:033] ExitCode 0 Executed process "msiexec /i X:\flashplayer\install_flash_player_11_plugin.msi /qn"
[1] [Jun 27 08:56:53:036] ___________________
[1] [Jun 27 08:56:53:036] script finished
[1] [Jun 27 08:56:53:036] 3 errors
[1] [Jun 27 08:56:53:036] 1 warning
Was mich sehr stutzig macht ist, dass winst wohl immer versucht einen Prozess für comment, killtask oder sub_check_exitcode auszuführen. Warum springt er z.B. bei sub_check_exitcode nicht in die entsprechende Funktion im Script?
Auch LogWarning möchte er als Prozess starten.

Wo finde ich eine Befehlsreferenz für die internen Winst Befehle?
Dann wird weiterhin der Pfad für den opsiScriptHelper Ordner erwähnt. Allerdings existiert dieser auf meinen ClientPCs nicht. Die instalierte opsi-winst Version ist 4.11.3.3.

Hat jemand eine Lösung für mein Problem?
Zuletzt geändert von MeisterM am 27 Jun 2013, 10:32, insgesamt 1-mal geändert.
djspcworld
Beiträge: 68
Registriert: 06 Jul 2011, 08:34

Re: Ausführen von Scripten

Beitrag von djspcworld »

Moin,

winst-Befehle findest Du in entsprechendem Dokument hier:
http://download.uib.de/opsi4.0/doc/

Kannst Du mal evtl. das Script oder min. ein Teilstück posten?
MeisterM
Beiträge: 3
Registriert: 27 Jun 2013, 09:36

Re: Ausführen von Scripten

Beitrag von MeisterM »

Klar:

Code: Alles auswählen

[Initial]
Message=installiere FlashPlayer 11
LogLevel=2
;  Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false

[Aktionen]
Winbatch_produkt_silent_install

[Winbatch_produkt_silent_install]
comment "kill a running firefox"
killtask "firefox.exe"
msiexec /i %SCRIPTPATH%\install_flash_player_11_plugin.msi /qn
sub_check_exitcode

[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"
  Files_copy
  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."
     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."
        else
           logError "Fatal: Setup program gives an unknown exitcode unequal zero: "+$ExitCode$
           isFatalError
        endif
     endif
  endif
endif

[Files_copy]
copy "%SCRIPTPATH%\mms.cfg" "%SYSTEM%\Macromed\Flash\"
MeisterM
Beiträge: 3
Registriert: 27 Jun 2013, 09:36

Re: Ausführen von Scripten

Beitrag von MeisterM »

Habe es selbst gelöst.

Das hier ist natürlich falsch. Innerhalb des Winbatch blocks werden nur Anwendungen ausgeführt.

Code: Alles auswählen

[Winbatch_produkt_silent_install]
comment "kill a running firefox"
killtask "firefox.exe"
msiexec /i %SCRIPTPATH%\install_flash_player_11_plugin.msi /qn
sub_check_exitcode
Also geändert:

Code: Alles auswählen

[Aktionen]
DefVar $ExitCode$

comment "kill a running firefox"
killtask "firefox.exe"
Winbatch_produkt_silent_install
sub_check_exitcode

[Winbatch_produkt_silent_install]
msiexec /i %SCRIPTPATH%\install_flash_player_11_plugin.msi /qn
Antworten