Seite 1 von 1

Adobe Flash Player - Software Paket

Verfasst: 29 Jun 2015, 13:16
von ItUnicum
Hallo Com,

ich habe die Aufgabe bekommen mich um ein Software Deployment Tool zu kümmern. Dabei bin ich auf OPSI gestoßen & finde es absolut klasse :)

Als erstes soll die uninstall.exe ausgeführt werden um alle Adobe Flash Player Versionen zu löschen, dann sollen die msi Setup dateien ausgeführt werden.
Da ich im Registery keine Einträge finde für Adobe, möchte ich auch keine "If FileExist" Abfrage.

Code: Alles auswählen

[Initial]
Message = Bitte warte, das Produkt wird installiert
LogLevel=2
ExitOnError=false
ScriptErrorMessages=on
TraceMode=off
StayOnTop=false

;----------------------------------------------------------------------;

[Aktionen]
requiredWinstVersion >= "4.11"

[Winbatch_install]
"%ScriptPath%\uninstall_flash_player.exe" /S

DefVar $Executable1$
Set $Executable1$ = "install_flash_player_18_active_x.msi"
DefVar $Executable2$
Set $Executable2$ = "install_flash_player_18_plugin.msi"

[Winbatch_Install]
msiexec /i "%SCRIPTPATH%\$Executable1$" /qb-! reboot=reallysuppress
[Winbatch_Install]
msiexec /i "%SCRIPTPATH%\$Executable2$" /qb-! reboot=reallysuppress

Re: Adobe Flash Player - Software Paket

Verfasst: 29 Jun 2015, 13:27
von pandel
Tach :-)!

Mal ein dezenter Hinweis aufs opsi wiki: wiki/doku.php?id=userspace:script_templates#a

Daneben solltest du dir dein Script aber mal genauer ansehen. Da sind einige "Ungereimtheiten" drin... fängt schon bei "[Aktionen]" an. Lt. opsi Script Syntax gibt's das überhaupt nicht. Dann hast du mehrere Sektionen, die alle "Winbatch_install" heißen. Die musst du namentlich schonmal unterscheiden, wie soll der Interpreter denn wissen, welche du meinst, etc. ...

Aaaalso:
Als allererstes: https://download.uib.de/opsi4.0/doc/htm ... n-tutorial
Pflichtlektüre für Syntaxrecherche: https://download.uib.de/opsi4.0/doc/ops ... ual-de.pdf
... alles weitere hier: https://download.uib.de/opsi4.0/doc/

Lieber Gruß
Holger

Re: Adobe Flash Player - Software Paket

Verfasst: 07 Jul 2015, 14:15
von larsg
requiredWinstVersion >= "4.11" gehört eigentlich unter den [Initial] Block

"[Aktionen]" sollte "[Actions]" heißen

DefVar und Set können nur im [Actions] Block oder entsprechend aufzurufenden Sub-Prozeduren genutzt werden.

Die Definitionen von sekundären Prozeduren wie Winbatch gehören unter das Ende (!!!) des [Actions] Blocks - diese werden dann ohne die Klammern im [Actions] Block nacheinander aufgerufen.

Die Prozedur Winbatch_Install existiert 3 mal - nimm eindeutige Namen und ruf die Prozeduren dann in der gewünschten Reihenfolge auf.

Ansonsten schaut das auf den ersten Blick soweit gut aus, dafür das du alles durcheinander gewürfelt hast xD


Ich empfehle ein eingehendes Studium der Winst-Referenz. Ist zwar nicht gerade das 1x1, aber wenn man es einmal drauf hat kommt man ganz gut zurecht.

Re: Adobe Flash Player - Software Paket

Verfasst: 09 Jul 2015, 14:37
von r4a5a88
So sieht der Code für flash player bei mir aus

Code: Alles auswählen

[Actions]

DefVar $ProductId$  
DefVar $ExitCode$

; ----------------------------------------------------------------
Set $ProductId$       = "flashplayer"
; ----------------------------------------------------------------

	
	Message "Installing " + $ProductId$ + " ..."
	
	comment "Start setup program"
	Winbatch_install
	Sub_check_exitcode
	

[Winbatch_install]
msiexec /i "%ScriptPath%\install_flash_player_18_active_x.msi" /qb! ALLUSERS=2 REBOOT=ReallySuppress
msiexec /i "%ScriptPath%\install_flash_player_18_plugin.msi" /qb! ALLUSERS=2 REBOOT=ReallySuppress

[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
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."
		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
ich hoffe , es hilft