User Tools

Site Tools


userspace:ibm_semeru_open_jre

This is an old revision of the document!


IBM Semeru JRE Runtime

Comments and improvements welcome
Tested with opsi 4.2
Windows 10 x64 Ent SAC 19.09, 20H2 & 21H2

type: localboot
id: ibm-semeru-open-jre
description: Java Runtime

setup.opsiscript

; 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/
 
[Initial]
setLogLevel=7
;  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
 
[Actions]
requiredWinstVersion >= "4.10.8.6"
 
 
; ----------------------------------------------------------------
; - define Variables			                           		 -
; ----------------------------------------------------------------
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $InstallDir_32$
DefVar $InstallDir_SysN$
DefVar $SetupFile$
DefVar $SetupFile_32$
DefVar $SetupFile_64$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $Version$
DefVar $Version_OpenJ$
DefVar $INST_SystemType$
DefVar $INST_MsVersion$
DefVar $INST_architecture$
DefVar $InstCMD$
DefVar $UninstCMD$
DefVar $IntrestingFile$
DefVar $Product_Pic$
DefVar $DisplayName$
DefVar $UninstallCommand$
DefVar $MSIUninstStrg$
DefVar $MsiId$
DefStringList $GetDisplayName$
DefStringList $GetMSIUninstStrg$
; ----------------------------------------------------------------
 
; ----------------------------------------------------------------
; - Setting Product values       			                     -
; ----------------------------------------------------------------
Set $INST_SystemType$ 	= GetSystemType
Set $INST_MsVersion$	= GetMsVersionInfo
Set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ 			= "%SystemDrive%\tmp"
; ----------------------------------------------------------------
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       	= "IBM Semeru Runtime"
Set $MinimumSpace$    	= "200 MB"
Set $Version$			= "8u352b08"
Set $Version_OpenJ$		= "9-0.35.0"
Set $InstallDir_SysN$	= "%ProgramFilesSysnativeDir%\Java"
Set $SetupFile_32$		= "%ScriptPath%\"+"ibm-semeru-open-jre_x86-32_windows_"+$Version$+"_openj"+$Version_OpenJ$+".msi"
Set $SetupFile_64$		= "%ScriptPath%\"+"ibm-semeru-open-jre_x64_windows_"+$Version$+"_openj"+$Version_OpenJ$+".msi"
Set $InstCMD$ 			= '/log c:\tmp\OpenJDK-JRE_inst.txt /qb INSTALLDIR="C:\Program Files\Java" ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome,FeatureIcedTeaWeb,FeatureJNLPFileRunWith,FeatureOracleJavaSoft'
Set $LicenseRequired$ 	= "false"
Set $LicensePool$     	= "p_" + $ProductId$
Set $UninstCMD$			= "/S"
Set $Product_Pic$		= "ibm-semeru-open-jre"
; ----------------------------------------------------------------
 
; ----------------------------------------------------------------
; - Check System requirements		                           	 -
; ----------------------------------------------------------------
if CompareDotSeparatedNumbers($INST_MsVersion$,"<=","6.0")
	LogError "Wrong OS Version. At least Windows 7 is required for installation!"
	isFatalError
	; Stop process and set installation status to failed
endif
 
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
endif
 
if $LicenseRequired$ = "true"
	comment "Licensing required, reserve license and get license key"
	Sub_get_licensekey
endif
; ----------------------------------------------------------------
 
 
; ----------------------------------------------------------------
; - Installation					                           	 -
; ----------------------------------------------------------------
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $Product_Pic$ $ProductId$
 
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only"))
 
	comment "Check previous Version"
	if FileExists($InstallDir_SysN$)
		comment "Start uninstall sub section"
		Message "Found previous Version installed, uninstalling first."
		Sub "%ScriptPath%\delsub.opsiscript"
	endif
 
	Message "Installing " + $ProductId$ + " " + $Version$
 
	comment "Start setup program"
	Winbatch_install_32
	Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
endif
 
if (($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
 
	comment "Check previous 64 Bit Version installed"
	if FileExists($InstallDir_SysN$)
		comment "Start uninstall sub section"
		Message "Found previous Version installed, uninstalling first."
		Sub "%ScriptPath%\delsub.opsiscript"
	endif
 
	Message "Installing " + $ProductId$ + " " + $Version$
 
	comment "Start setup program"
	Winbatch_install_64
	Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
endif
 
; ----------------------------------------------------------------
 
 
; ----------------------------------------------------------------
; - Sub's							                           	 -
; ----------------------------------------------------------------
 
[Winbatch_install_32]
msiexec /i $SetupFile_32$ $InstCMD$
 
[Winbatch_install_64]
msiexec /i $SetupFile_64$ $InstCMD$
 
 
[Sub_get_licensekey]
if opsiLicenseManagementEnabled
	comment "License management is enabled and will be used"
 
	comment "Trying to get a license key"
	Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
	; If there is an assignment of exactly one licensepool to the product the following call is possible:
	; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
	;
	; If there is an assignment of a license pool to a windows software id, it is possible to use:
	; DefVar $WindowsSoftwareId$
	; $WindowsSoftwareId$ = "..."
	; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
 
	DefVar $ServiceErrorClass$
	set $ServiceErrorClass$ = getLastServiceErrorClass
	comment "Error class: " + $ServiceErrorClass$
 
	if $ServiceErrorClass$ = "None"
		comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
	else
		if $ServiceErrorClass$ = "LicenseConfigurationError"
			LogError "Fatal: license configuration must be corrected"
			LogError getLastServiceErrorMessage
			isFatalError
		else 
			if $ServiceErrorClass$ = "LicenseMissingError"
				LogError "Fatal: required license is not supplied"
				isFatalError
			endif
		endif
	endif
else
	LogError "Fatal: license required, but license management not enabled"
	isFatalError
endif
 
; ----------------------------------------------------------------

delsub.opsiscript

; ----------------------------------------------------------------
; - Deinstallation                                               -
; ----------------------------------------------------------------
 
Set $GetMSIUninstStrg$ = getOutStreamFromSection ("DosInAnIcon_MSIUninstStrg WINST /SysNative")
Set $MSIUninstStrg$ = takestring (-1, $GetMSIUninstStrg$)
if contains ($MSIUninstStrg$,"{")
	if contains ($MSIUninstStrg$,"}")
		set $MsiId$ = $MSIUninstStrg$
	else
		logError "MSI Uninstall String misformed. Check Log."
		isFatalError "Uninst String missing }"
	endif
else
	logError "Installation not found or MSI Uninstall String misformed. Check Log."
	isFatalError "Uninst String missing {"
endif
 
Set $GetDisplayName$ = getOutStreamFromSection ("DosInAnIcon_DisplayName WINST /SysNative")
Set $DisplayName$ = takestring (-1, $GetDisplayName$)
if not ($DisplayName$ = "")
	Message "Found "+$DisplayName$+" => uninstalling first"
	Winbatch_uninstall
	Sub "%ScriptPath%\check_msi-exitcode.opsiscript"
	Files_delete
else
	logError "MSI String for old Version found, but no Display Name set."
	isFatalError "DisplayName"
endif
 
; ----------------------------------------------------------------
; - Sub's                                      			         -
; ----------------------------------------------------------------
 
[DosInAnIcon_MSIUninstStrg]
@echo off
for /f "delims=\ tokens=7" %%a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s /f "IBM Semeru Runtime Open Edition" ^| find "{"') do echo %%a
 
[DosInAnIcon_DisplayName]
@echo off
for /f "tokens=3*" %%c in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s /f "IBM Semeru Runtime Open Edition" ^| find "DisplayName"') do echo %%c %%d
 
[Winbatch_uninstall]
MsiExec.exe /x $MsiId$ /qb-! REBOOT=ReallySuppress
 
[Registry_delete]
DeleteKey [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
 
[Files_delete]
del -s -f %ProgramFilesSysNativeDir%\Java

uninstall.opsiscript

; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
 
[Initial]
setLogLevel=7
;  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]
requiredWinstVersion >= "4.10.8.3"
; ----------------------------------------------------------------
; - define Variables			                           		 -
; ----------------------------------------------------------------
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir_SysN$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $Version$
DefVar $INST_SystemType$
DefVar $INST_MsVersion$
DefVar $INST_architecture$
DefVar $InstCMD$
DefVar $UninstCMD$
DefVar $IntrestingFile$
DefVar $Product_Pic$
DefVar $DisplayName$
DefVar $UninstallCommand$
DefVar $MSIUninstStrg$
DefVar $MsiId$
DefStringList $GetDisplayName$
DefStringList $GetMSIUninstStrg$
; ----------------------------------------------------------------
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       	= "IBM Semeru Runtime"
Set $MinimumSpace$    	= "100 MB"
Set $Version$			= "8u352b08"
Set $InstallDir_SysN$	= "%ProgramFilesSysnativeDir%\Java"
Set $LicenseRequired$ 	= "false"
Set $LicensePool$     	= "p_" + $ProductId$
Set $UninstCMD$			= "/S"
Set $Product_Pic$		= "logo.png"
; ----------------------------------------------------------------
 
if FileExists("%ScriptPath%\delsub.opsiscript")
	ShowBitmap "%ScriptPath%\" + $Product_Pic$ $ProductId$
	Message "Deinstalling Java Runtime"
	comment "start uninstall"
	sub "%ScriptPath%\delsub.opsiscript"
endif
userspace/ibm_semeru_open_jre.1672761626.txt.gz · Last modified: 2023/01/03 16:00 by chris_10