in unserer Schule möchten wir via Opsi Gimp installieren. Wir haben viele W2k- und einige XP-Clients. Da die letzte unter W2k lauffähig Gimp-Version die 2.4.7 ist, habe ich ein Skript erstellt, welches anhand der NT-Versionen die richtige Gimp Version installiert. Die Basis für mein Skript war natürlich das Opsi-Template.
Das Skript scheint so weit zu funktionieren, bis auf das in der sekundären Sektion die beiden Variablen für den Installationspfad nicht zusammengebackpfeift werden. Da kommt diese Fehlermeldung:
Error: "p:\install\gimp\%GimpVer%" /SILENT .... ShellExecute Error 2 (Das System kann die angegebene Datei nicht finden)
Ich wäre über weiterführende Tipps und Hinweise sehr dankbar!
Anbei mein Winst-Skript:
Code: Alles auswählen
[Actions]
requiredWinstVersion >= "4.10.5"
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $OS$
DefVar $MinorOS$
DefVar $GimpVer$
Set $LogDir$ = "%SystemDrive%\tmp"
Set $OS$ = GetOS
Set $MinorOS$ = GetNTVersion
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
Set $ProductId$ = "gimp"
Set $MinimumSpace$ = "200 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFilesDir%\GIMP-2.0"
; ----------------------------------------------------------------
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
if ( $MinorOS$ = "Win2k" )
Message "Windows 2000 erkannt. Installiere Gimp 2.4.7...)
set $GimpVer$ = "gimp-2.4.7-i686-setup.exe"
else
if ( $MinorOS$ = "WinXP")
Message "Windows XP erkannt. Installiere Gimp 2.6.11..."
set $GimpVer$ = "gimp-2.6.11-i686-setup.exe"
else
logError "Keine unterstützte Windows-Version.")
isFatalError
endif
endif
Message "Installiere "+$GimpVer$+" ..."
comment "Starte Gimp Setup."
Winbatch_install
Sub_check_exitcode
comment "Teste, ob die Installation erfolgreich verlief."
; Test if software marked as installed in registry
if (GetRegistryStringValue("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1] DisplayName") = "")
logError "Fatal: After Installation [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1] not found"
isFatalError
else
comment "Installation erfolgreich abgeschlossen."
endif
endif
[Winbatch_install]
; === Inno Setup ================================================================
"%ScriptPath%"\"%GimpVer%" /SILENT
[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
Friedhelm