Skip to content
⌘ NSIS Forum Archive

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

5 posts

heinkoi459#

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!!!
jakc#
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.
LoRd_MuldeR#
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:
Determines whether a file is an executable (.exe) file, and if so, which subsystem runs the executable file. (ANSI)


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...
heinkoi459#
Hum, can I get a little hint for How to call GetBinaryType. I did some researchs but nothing really interesting.

Thank you
LoRd_MuldeR#
Originally Posted by heinkoi459 View Post
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)