Solved

determine java version for windows installer

Posted on 2013-05-18
4
442 Views
Last Modified: 2013-05-18
I am building a windows installer program.  I need to know the java version so I can load the correct jni.h in the project.  I cannot use a command window, I need to do it in code.  Any ideas?
0
Comment
Question by:dhenderson12
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
phoenix5ire earned 500 total points
ID: 39177451
0
 

Author Comment

by:dhenderson12
ID: 39177543
thanks, that helped a lot and you get the points.  I a followup question, if you don't mind:
The programs that the installer handles all make reference to the jni.h file (and some other java header files as well).  Now that I know the path to, and current version of, java I can build the individual programs and the installer.  But what happens when java update occurs? do I need to re-build the release again, or is there a way to have an include statement that will read an external value and act accordingly?
0
 
LVL 3

Expert Comment

by:phoenix5ire
ID: 39177592
Thanks for the points. :)
To answer your question(s), I'm assuming Java is require to run your program. Once Java is installed, it has an option to auto-check/update on the computer that it is installed. This update check is independent of your program.

Regarding your 2nd question about recompiling a new release because of new Java version, if I understand your question correctly. If the (intent) code is to check/verify the installed Java version on the local machine, the Java registry key is static in Windows machine, I would continue to use the same key for the installer to check/verify the version of Java. Each time your program is install, the verification will check the same registry key and if the require Java version is met, your program installs, if not, it should prompt the user (installer) to download the current Java version before proceeding, the Java download URL is static for the most part, URL is: http://java.com/en/download/index.jsp
 
Let me know if this answer your questions.

Thanks.
0
 

Author Comment

by:dhenderson12
ID: 39177597
sort of ... I guess it depends on whether or not java plays nice with future versions on the client machine ie.: i build with 1.7.0_6 and the client has 1.7.0_12 (or vice versa).  Thanks, I have more research to do.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question