JDK-8062407 : jucheck incorrectly uses cached iftw-au.exe if already present in %TEMP%
  • Type: Bug
  • Component: install
  • Sub-Component: auto_update
  • Affected Version: 8u40,8u45,9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • CPU: x86
  • Submitted: 2014-10-29
  • Updated: 2016-03-25
  • Resolved: 2015-03-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.
8u40Fixed 9Fixed
Steps to repro:

1. Install 8u31
2. AU to 8u40
3. Now AU to 8u40 NEXTBLD

jucheck seems to see that the 8u40 iftw-au.exe is already present in %TEMP%.  It does not download the NEXTBLD version (which has the same name exe).  It then expects the exe to have the NEXTBLD checksum, which is incorrect.  jucheck prompts file integrity error.  
There seems to be some caching issue with the au-iftw.exe being in the %TEMP% dir from a recent AU. One easy way to fix this would be to add the build # to the au-iftw.exe file. Though it would be good to know the real caching problem.

We are still seeing this bug with the latest 8u45-b13 PIT.

Verified in 8u40 b17 PIT

Found a bug in the code which detect if the au installer already downloaded This causes "download before Install" setting in JCP does not work The fix for the issue is: ====================== diff -r bd271d10d8e9 src/windows/wrappers/common/UpdateUtils.cpp --- a/src/windows/wrappers/common/UpdateUtils.cpp Tue Nov 11 13:54:56 2014 -0800 +++ b/src/windows/wrappers/common/UpdateUtils.cpp Thu Nov 13 19:46:48 2014 +0400 @@ -178,7 +178,9 @@ BOOL IsLocalFileDownloaded(LPSTR szLocalFile, DWORD len) { - if (!RetrieveFileFromRegistry(szLocalFile, len)) return FALSE; + if (FAILED(RetrieveFileFromRegistry(szLocalFile, len))) { + return FALSE; + } if (IsThisURL(szLocalFile)) return FALSE; // Is it already transferred, check if the szLocalFileExists HANDLE hFile = CreateFile(szLocalFile, 0, 0, NULL, OPEN_EXISTING, 0, NULL); ====================== dsbuild for the 8u40 with the fix: https://oklahoma.us.oracle.com/arc/ds_build/1.8.0_40/amenkov/2014-11-13_10-48-12/

2nd scenario (jucheck always download new .exe) breaks logic of pre-downloading of the installer (JCP -> "Update" tab -> "Notify Me" checkbox -> "before installing" option)

I cannot reproduce the issue with the latest 8u40 nightly - jre-8u40-ea-windows-au.exe is updated by jucheck and does not generate any integrity error Maybe 8u40 does not verify integrity completely (JDK-8063125), but the file is replaced (checked creation time & file version)

There are a couple ways to fix this: -jucheck should properly delete the iftw-au.exe from %TEMP% when it is done with it. This may be impossible as jucheck might not still be running at the end of the update install or -jucheck should not blindly assume that a iftw-au.exe in the %TEMP% dir is ok to use, just because it has the same name. Perhaps jucheck should just always download the new exe instead of checking to see if it's cached first.