User Tools

Site Tools


userspace:etu_javavm

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
userspace:etu_javavm [2015/03/30 21:38]
Robert Tauber [uninstall.ins]
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 481: Line 527:
  
 ==== deljvm.ins ==== ==== deljvm.ins ====
 +erlaubt es die subdeljava. als uninstall aufzurufen
 <code winst> <code winst>
 ; Copyright (c) uib gmbh (www.uib.de) ; Copyright (c) uib gmbh (www.uib.de)
Line 503: Line 550:
 </code> </code>
  
 +==== subdeljava ====
 +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.
 +<code winst>
 +; 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
 +
 +
 +
 +;RT: Runter mit Java das AutoIt Skript killt alle Java versionen
 +[Winbatch_deinstall]
 +%SCRIPTPATH%\Uninstall_Java.exe
 +
 +;RT: Killt den Shot key im Startmenü konte keinen finden
 +[LinkFolder_Webstart_delete]
 +set_basefolder common_programs
 +delete_subfolder "Java"
 +delete_subfolder "Java Web Start"
 +
 +;RT: Exit cod Checken
 +[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>
 +
 +==== Uninstall_Java.exe / Uninstall_Java.au3 ====
 +SAD (search and destroy) Skript<\\
 +<code autoit>
 +#cs ----------------------------------------------------------------------------
 +
 + AutoIt Version: 3.3.8.1
 + Author:         Robert Tauber
 +
 + Script Function:
 + Deinstalirt alle Java Versionen
 +
 +#ce ----------------------------------------------------------------------------
 +
 +; Script Start - Add your code below here
 +
 +DirCreate("c:\temp\")
 +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")
 +
 +;Filter die keys mit {}
 +Run(@ComSpec & " /c " & 'type c:\temp\registry.tmp | find /i "{" | find /i "}]" > c:\temp\REG.tmp' ,"", @SW_HIDE)
 +Run(@ComSpec & " /c " & 'type c:\temp\registry2.tmp | find /i "{" | find /i "}]" >> c:\temp\REG.tmp' ,"", @SW_HIDE)
 +
 +
 +;winwait ("cmd.exe")
 +WinWaitClose ("cmd.exe")
 +
 +$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 )
 +
 +
 +
 +;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>
  
userspace/etu_javavm.1427751488.txt.gz · Last modified: 2021/08/23 08:37 (external edit)