JDK-7166327 : JRE uninstall does not recover jarfile reg entry on 64bit systems
  • Type: Bug
  • Component: install
  • Sub-Component: install
  • Affected Version: 6u32,7u4,7u5,8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows,windows_vista
  • CPU: x86
  • Submitted: 2012-05-03
  • Updated: 2013-06-26
  • Resolved: 2012-06-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u40Fixed 8 b45Fixed
Related Reports
Relates :  
Relates :  
Description
.jar files association does not work if 32 and 64 bit JREs were installed and then one of the JREs was uninstalled. JRE uninstall does not recover jarfile reg entry on 64bit systems.
Reg keys verification was added and 32v64Matrix tests show the following:
Install JRE 7u5 b05 32 bit + JRE 7u5 b05 64 bit, remove JRE 7u5 b05 32 bit
Keys not found:
HKEY_CLASSES_ROOT\.jar
HKEY_LOCAL_MACHINE\Software\Classes\.jar
HKEY_LOCAL_MACHINE\Software\Classes\jarfile
HKEY_LOCAL_MACHINE\Software\Classes\JNLPFile

HKEY_CLASSES_ROOT\JNLPFile
 Expected => (Default) REG_SZ JNLP File EditFlags REG_BINARY 00000100
 Actual => 
HKEY_CLASSES_ROOT\Applications\java.exe
 Expected => IsHostApp REG_SZ
 Actual => 
HKEY_LOCAL_MACHINE\Software\Classes\Applications\java.exe
 Expected => IsHostApp REG_SZ
 Actual => 
HKEY_CLASSES_ROOT\Applications\javaw.exe
 Expected => IsHostApp REG_SZ
 Actual => 
HKEY_LOCAL_MACHINE\Software\Classes\Applications\javaw.exe
 Expected => IsHostApp REG_SZ
 Actual => 

Strange values:
HKEY_CLASSES_ROOT\jarfile
 Looked for =>  Executable Jar File
 String searched .7.0_05"

Comments
EVALUATION 32-bit OS only supports 32-bit JRE. Bill suggested: if (32-bit OS) It must be 32-bit JRE, so write to HKLM/Software/Classes else //64-bit OS if (32-bit JRE) write to HKLM/software/syswow3264node/classes else //64-bit JRE write to HKLM/Software/Classes
08-05-2012

EVALUATION Just found out this may be simpler to fix than we anticipated. Apparently we should not be touching HKCR anymore, and instead be editing HKLM/Software/Classes/.jar (for 64-bit) and HKLM/Software/Wow6432Node/Classes/.jar (for 32-bit). So the fix should be to do the above and then test out the scenarios and make sure they still work.
08-05-2012

EVALUATION It's probably a good idea to create function that will fix/restore the .jar association, and things of that nature that are shared by 32/64. So it should work like this: ResolveJarAssociation(){ -Find the latest version of the JRE (32 or 64) and set the .jar association to that -If there is both a 32 and 64 of the latest version on the machine, set to the 64-bit } We can then remove the .jar file association code from RegCurrentVersion and UnregJRECurrentVersion(), and instead call this function at the end of an install and uninstall. We may want to eventually use this function to deal with what java.exe's go in what system directories, and stuff like that. See 7166597. This is out of the scope of this CR, but it should be kept in mind during development.
08-05-2012

EVALUATION The fix will be in the installer.dll (install/make/installerdll) project uninstaller code in utils.cpp: UnregJRECurrentVersion().
08-05-2012

EVALUATION This registry is shared by both 32-bit and 64-bit. To fix this, we'd need to make code changes to the uninstaller to recognize if there is a JRE of a different arch still remaining on the system. Currently 32-bit will only restore the association of other 32-bit JRE's, and 64-bit will only restore the association of 64-bit JRE's.
04-05-2012