Archive: Which JRE Architecture is install (32-bit or 64 bit)


Which JRE Architecture is install (32-bit or 64 bit)
Hi, how can I determine the JRE build architecture (32bit / 64bit) in my NSIS installation???

Thank you!!!


I cannot help, but assume your question is the very same one I have?
- I need to determine if the host machine that the installer being run on, has either a 32 or 64 bit JRE.


First of all you have the problem that several JRE's might be installed.

Check this reg key:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment

It has a sub-key for each JRE installed. And in each sub-folder there is "JavaHome", which gives you the individual install folder of the JRE.

You can then simply check the bitness of "%JavaHome%\bin\java.exe", I guess ;)

Look at GetBinaryType() for details:
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

How you call that function from NSIS (e.g. via System plug-in) is another topic. Also note that it needs Windows XP or later...


Hum, can I get a little hint for How to call GetBinaryType. I did some researchs but nothing really interesting.

Thank you


Originally posted by heinkoi459
Hum, can I get a little hint for How to call GetBinaryType. I did some researchs but nothing really interesting.

Thank you
What do you need to know?

I think the MSDN documentation that I pointed to explains the function in detail. Now you just need to call it via NSIS' System plug-in or create a simple plug-in wrapper around the function...

(Docs for the System plug-in are available. The same goes for the NSIS plug-in SDK)