qzind / qz-print

Archive for legacy qz-print versions (1.8, 1.9). See https://github.com/qzind/tray for modern versions.
Other
141 stars 101 forks source link

QZTray 1.9.3 Installation stops abruptly - Windows 7 #64

Closed panoop closed 9 years ago

panoop commented 9 years ago

When i am trying to install QZTray 1.9.3 from https://qz.io/download/ on a Windows 7 64 bit OS, installation stops abruptly with the JavaHome not found error. Java 1.7.79 is installed on my machine and JAVA_HOME variable is available in PATH.

Anyone please help me here? qztray_install_error

tresf commented 9 years ago

@panoop thanks for the bug report.

I do believe that you have installed Java on your machine, but the Java 7 installer has some symptoms which are not obvious when the installation has become corrupt, this may be one of them.

Can you please re-download the offline installer for Java 7 u79 and reinstall? The installer should say that Java is already installed and it may require a reboot for proper installation. In our experience this fixes the broken Java installations about 90% of the time.

If that doesn't work, post back here and we'll try to determine how best to proceed.

Below is how we determine which version of Java is installed on your machine, if interested for debugging purposes.

We check the registry for Java here ant/windows/windows-keygen.js.in#L202 and if it cannot be detected or is too old, we can't proceed with the installation.

The script looks here to grab the current version (e.g. 1.7):

#32-bit
HKLM\Software\JavaSoft\Java Runtime Environment\CurrentVersion

#64-bit
HKLM\Software\Wow6432Node\JavaSoft\Java Runtime Environment\CurrentVersion

And then it looks in the appropriate place for the path to the Java executable.

#32-bit
HKLM\Software\JavaSoft\Java Runtime Environment\1.7\JavaHome

#64-bit
HKLM\Software\Wow6432Node\JavaSoft\Java Runtime Environment\1.7\JavaHome

If either of these keys have information that appears to be inaccurate, our installer will fail. Reinstall is the best first step.

panoop commented 9 years ago

@tresf Thanks for the quick reply.

Reinstalled and upgraded Java to 1.7.80. But still i am getting the same error. Both registry values are available in machine. As shown below installer first will complain "Java required for installation. Download now?" and when i click No option, error2 registry1 3

it shows the JavaHome Not Found error.

Registry Key screenshot attached.

Update: Just noticed that even though i installed 64 bit java on my machine, registry entries are only found for 32 bit versions i.e., HKLM\Software\JavaSoft\Java Runtime Environment\CurrentVersion and HKLM\Software\JavaSoft\Java Runtime Environment\1.7\JavaHome . Does it cause any issues?

tresf commented 9 years ago

@panoop thanks for the detailed screenshots.

Update: Just noticed that even though i installed 64 bit java on my machine, registry entries are only found for 32 bit versions i.e., HKLM\Software\JavaSoft\Java Runtime Environment\CurrentVersion and HKLM\Software\JavaSoft\Java Runtime Environment\1.7\JavaHome . Does it cause any issues?

This is a good question, I'm not sure but I'd like to reproduce what you are seeing.

@klabarge we've never tried installing Java in a non-default location. Can we verify that this configuration works? I'd prefer if we use the exact same Java and OS version as well. We have two clients that this is affecting, so there's got to be a commonality between the two that we can accommodate in our installer script.

bd0 commented 9 years ago

@tresf I was having the same issue. It seems like there is a problem with the fallback for 64-bit registry keys. Based on the behavior I was seeing I'm guessing it is only looking for keys under Wow6432Node, and never checking the related 32-bit keys. After playing around with it for a while I ended up adding the values below to the registry. After that the QZ Tray installer proceeded without issue.

As a workaround, manually create these keys or place the text below into a file named "add-java-home-64-bit.reg" or similar. I haven't tested anything beyond the installation process so proceed at your own risk.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.7"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment\1.7]
"JavaHome"="C:\\Program Files\\Java\\jre7"
tresf commented 9 years ago

@bd0, thanks for the hint.

Turns out our installer can only read the 32-bit registry by default, which completely hides the 64-bit Java installation.

This means QZ Tray install breaks if no 32-bit Java is installed.

This issue has been fixed in 806f59f

Please try the patched installer here: https://github.com/tresf/qz-print/releases/download/v1.9.3-patch2/qz-tray-1.9.3-patch2.exe

This fix will be officially available in the 1.9.4 release.

-Tres

bd0 commented 9 years ago

@tresf I removed my workaround around from the registry and ran the patched installer. It worked flawlessly. Thanks!