Wir versuchen zur Zeit ein Paket für OpenJDK zu erstellen. Dabei soll der Speicherort im opsi-configed durch ProductProperties gesetzt werden können.
Dies funktioniert auch soweit, ich kann einen festen Pfad (C:\Programme\OpenJDK) eintragen und die Installation geht.
Wir möchten nun aber die globalen Textkonstanten verwenden können um die Speicherorte einstellen zu können.
Wird jetzt im configed in den Properties z.B %ProgramFiles64Dir% (in jeglicher Variation mit/ohne Anführungszeichen) gesetzt, wird diese Konstante leider nicht ersetzt.
Ich gehe jetzt mal davon aus, dass GetProductProperty() da "%ProgramFiles64Dir%" als String behandelt/zurückgibt, und daher keine Ersetzung stattfindet. Gibt es eine Möglichkeit, das ganze irgendwie zu umgehen?
Danke im Voraus für jede Hilfe
setup.opsiscript
Code: Alles auswählen
[Actions]
requiredWinstVersion >= "4.11.4.3"
ScriptErrorMessages = false
DefVar $SetupType$
DefVar $ProductId$
DefVar $Setupfile$
DefVar $InstallDir$
DefVar $MinimumSpace$
DefVar $ExitCode$
DefVar $ErrorMsg$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $MsiId$
DefVar $NsisInstallBatch$
DefVar $LogDir$
DefVar $SilentOption$
DefVar $Umgehung$
Set $LogDir$ = "%opsiLogDir%"
include_append "%ScriptPath%\check_msi_exitcode.opsiscript"
; ----------------------------------------------------------------
Set $SetupType$ = "msi"
; ----------------------------------------------------------------
; $ProductId$ is the name of the product in opsi, only lower letters, no umlauts, no white spaces, use '-' as a seperator
Set $ProductId$ = "openjdk8"
Set $Setupfile$ = "java-1.8.0-openjdk-1.8.0.191-1.b12.ojdkbuild.windows.x86_64.msi"
; the path where we find the product after the installation
Set $InstallDir$ = GetProductProperty("install-dir", "%ProgramFiles64Dir%\OpenJDK")
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
Set $MsiId$ = "{579C83AF-A86C-4498-8903-25317C546FEC}"
Set $MinimumSpace$ = "821 MB"
Set $SilentOption$ = GetProductProperty("silent-option","/qb!")
; ----------------------------------------------------------------
; ----------------------------------------------------------------
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError "No Space"
; Stop process and set installation status to failed
else
comment "Show product picture"
ShowBitmap "%ScriptPath%\o4i.png" $ProductId$
if FileExists("%ScriptPath%\delsub.opsiscript")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub.opsiscript"
endif
Message "Installing " + $ProductId$ + " ..."
if $LicenseRequired$ = "true"
comment "Licensing required, reserve license and get license key"
Sub_get_licensekey
endif
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
;----------------------------------------------
Winbatch_install_msi
;----------------------------------------------
Sub_check_exitcode
endif
; ----------------------------------------------------------------
; install section
; ----------------------------------------------------------------
[Winbatch_install_msi]
msiexec /i "%ScriptPath%\java-1.8.0-openjdk-1.8.0.191-1.b12.ojdkbuild.windows.x86_64.msi" /l* "$LogDir$\$ProductId$.install_log.txt" $SilentOption$ ALLUSERS=1 REBOOT=ReallySuppress ADDLOCAL=ALL TARGETDIR=$InstallDir$
; ----------------------------------------------------------------
Code: Alles auswählen
[ProductProperty]
type: unicode
name: install-dir
multivalue: False
editable: True
description: Sets the Install-Dir