/build/static/layout/Breadcrumb_cap_w.png

Search for Java_home as dependancy

I have a SAP application that requires Java. As usual it came as a .exe so I've done a snapshot of the SAP install into MSI. During installation it does a check for Java and stores the "Java Home" folder (c:\programfiles\java\jre6 ect) it detects in the configuration file to run SAP. The SAP configuration file post install/snapshot specifies the Java version I had on the snapshot machine.

eg:
@echo off
set JAVA_HOME=C:\Program Files\Java\jre6
set JAVA=%JAVA_HOME%\bin\java.exe

I need the MSI to somehow to detect java version on install pc. I would like to use the JAVA_HOME variable but its not actually in the SET list.

Any ideas?

0 Comments   [ + ] Show comments

Answers (11)

Posted by: icbrkr 13 years ago
Senior Yellow Belt
0
SAP has a great util built-in to make it silent install (\setup\NwSapSetupAdmin.exe) and install future patches, etc. I'm not sure repackaging it into an MSI would be worthwhile.
Posted by: Micka007 13 years ago
Orange Belt
0
We have both business and technical reasons why it needs to be MSI. Standard packaging format in this company is MSI, plus we are using ZCM and decided to use its content repository which it doesn't handle non-msi very well.

So need to get the discover java version somehow into the MSI.
Posted by: dunnpy 13 years ago
Red Belt
0
You could decide on a version of Java to go with SAP and deploy together - thus negating the need to search for the specific version as you control the installation of both and define the paths for the correct Java version.

The other option would be use a System Search within your MSI to find the Java path (either from a file path or a key in the registry) and store them as a public property which you could then use to write back to the configuration file as necessary.

Hope that points you in the right direction,

Dunnpy
Posted by: anonymous_9363 13 years ago
Red Belt
0
The problem with AppSearch for JRE in this case is that there is no central place that one can use to divine the path without parsing the resulting data or walking a registry branch. For example, the path for 1.6 is held in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6\JavaHome. Equally, you might think you could search for JAVAW.EXE. You can, but it's in 'C:\Program Files\Java\jre6\bin'.

Either way, to populate the file location which the OP wants requires stripping out unwanted data.
Posted by: Micka007 13 years ago
Orange Belt
0
That is how I currently have it packaged but the problem is if I update Java (which happens frequently) I will need to redo SAP.

The other option would be good but how do I get this to work for future versions of java?
Posted by: dunnpy 13 years ago
Red Belt
0
But if you release an updated Java to your environment the previous version that SAP is configured to use will still there and availabe, as Java versions sit 'side-by-side'.
Posted by: Micka007 13 years ago
Orange Belt
0
VBScab - Do you know how the SAP.exe would of performed this search as it does what I need to. It auto detects the version of java installed somehow and configures that java folder path.
Posted by: Micka007 13 years ago
Orange Belt
0
We don't want multiple versions of Java on a pc as it has conflict issues within some applications. We do an upgrade/uninstall of previous versions when a new release is pushed into production so we can maintain a standard version.
Posted by: anonymous_9363 13 years ago
Red Belt
0
Do you know how the SAP.exe would [of] have performed this searchNo, I'm afraid I don't but almost certainly one (or both) of the methods I outlined. You could build a script and have it set a property which your package could then use. There are many, many examples of folder-walking scripts around. Use one of those, add the property-setting code to it and include it as a Custom Action in your MSI.
Posted by: Micka007 13 years ago
Orange Belt
0
Please forgive, I'm not that great at scripting. I was thinking of using the following which lists JavaHome and other keys/values but how do I extract the value for JavaHome? or can I do a search specifically for the JavaHome value without knowing the complete path?

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" /s
Posted by: anonymous_9363 13 years ago
Red Belt
0
how do I extract the value for JavaHome? or can I do a search specifically for the JavaHome value without knowing the complete path? That was kind of my point.

Forget the registry for now. The scripts I've found for walking registry keys are, on the whole, to be avoided. I use the cRegistry class from JSWare in my scripts but that's a bit scary for newcomers.

Find a script that walks a folder to find a file. In your case, that file will be JAVAW.EXE. Trap the name of the containing folder, then use the .ParentFolder property to get the name of the folder one level up. Then use Session.Property to set the value of your public property. Then use THAT property to set whatever configuration the app requires.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ