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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 12/13/2010 by: icbrkr
Senior Yellow Belt

Please log in to comment
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.
Answered 12/13/2010 by: Micka007
Orange Belt

Please log in to comment
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
Answered 12/13/2010 by: dunnpy
Red Belt

Please log in to comment
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.
Answered 12/13/2010 by: VBScab
Red Belt

Please log in to comment
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?
Answered 12/14/2010 by: Micka007
Orange Belt

Please log in to comment
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'.
Answered 12/14/2010 by: dunnpy
Red Belt

Please log in to comment
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.
Answered 12/14/2010 by: Micka007
Orange Belt

Please log in to comment
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.
Answered 12/14/2010 by: Micka007
Orange Belt

Please log in to comment
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.
Answered 12/14/2010 by: VBScab
Red Belt

Please log in to comment
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
Answered 12/14/2010 by: Micka007
Orange Belt

Please log in to comment
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.
Answered 12/14/2010 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity