User Tools

Site Tools


userspace:etu_javavm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
userspace:etu_javavm [2015/03/30 21:34]
Robert Tauber created
userspace:etu_javavm [2021/08/23 08:37] (current)
Line 27: Line 27:
 CLIENT_DATA\Uninstall_Java.exe\\ CLIENT_DATA\Uninstall_Java.exe\\
 CLIENT_DATA\java.png\\ CLIENT_DATA\java.png\\
 +
 +==== control ====
 +<code>
 +[Package]
 +version: 2014.12.08
 +depends: 
 +incremental: False
 +
 +[Product]
 +type: localboot
 +id: javavm
 +name: Oracle Java Runtime Environment
 +description: Java 7
 +advice: 
 +version: 0
 +priority: 0
 +licenseRequired: False
 +productClasses: jre
 +setupScript: javavm.ins
 +uninstallScript: deljvm.ins
 +updateScript: 
 +alwaysScript: 
 +onceScript: 
 +customScript: 
 +userLoginScript: 
 +
 +[ProductProperty]
 +type: unicode
 +name: install_architecture
 +multivalue: False
 +editable: False
 +description: which architecture (32/64 bit) has to be installed
 +values: ["32 only", "64 only", "both", "system specific"]
 +default: ["both"]
 +
 +[ProductProperty]
 +type: unicode
 +name: javaversion
 +multivalue: False
 +editable: False
 +description: which version has to be installed (JRE 1.6.x or JRE 7 = 1.7.x)
 +values: ["jre6", "jre7"]
 +default: ["jre7"]
 +</code>
  
 ==== CopyFolder.exe / CopyFolder.au3 ==== ==== CopyFolder.exe / CopyFolder.au3 ====
Line 100: Line 144:
  
 ==== javavm.ins ==== ==== javavm.ins ====
 +Ich will das ganze bei Gelegenheit vereinfachen bin aber bisher nicht dazu gekommen
 +
 <code winst> <code winst>
-(c) Robert Tauber in anlenung an Paket von uib gmbh+; Robert Tauber in anlenung an Paket von uib gmbh
  
 ; Update was ist zu tun? ; Update was ist zu tun?
Line 480: Line 526:
 </code> </code>
  
-==== uninstall.ins ====+==== deljvm.ins ==== 
 +erlaubt es die subdeljava. als uninstall aufzurufen
 <code winst> <code winst>
-; (c) Robert Tauber 2014+Copyright (c) uib gmbh (www.uib.de) 
 +; This sourcecode is owned by uib 
 +; and published under the Terms of the General Public License.
  
-[Actions+[Aktionen
-requiredWinstVersion >= "4.10.5+requiredWinstVersion >= "4.10.8.3
-setLogLevel +Message=Deinstalling Oracle Java Virtual Machine 1.6 ... 
-StayOnTop = on +DefVar $UninstallCommand
-DefVar $ProductId$ +DefVar $DisplayName$
-DefVar $ProductNameShort$ +
-DefVar $ProductNameLong+
-DefVar $LocalDir$+
 DefVar $ExitCode$ DefVar $ExitCode$
-DefVar $Part$ 
-DefVar $ValidOS$ 
-Set $ValidOS$ = "false" 
- 
-;----------------------------------------------------- 
-; Angaben zum Produkt 
-;----------------------------------------------------- 
-; Kurzer Produktname (max. 12 Zeichen) 
-Set $ProductNameShort$ = "Adobe Reader" 
-; Langer Produktname (max. 30 Zeichen) 
-Set $ProductNameLong$ = "Adobe Reader" 
-;----------------------------------------------------- 
-; Gewünschtes Betriebssystem (alle ungültigen auskommentieren) 
-; subCheckForWinXP-32 ; Windows XP 32-bit 
-; subCheckForVista-32 ; Windows Vista 32-bit  
-; subCheckForVista-64 ; Windows Vista 64-bit 
-; subCheckForSeven-32 ; Windows 7 32-bit 
- subCheckForSeven-64 ; Windows 7 64-bit 
-;----------------------------------------------------- 
- 
- 
- 
  
-;----------------------------------------------------- +if FileExists("%ScriptPath%\subdeljava.ins") 
-; Muss normalerweise nicht geändert werden + comment "start uninstall
-;----------------------------------------------------- + sub "%ScriptPath%\subdeljava.ins"
- +
-; Bildchen und Statusmeldung +
-ShowBitmap "%ScriptPath%\image.png$ProductNameShort$ +
-Message "Deinstalliere " + $ProductNameLong$ + "...+
- +
-; Lokalen Pfad erzeugen +
-Set $ProductId$ "%installingProduct%+
-if $ProductId$ = "" +
- Set $ProductId$  = "local_testing"+
 endif endif
-Set $LocalDir$ = "%SystemDrive%\files\" + $ProductId$ 
  
-; Prüfen, ob gültiges Betriebssystem +[Winbatch_oracle_uninstall] 
-if $ValidOS= "false" +$UninstallCommand$
- LogError "Dieses Betriebssystem (" + GetNtVersion + " " + GetSystemType + ") wird von diesem Produkt (" + $ProductId$ + ") nicht unterstützt!" +
- isFatalError +
-endif+
  
-;----------------------------------------------------- +</code>
-; Daten vorbereiten +
-;----------------------------------------------------- +
- FilesCleanDir +
- DosBatchMakeDir+
  
-;----------------------------------------------------- +==== subdeljava ==== 
-; Netzlaufwerk verbinden/Copy +Da das updaten der Reg keys mir zu blöd war lass ich jetzt ein Skript danach suchen. 
-;----------------------------------------------------- +Wer befürchtet das dies vielleicht mal zu viel erwischt kann auch die Version von uib verwenden. 
-;DosInAnIcon_Q +<code winst> 
-;DosInAnIcon_Copy+Robert Tauber 2013
  
 +; RT: Mögliches Zusatz File
 +;if FileExists("%ScriptPath%\custom_ins_dir\prevent_uninstall.ins")
 +; sub "%ScriptPath%\custom_ins_dir\prevent_uninstall.ins"
 +;endif
  
 +;RT: Sartmenü Aufreumen
 +LinkFolder_Webstart_delete
 +;RT: JAVA Runterschmeisen
 +Message "Un-Installing (Kann dauern)"
 +Winbatch_deinstall
 +Message "Un-Installing Komplet"
 +;RT: Exit Code Auswerten
 +Sub_check_exitcode
  
  
-;----------------------------------------------------- 
-; Die DeInstallation 
-;----------------------------------------------------- 
- Set $Part$ = "setup.exe" 
- if FileExists("%ProgramFiles32Dir%\VideoLAN\vlc\uninstall.exe") 
- Winbatch_uninstall 
- subCheckExitCodeVLC 
- Files_uninstall 
- endif 
- Winbatch_uninstall 
- subCheckExitCodeEXE 
- FilesCleanTemp 
- Files_uninstall 
- ExitWindows /Reboot 
-;----------------------------------------------------- 
  
-;----------------------------------------------------- +;RT: Runter mit Java das AutoIt Skript killt alle Java versionen 
-; Subroutinen +[Winbatch_deinstall
-;----------------------------------------------------- +%SCRIPTPATH%\Uninstall_Java.exe
-[FilesCleanDir+
-Delete -s $LocalDir$+
  
-[DosBatchMakeDir+;RT: Killt den Shot key im Startmenü konte keinen finden 
-@echo off +[LinkFolder_Webstart_delete
-mkdir $LocalDir$+set_basefolder common_programs 
 +delete_subfolder "Java" 
 +delete_subfolder "Java Web Start"
  
-[Winbatch_uninstall+;RT: Exit cod Checken 
-"%ProgramFiles32Dir%\Notepad++\uninstall.exe" /S+[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$ = "1603"
 + comment "A fatal error occurred during installation. 1603" 
 + comment "Quite normal while uninstalling java autoupdater" 
 + comment "for other uninstalls might be a problem" 
 + else 
 +  
 +   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 
 +endif 
 +</code>
  
-[Files_uninstall] +==== Uninstall_Java.exe / Uninstall_Java.au3 ==== 
-delete -sf "%ProgramFiles32Dir%\Notepad++\"+SAD (search and destroy) Skript<\\ 
 +<code autoit> 
 +#cs ----------------------------------------------------------------------------
  
 + AutoIt Version: 3.3.8.1
 + Author:         Robert Tauber
  
-;----------------------------------------------------- + Script Function
-; Netzlaufwerk verbinden/Copy + Deinstalirt alle Java Versionen
-;----------------------------------------------------- +
-[DosInAnIcon_Q] +
-"p:\!drivemap\map_Q.exe" +
-[DosInAnIcon_Copy] +
-"Q:\$ProductNameShort$\Copy.exe" +
-[FilesCleanTemp] +
-Delete -s "%SystemDrive%\Temp\$ProductNameShort$"+
  
 +#ce ----------------------------------------------------------------------------
  
-;----------------------------------------------------- +Script Start Add your code below here
-; Subroutinen zur Überprüfung der ExitCodes +
-; Je nach Installer verschieden +
-;----------------------------------------------------- +
-+
-; Windows Installer: subCheckExitCodeMSI +
-; 0 = Erfolgreich +
-; 3010 = Bitte Neustart+
  
-Diverse EXE-DateiensubCheckExitCodeEXE +DirCreate("c:\temp\"
-; 0 = Erfolgreich+Opt("WinTitleMatchMode", -2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase 
 +;Reg Key auslesen 
 +Run(@ComSpec & " /c " & 'start /wait "" REGEDIT /E c:\temp\registry.tmp HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall' ,"", @SW_HIDE) 
 +Run(@ComSpec & " /c " & 'start /wait "" REGEDIT /E c:\temp\registry2.tmp HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\windows\currentversion\uninstall' ,"", @SW_HIDE) 
 +;winwait ("cmd.exe")
  
-;-----------------------------------------------------+WinWaitClose ("cmd.exe")
  
-[subCheckExitCodeMSI] +;Filter die keys mit {} 
-Set $ExitCode$ = getLastExitCode +Run(@ComSpec & /c & 'type c:\temp\registry.tmp | find /i "{| find /i "}]> c:\temp\REG.tmp' ,"", @SW_HIDE) 
-Abbruch bei Fehler +Run(@ComSpec & /c & 'type c:\temp\registry2.tmp | find /i "{| find /i "}]>> c:\temp\REG.tmp' ,"", @SW_HIDE)
-if not (($ExitCode$ = "0") or ($ExitCode$ = "3010")) +
- LogError "Fehler bei der Installation von + $ProductNameLong$ + " (" + $Part$ + ")ExitCode + $ExitCode$  +
- isFatalError +
-endif +
-comment "Erfolgreiche Installation von + $ProductNameLong$ + (" + $Part$ + ")ExitCode " + $ExitCode$ +
-; Neustartfalls gewünscht +
-if $ExitCode$ = "3010" +
- set $Reboot$ = "true" +
-endif+
  
-[subCheckExitCodeEXE] 
-Set $ExitCode$ = getLastExitCode 
-; Abbruch bei Fehler 
-if not ($ExitCode$ = "0") 
- LogError "Fehler bei der Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$  
- isFatalError 
-endif 
-comment "Erfolgreiche Installation von " + $ProductNameLong$ + " (" + $Part$ + "): ExitCode " + $ExitCode$ 
  
-[subReboot] +;winwait ("cmd.exe") 
-if $Reboot$ = "true+WinWaitClose ("cmd.exe")
- ExitWindows /Reboot +
-endif+
  
 +$file = FileOpen("c:\temp\REG.tmp", 0)
 +$Java = FileOpen("c:\temp\JAVA_REG.tmp", 2)
 +;RT: Könte effektiver sein wenn man das ursprüngliche file con key zu key durchsucht
 +While 1
 +   Local $line = FileReadLine($file)
 +   If @error = -1 Then ExitLoop
 +   $KEY = StringReplace($line, "[", "")
 +   $KEY = StringReplace($KEY , "]", "")
 +   ;RT: den inhalt aller {} KEYs Temporär als Text file sichern
 +   Run(@ComSpec & " /c " & 'start /wait "" REGEDIT /E c:\temp\KEYS.tmp ' & $KEY ,"", @SW_HIDE)
 +   winwait ("cmd.exe")
 +   WinWaitClose ("cmd.exe")
 +   $file_KEY = FileOpen("c:\temp\KEYS.tmp", 0)
 +   While 1
 +   ;RT: Das gerade erstellte textfile nach JER Durchsuchen (JAVA)
 +   Local $line_KEY = FileReadLine($file_KEY)
 +    If @error = -1 Then ExitLoop
 +   if StringInStr ($line_KEY, "jre") then
 + ;RT: wurde in dem Key eine jre gefunden (JAVA)
 + Local $Split = StringSplit($KEY, "{")
 + $KEY = "{" & $Split[2]
 +    ;RT: Schreib die gefundenen keys in das file
 + FileWrite ( $Java , $KEY & @CRLF)
 + ExitLoop
 +    endif
 +   WEnd
 +   FileClose ( $file_KEY )
 +   ;RT: File schlisen da sonst fehler
 +Wend
 +FileClose ( $file )
 +FileClose ( $Java )
  
  
-;----------------------------------------------------- 
-; Subroutinen zur Überprüfung der Windows-Version 
-;----------------------------------------------------- 
-[subCheckForWinXP-32] 
-if GetMsVersionInfo = "5.1" AND GetSystemType = "x86 System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForVista-32] 
-if GetMsVersionInfo = "6.0" AND GetSystemType = "x86 System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForVista-64] 
-if GetMsVersionInfo = "6.0" AND GetSystemType = "64 bit System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForSeven-32] 
-if GetMsVersionInfo = "6.1" AND GetSystemType = "x86 System" 
- Set $ValidOS$ = "true" 
-endif 
- 
-[subCheckForSeven-64] 
-if GetMsVersionInfo = "6.1" AND GetSystemType = "64 bit System" 
- Set $ValidOS$ = "true" 
-endif 
  
 +;RT: Alle gefundenen Deinstaliren
 +$Java = FileOpen("c:\temp\JAVA_REG.tmp", 0)
 +While 1
 +   Local $line = FileReadLine($Java )
 +   If @error = -1 Then ExitLoop
 +   Run(@ComSpec & " /c " & 'MsiExec.exe /qn /X'& $line &' /norestart')
 +WEnd
 +;winwait ("cmd.exe")
 +WinWaitClose ("msiexec")
 +Sleep(5000)
 +Winkill ("cmd.exe")
 +;MsgBox ( 0, "title", "text")
 </code> </code>
- 
  
userspace/etu_javavm.1427751258.txt.gz · Last modified: 2021/08/23 08:37 (external edit)