United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7166327 : JRE uninstall does not recover jarfile reg entry on 64bit systems

Details
Type:
Bug
Submit Date:
2012-05-03
Status:
Resolved
Updated Date:
2012-10-01
Project Name:
JDK
Resolved Date:
2012-06-25
Component:
install
OS:
windows_vista,windows
Sub-Component:
install
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u32,7u4,7u5,8
Fixed Versions:

Related Reports
Backport:
Backport:
Relates:
Relates:

Sub Tasks

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

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.
                                     
2012-05-04
EVALUATION

The fix will be in the installer.dll (install/make/installerdll) project uninstaller code in utils.cpp: UnregJRECurrentVersion().
                                     
2012-05-08
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.
                                     
2012-05-08
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.
                                     
2012-05-08
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
                                     
2012-05-08



Hardware and Software, Engineered to Work Together