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.
[Initial]
LogLevel = 9
ExitOnError = false
ScriptErrorMessages = on
TraceMode = off
StayOnTop = false
[Aktionen]
DefVar $TEMP$
DefVar $OS$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $UninstallCommand$
DefVar $MsiCode$
DefVar $DisplayName$
DefVar $RemoveOOo2$
DefVar $RebootFlag$
Set $TEMP$ = EnvVar("TEMP")
Set $OS$ = GetOS
Set $ProductId$ = "java"
Set $InstallDir$ = "%ProgramFilesDir%\Java\jre6"
if not ( $OS$ = "Windows_NT" or $OS$ = "Windows_95" )
LogError "Refusing uninstall on os " + $OS$
isFatalError
endif
ShowBitmap /3 "%scriptpath%\java.png"
Message "Deinstalliere Java"
Set $MsiCode$ = "{26a24ae4-039d-4ca4-87b4-2f86416037ff}"
Set $DisplayName$ = GetRegistryStringValue ("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"+$MsiCode$+"] DisplayName")
if not ($DisplayName$ = "")
Message "Gefunden "+$DisplayName$+" => es wird deinstalliert..."
Set $UninstallCommand$ = "MsiExec.exe /x "+$MsiCode$+" /qb-! REBOOT=ReallySuppress"
Winbatch_uninstall
endif
[WinBatch_uninstall]
$UninstallCommand$
Install script
Code: Alles auswählen
[Actions]
requiredWinstVersion >= "4.10.8.6"
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $UninstallProgram$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $Version$
DefVar $Executable32$
DefVar $Executable64$
DefVar $MsiId$
Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ = "%SystemDrive%\tmp"
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
Set $MinimumSpace$ = "50 MB"
; the path were we find the product after the installation
Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$
Set $Executable32$ = "jre-6u37-windows-i586.exe"
Set $Executable64$ = "jre-6u37-windows-x64.exe"
; ----------------------------------------------------------------
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Nicht ausreichend Platz auf %SystemDrive%, " + $MinimumSpace$ + " auf Laufwerk %SystemDrive% für " + $ProductId$ " benötigt "
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
comment "Installiere " + $ProductId$ + " (32/64 Bit)"
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
Message "64Bit System identifiziert Java 32Bit wird installiert"
comment "Start setup program"
Winbatch_Install_32-Bit
Sub_check_exitcode
endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
Message "64Bit System identifiziert Java 64Bit wird installiert"
comment "Start setup program"
Winbatch_Install_64-Bit
Sub_check_exitcode
endif
endif
; comment "Es wird getestet ob die Software korrekt installiert wurde"
; Test if software marked as installed in registry
; if (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}] DisplayName") = "")
; logError "Fatal: After Installation 32 bit [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}] not found"
; isFatalError
; else
; comment "Successful Installation"
; endif
endif
[Winbatch_Install_32-Bit]
"%ScriptPath%\jre-6u37-windows-i586.exe" /s MOZILLA=1
[Winbatch_Install_64-Bit]
"%ScriptPath%\jre-6u37-windows-x64.exe" /s MOZILLA=1
[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
Ich glaube ich habe zu viel mit den Befehlen herum experimentiert