Messages - Krishean [ switch to compact view ]

Pages: [1] 2 3 4 5 6 ... 15next
1
Living Room / Re: Ad Industry Attacks Firefox
« on: March 27, 2013, 11:03 PM »
That's not how black holes work  :(  That's Stockholm syndrome.

2
General Software Discussion / Re: Keyboard shortcut of the day
« on: March 19, 2013, 08:49 PM »
Ctrl+Shift+T in a browser.

3
Living Room / Re: Java - Critical Patch Released
« on: February 10, 2013, 09:45 AM »
I have a batch script that attempts to purge java from your system, and cleanly install whatever version you specify, just place the scripts in the same directory as the JRE installers downloaded from here: http://www.oracle.com/technetwork/java/javase/downloads/index.html and update the variables at the top to match whatever version you are installing. This also works when installing from network shares.

install-java.bat:
Code: Text [Select]
  1. @echo off
  2. rem set product=jre6
  3. rem set version=6u39
  4. set product=jre7
  5. set version=7u13
  6. set base=%~dp0
  7. cls
  8. title Java %version% Installer
  9. set /P auth=Continue? (Y/N):
  10. if /I "%auth%" NEQ "Y" goto end
  11. cls
  12. title Removing old versions...
  13. echo Please wait...
  14. cscript /nologo "%base%remove-java.js"
  15.  
  16. ver | find "Version 6." >nul
  17. if "%errorlevel%" == "0" goto v6
  18. ver | find "Version 5." >nul
  19. if "%errorlevel%" == "0" goto v5
  20. echo Unsupported Operating System
  21. pause
  22. exit
  23. rem process folders specific to vista/7
  24. :v6
  25. if exist "%SystemDrive%\Users" (
  26.         setlocal EnableDelayedExpansion
  27.         set ProfileDir=%SystemDrive%\Users
  28.         for /f "tokens=*" %%a in ('dir /b "!ProfileDir!"') do (
  29.                 if exist "!ProfileDir!\%%a\AppData\LocalLow\Sun" (
  30.                         echo.Removing "!ProfileDir!\%%a\AppData\LocalLow\Sun"
  31.                         rmdir /s /q "!ProfileDir!\%%a\AppData\LocalLow\Sun"
  32.                 )
  33.         )
  34.         endlocal
  35. )
  36. if exist "%userprofile%\AppData\LocalLow\Sun" (
  37.         echo.Removing "%userprofile%\AppData\LocalLow\Sun"
  38.         rmdir /s /q "%userprofile%\AppData\LocalLow\Sun"
  39. )
  40. if exist "%SystemDrive%\ProgramData\Sun" (
  41.         echo.Removing "%SystemDrive%\ProgramData\Sun"
  42.         rmdir /s /q "%SystemDrive%\ProgramData\Sun"
  43. )
  44. goto common
  45. rem process folders specific to xp
  46. :v5
  47. if exist "%SystemDrive%\Documents and Settings" (
  48.         setlocal EnableDelayedExpansion
  49.         set ProfileDir=%SystemDrive%\Documents and Settings
  50.         for /f "tokens=*" %%a in ('dir /b "!ProfileDir!"') do (
  51.                 if exist "!ProfileDir!\%%a\Application Data\Sun" (
  52.                         echo.Removing "!ProfileDir!\%%a\Application Data\Sun"
  53.                         rmdir /s /q "!ProfileDir!\%%a\Application Data\Sun"
  54.                 )
  55.         )
  56.         endlocal
  57. )
  58. if exist "%userprofile%\Application Data\Sun" (
  59.         echo.Removing "%userprofile%\Application Data\Sun"
  60.         rmdir /s /q "%userprofile%\Application Data\Sun"
  61. )
  62. :common
  63. if exist "%SystemRoot%\Sun" (
  64.         echo.Removing "%SystemRoot%\Sun"
  65.         rmdir /s /q "%SystemRoot%\Sun"
  66. )
  67. set dj1=%SystemRoot%\system32\deployJava1.dll
  68. if exist "%dj1%" (
  69.         echo.Removing "%dj1%"
  70.         regsvr32 /s /u "%dj1%"
  71.         del /f /q "%dj1%"
  72. )
  73. set npdj1=%SystemRoot%\system32\npdeployJava1.dll
  74. if exist "%npdj1%" (
  75.         echo.Removing "%npdj1%"
  76.         del /f /q "%npdj1%"
  77. )
  78.  
  79. title Java %version% Installing...
  80. rem We always install the x86 version of Java. Note the order of installation. If x86 is installed before x64 some x86 apps do not work.
  81. rem This can be remedied by reinstalling the x86 version, but why encounter the problem? Just install x64 before x86 versions of Java.
  82. if "%PROCESSOR_ARCHITECTURE%"=="amd64" goto x64
  83. if "%PROCESSOR_ARCHITEW6432%"=="amd64" goto x64
  84. :x86
  85. "%base%jre-%version%-windows-i586.exe" /s REBOOT=Suppress IEXPLORER=1 MOZILLA=1
  86. goto clean
  87. :x64
  88. "%base%jre-%version%-windows-x64.exe" /s REBOOT=Suppress IEXPLORER=1 MOZILLA=1
  89. goto x86
  90. :clean
  91. title Cleaning up...
  92. rem remove Java Quick Starter
  93. rem sc stop JavaQuickStarterService
  94. rem sc delete JavaQuickStarterService
  95. net stop JavaQuickStarterService
  96. if exist "%ProgramFiles%\Java\%product%\bin\jqs.exe" "%ProgramFiles%\Java\%product%\bin\jqs.exe" -unregister
  97. if exist "%ProgramFiles(x86)%\Java\%product%\bin\jqs.exe" "%ProgramFiles(x86)%\Java\%product%\bin\jqs.exe" -unregister
  98. rem Remove Java Auto Updater software
  99. msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}
  100. title Java %version% Installed.
  101. pause
  102. :end
  103. @exit

and the accompanying javascript, remove-java.js:
Code: Javascript [Select]
  1. function echo(a){return WScript.Echo(a);}
  2. function exit(a){return WScript.Quit(a);}
  3.  
  4. var Registry=(function(){
  5.        
  6. //      this.HKEY_CLASSES_ROOT          = 0x80000000;
  7. //      this.HKEY_CURRENT_USER          = 0x80000001;
  8.         this.HKEY_LOCAL_MACHINE         = 0x80000002;
  9. //      this.HKEY_USERS                 = 0x80000003;
  10. //      this.HKEY_CURRENT_CONFIG        = 0x80000005;
  11.        
  12. //      this.Types = new Array(
  13. //          '                              ',    // 0
  14. //          'REG_SZ                        ',    // 1
  15. //          'REG_EXPAND_SZ                 ',    // 2
  16. //          'REG_BINARY                    ',    // 3
  17. //          'REG_DWORD                     ',    // 4
  18. //          'REG_DWORD_BIG_ENDIAN          ',    // 5
  19. //          'REG_LINK                      ',    // 6
  20. //          'REG_MULTI_SZ                  ',    // 7
  21. //          'REG_RESOURCE_LIST             ',    // 8
  22. //          'REG_FULL_RESOURCE_DESCRIPTOR  ',    // 9
  23. //          'REG_RESOURCE_REQUIREMENTS_LIST',    // 10
  24. //          'REG_QWORD                    ');    // 11
  25.        
  26.         this.oRegistry=GetObject('winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\default:StdRegProv');
  27.         this.Exec=function(method,hkey,sRegPath,sValueName){
  28.                 var oMethod = this.oRegistry.Methods_(method);
  29.                 var oInParam = oMethod.InParameters.SpawnInstance_();
  30.                 oInParam.hDefKey = hkey;
  31.                 oInParam.sSubKeyName = sRegPath;
  32.                 if(sValueName != null)oInParam.sValueName = sValueName;
  33.                 return this.oRegistry.ExecMethod_(oMethod.Name, oInParam);
  34.         };
  35.         this.EnumKey=function(sRegPath){
  36.                 var oOutParam = this.Exec('EnumKey', this.HKEY_LOCAL_MACHINE, sRegPath);
  37.                 return oOutParam.sNames.toArray();
  38.         };
  39.         this.EnumValues=function(sRegPath){
  40.                 var oOutParam = this.Exec('EnumValues', this.HKEY_LOCAL_MACHINE, sRegPath);
  41.                 var aNames = oOutParam.sNames.toArray();
  42.                 var aTypes = oOutParam.Types.toArray();
  43.                 var ret=[];
  44.                 for(var i=0;i<aNames.length;i++){
  45.                         ret.push({'Name': aNames[i], 'Type': aTypes[i]});
  46.                 }
  47.                 return ret;
  48.         };
  49. //      this.GetDWORDValue=function(sRegPath,sValueName){
  50. //              var oOutParam = this.Exec('GetDWORDValue', this.HKEY_LOCAL_MACHINE, sRegPath, sValueName);
  51. //              return oOutParam.uValue;
  52. //      };
  53. //      this.GetExpandedStringValue=function(sRegPath,sValueName){
  54. //              var oOutParam = this.Exec('GetExpandedStringValue', this.HKEY_LOCAL_MACHINE, sRegPath, sValueName);
  55. //              return oOutParam.sValue;
  56. //      };
  57.         this.GetStringValue=function(sRegPath,sValueName){
  58.                 var oOutParam = this.Exec('GetStringValue', this.HKEY_LOCAL_MACHINE, sRegPath, sValueName);
  59.                 return oOutParam.sValue;
  60.         };
  61.         return this;
  62. })();
  63.  
  64. exit(main());
  65. function main(){
  66.        
  67.         var wshell=WScript.CreateObject('WScript.Shell');
  68.        
  69.         //echo(Registry.EnumKey(sRegPath).join('\n'));
  70.        
  71.         var sRegPath = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall';
  72.         try{
  73.                 var items = Registry.EnumKey(sRegPath);
  74.         }catch(err){
  75.                 var items = [];
  76.         }
  77.         for(var i=0;i<items.length;i++){
  78.                 //echo(items[i]);
  79.                 try{
  80.                         var props = Registry.EnumValues(sRegPath+'\\'+items[i]);
  81.                 }catch(err){
  82.                         var props = [];
  83.                 }
  84.                 for(var j=0;j<props.length;j++){
  85.                         if(props[j].Name == 'DisplayName'){
  86.                                 var value = Registry.GetStringValue(sRegPath+'\\'+items[i], props[j].Name);
  87.                                 // jre6 and jre7, older versions have to be manually dealt with
  88.                                 if((/^Java(\(TM\))? \d( Update \d+)?$/).test(value)){
  89.                                         wshell.Run('msiexec /qn /norestart /x '+items[i],0,true);
  90.                                 }
  91.                         }
  92.                        
  93.                         /*var v=props[j].Type;
  94.                         switch(props[j].Type){
  95.                                 case 1:
  96.                                         v=Registry.GetStringValue(sRegPath+'\\'+items[i],props[j].Name);
  97.                                         break;
  98.                                 case 2:
  99.                                         v=Registry.GetExpandedStringValue(sRegPath+'\\'+items[i],props[j].Name);
  100.                                         break;
  101.                                 case 4:
  102.                                         v=Registry.GetDWORDValue(sRegPath+'\\'+items[i],props[j].Name);
  103.                                         break;
  104.                                 default:break;
  105.                         }
  106.                         //echo('\t'+props[j].Name + ': ' + v);
  107.                        
  108.                         if(props[j].Name == 'DisplayName' && typeof(v)=='string' &&
  109.                             // jre6 and jre7, older versions have to be manually dealt with
  110.                             (/^Java\(TM\) \d( Update \d+)?$/).test(v)){
  111.                                 echo('msiexec /qn /norestart /x '+items[i]);
  112.                         }*/
  113.                 }
  114.                
  115.         }
  116.        
  117.         // handle 32-bit software installed on a 64-bit system
  118.         var sRegPath = 'SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall';
  119.         try{
  120.                 var items = Registry.EnumKey(sRegPath);
  121.         }catch(err){
  122.                 var items = [];
  123.         }
  124.         for(var i=0;i<items.length;i++){
  125.                 try{
  126.                         var props = Registry.EnumValues(sRegPath+'\\'+items[i]);
  127.                 }catch(err){
  128.                         var props = [];
  129.                 }
  130.                 for(var j=0;j<props.length;j++){
  131.                         if(props[j].Name == 'DisplayName'){
  132.                                 var value = Registry.GetStringValue(sRegPath+'\\'+items[i], props[j].Name);
  133.                                 // jre6 and jre7, older versions have to be manually dealt with
  134.                                 if((/^Java\(TM\) \d( Update \d+)?$/).test(value)){
  135.                                         wshell.Run('msiexec /qn /norestart /x '+items[i],0,true);
  136.                                 }
  137.                         }
  138.                 }
  139.         }
  140.        
  141.         return 0;
  142.        
  143. //      var wmi=GetObject('winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2');
  144. //      var query='SELECT * FROM Win32_Product';
  145. //      //var query='SELECT * FROM Win32_PhysicalMemory';
  146. //      var en=new Enumerator(wmi.ExecQuery(query));
  147. //      for(en.moveFirst();!en.atEnd();en.moveNext()){
  148. //              var itm = en.item();
  149. //              echo('Name: '+itm.Name);
  150. //              /*var props = new Enumerator(itm.Properties_);
  151. //              for(props.moveFirst();!props.atEnd();props.moveNext()){
  152. //                      var p = props.item();
  153. //                      echo(p.Name + ': ' + p.Value);
  154. //              }*/
  155. //      }
  156. //      return 0;
  157. }

4
Living Room / Re: Java - Critical Patch Released
« on: February 10, 2013, 09:34 AM »
DO NOT USE JavaRa it will break JavaScript in IE (and any embedded browsers that applications use) by deleting registry keys unrelated to Java. It goes after some of the things in the registry that just have java in the name, but are actually part of JavaScript. I found this out the hard way. the specific keys are:

HKCR\JavaScript
HKCR\JavaScript Author
HKCR\JavaScript1.1
HKCR\JavaScript1.1 Author
HKCR\JavaScript1.2
HKCR\JavaScript1.2 Author

Looks like this has been fixed since then: http://forums.lunarsoft.net/topic/4984-major-bug-in-javara-116-now-fixed/

5
Living Room / Re: Java's Deceptive Installation
« on: January 22, 2013, 10:25 PM »
Just install the developer version! No crap in there~! :D

No automatic updates there either, unfortunately.

Pages: [1] 2 3 4 5 6 ... 15next
Go to full version