Problem mit Abhängigkeit bei einem Produkt

Antworten
NorbertKoch
Beiträge: 123
Registriert: 26 Aug 2021, 08:37

Problem mit Abhängigkeit bei einem Produkt

Beitrag von NorbertKoch »

Hallo allerseits,

der Urlaub war schön (aber zu kurz); jetzt geht es mit opsi weiter.
Ich habe aus den Script-Templates die Beispiele für Ghostscript und FreePDF verwendet und geringfügig modifiziert (Ghostscript installiere ich in 9.07, FreePDF in 4.14 im 64bit-Verzeichnis).
Ghostscript wird auch sauber installiert. Die Deinstallation funktioniert auch.
Bei nicht installiertem Ghostscript startet die FreePDF-Installation das Ghostscript-Setup. Die Abhängigkeit selbst (in diese eine Richtung) scheint also zu funktionieren.
FreePDF Control File:

Code: Alles auswählen

[ProductDependency]
action: setup
requiredProduct: ghostscript
requiredStatus: installed
requirementType: before
Aber FreePDF selbst lässt sich nicht installieren:
Es wird kurz der Setup-Dialog angezeigt, dann kommt "Sende Logdatei zum Server" und FreePDF wird in meiner Paketkliste für den Testclient mit Stand unknown und Report failed (setup) angezeigt.
Die Scripts zu FreePDF sehen so aus:
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.11.2.6"
 
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
 
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$       = "freepdf"
Set $MinimumSpace$    = "[b]50 MB[/b]"
; the path were we find the product after the installation
Set $InstallDir$      = "%ProgramFiles[b]64[/b]Dir%\freepdf_xp"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
; ----------------------------------------------------------------
 
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" $ProductId$
 
	if FileExists("%ScriptPath%\delsub.ins")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub.ins"
	endif
 
	Message "Installing " + $ProductId$ + " ..."
 
 
	comment "Start setup program"
	Winbatch_install
	Sub_check_exitcode
 
	Winbatch_install_printer
	Sub_check_exitcode
 
	comment "Create shortcuts"
	LinkFolder_install
 
endif
 
[Winbatch_install]
"%SCRIPTPATH%\files\[b]freepdf4.14.exe[/b]" /C:"fpSetup.exe /q"
 
[Winbatch_install_printer]
rundll32 printui.dll,PrintUIEntry /if /q /b "FreePDF" /r "freepdfxp1:" /m "HP Color LaserJet 2800 Series PS" /z /f "%systemroot%\inf\ntprint.inf"
 
[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."
		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
uninstall.ins:

Code: Alles auswählen

; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
 
[Actions]
requiredWinstVersion >= "4.11.2.6"
 
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $LicenseRequired$
DefVar $LicensePool$
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       = "freepdf"
Set $InstallDir$      = "%ProgramFiles[b]64[/b]Dir%\freepdf_xp"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
; ----------------------------------------------------------------
 
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
Message "Uninstalling " + $ProductId$ + " ..."
 
if FileExists("%ScriptPath%\delsub.ins")
	comment "Start uninstall sub section"
	Sub "%ScriptPath%\delsub.ins"
endif
Meine Änderungen habe ich versucht fett zu formatieren. Das das im Code nicht angezeigt wird stehen die geänderten Werte jetzt zwischen

Code: Alles auswählen

den [b][/b]-Tags
; es handelt sich aber nur um den benötigten freien Speicherplatz (1 MB kam mir zu gering vor), das Programm-Verzeichnis (64bit anstatt 32bit) und den Namen der Setup-Datei (bei mir freepdf4.14.exe).
Woran kann es liegen, dass FreePDF nicht installieren will?

Und: Wie kann ich für die Deinstallation eintragen, dass auch Ghostscript deinstalliert werden soll?

Danke!
Liebe Grüße

Norbert
Antworten