JDK-6756264 : %APPDATA%\Sun\Java\jre1.6.0_*\lzma.dll does not get deleted
  • Type: Bug
  • Component: install
  • Sub-Component: install
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-10-06
  • Updated: 2011-02-17
  • Resolved: 2011-02-17
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.
6u18 b01Fixed 7Fixed
Install 6u10 or 6u11 Windows online JRE installer
Expect: %APPDATA%\Sun\Java\jre1.6.0_*\lzma.dll to be deleted because it is no longer needed
Actual: %APPDATA%\Sun\Java\jre1.6.0_*\lzma.dll still exists

Uninstall JRE
Expect: %APPDATA%\Sun\Java\jre1.6.0_*\ to be deleted because it is no longer needed
Actual: %APPDATA%\Sun\Java\jre1.6.0_*\lzma.dll still exists

After the wrapper is done with lzma.dll during installation, it should be deleted by the wrapper.

EVALUATION in latest build the correct behavior is happening, confirmed

EVALUATION The handle for the lzma.dll was private as there was two HMODULE definition for the same variable (extraCompLibHandle), the one that was public was initialized to null and then later when the lzma.dll was loaded, another HMODULE was defined with same name (extraCompLibHandle) so the public extraCompLibHandle was never assigned a real value of the handle of the lzma load and the method void ReleaseExtraCompression(HINSTANCE hInst) was using the public value which was initialized to null. So removing the HMODULE definition from within the method updated the public value. Also added logic to the FreeLibrary method to make sure the handle used for freeing up the lib is not null. This change is done in WrapperUtils.cpp Added another method added to RemoveFile to remove the lzma.dll as soon as its use is done. This change is done in jinstall.cpp and jinstall.h The file is not actually installed via the installer for which we use RemoveFile table so it does not make sense to add it there.

EVALUATION Pete wrote the orginal code and I brought it into the install wrappers without testing ReleaseExtraCompression().

EVALUATION After some evaluation, it is found the key issue is that the lzma.dll is loaded in jinstall and not being released properly. So, it can't be deleted. So, the fix is to modify the code logic to release the dll in all of the scenarios. Chris G. will fix it in 6u14 since he owns the original code and knows the logic better.

EVALUATION see comment by Chris