UninstallJRE() and UninstallJavaRegSet() now passed a variable so it knows whether its called during JRE uninstall, JRE install, or JDK uninstall.
MSIInstallJRE() calls UninstallJRE() with DURING_JRE_INSTALL.
MSIUninstallJRE() calls UninstallJRE() with DURING_JRE_UNINSTALL.
MSIUninstallSDK() calls UninstallJavaRegSet() with DURING_JDK_UNINSTALL.
Only call RemoveInstalledFiles() when DURING_JRE_UNINSTALL.
I've seen tests where msvcr71.dll could not be deleted by RemoveInstalledFiles() without sleeping 3 seconds after UninstallJQS() was called.
Added logic to sleep and retry RemoveInstalledFiles() for up to 6 seconds before leaving the file and continuing on.
java_install_reg.log may contain:
-- Start in UninstallJavaRegSet --
Service stopped successfully
JQS unregistered OK.
-- RemoveInstalledFiles: DeleteFile(C:\Program Files\Java\jre6\bin\msvcr71.dll) failed. (GetLastError=5)
-- Retrying RemoveInstalledFiles
-- End in UninstallJavaRegSet --