JDK-6947907 : Windows Installer removes core Java files after repair/reinstall
  • Type: Bug
  • Component: install
  • Sub-Component: install
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2010-04-28
  • Updated: 2017-08-10
  • Resolved: 2017-08-10
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode)

(Issue is also present in Update 18 and Update 19.)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Reproduced problem in a VMware Workstation 7.0.1 virtual machine running Windows XP Professional with Service Pack 3.  Issue is also evident on live workstations with Service Pack 2.

A DESCRIPTION OF THE PROBLEM :
With Java Runtime Environment Standard Edition 6.0 Update 18, Update 19, or Update 20 installed, performing a repair or reinstallation from the .msi source installation database causes the majority of the files in the JRE's program directory (%ProgramFiles%\Java, by default) to be deleted, leaving Java unusable on the workstation.  Update 17 does not exhibit this behavior, and a repair or reinstall does not delete core Java files.

The difference appears to be in the RemoveFile table ( http://msdn.microsoft.com/en-us/library/aa371201.aspx ) of the Windows Installer database file.  In Update 17, most of the rows in this table have a value of 2 (msidbRemoveFileInstallModeOnRemove) for the InstallMode column, which means the corresponding files will be deleted upon uninstall.  Since Update 18, however, almost all of the rows in this table now have a value of 3 (msidbRemoveFileInstallModeOnBoth) for the InstallMode column, which means the corresponding files will be deleted when either an uninstall or an *install* is being performed.  This explains the undesirable behavior of core Java files being deleted when a repair or reinstall is being performed.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Install Java Runtime Environment in interactive mode with a full user interface.  Note that this issue also occurs if Java is installed in unattended mode with a basic or reduced user interface.

msiexec /i jre1.6.0_20.msi /qf

2. Either reinstall Java by running the above command a second time...

msiexec /i jre1.6.0_20.msi /qf

...or repair Java with the following command...

msiexec /f jre1.6.0_20.msi



EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A fully-functional installation of Java should be present on the workstation with none of its core files having been deleted by the reinstall/repair.
ACTUAL -
If reinstalling, all of Java's program files are deleted from %ProgramFiles%\Java.
If repairing, all of Java's program files are deleted from %ProgramFiles%\Java and only the following files remain in that directory:

jre6\core.zip
jre6\patchjre.exe
jre6\zipper.exe
jre6\bin\msvcr71.dll
jre6\bin\regutils.dll
jre6\lib\ext

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Installing Java using a Windows Installer transform that changes the InstallMode for the appropriate rows in the RemoveFile table from 3 back to 2 allows for a repair or reinstall to be performed and complete as expected with no core Java files being deleted.  However, using a transform in this manner would likely cause problems with future versions or Updates of Java.

Release Regression From : 6u17
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
No plans to fix. Open a new issue against JDK >=8 or file a customer support request (SR).
10-08-2017

EVALUATION Changing the SR from product version 6u20 to 6. We have never supported these modes before, so it's not necessarily introduced with 6u20.
03-05-2010

EVALUATION Removing "regression" keyword, as repair and msi-reinstall mode have never been supported by the JRE installer.
29-04-2010

EVALUATION We do not support repair mode, nor do we support reinstall mode through directly through the msi. "reinstall" mode is supported only when launching our .exe wrapper. The fix here should be to not allow the unsupported scenario to continue if the user attempts to run this command. If in UI mode we should pop up that it's unsupported. If silent, fail silently.
28-04-2010

EVALUATION Introduced by change for 6855941
28-04-2010