View Full Version : setup builder and Java question
lmodern1878
10-02-2015, 04:44 PM
OK here we go...
How to do the following:
1. detect if Java is installed
2. if 1 above is true, add the Java VMs path to %PATH% without disturbing anything else
3. if 1 is not true offer to install java (from an EXE included in the installer)
4. if 3 above is needed, do 3 thus making 1 above true, then do 2.
5. once all of that's done, install files based on user's selection of components. (basically proceed as normal)
A department withing my company still uses applications which require a java VM and we've lost track of which machines have it, which machines don't and on top of that, recent Java installers don't add it to the %PATH% which breaks older applications
thanks for the help in advance.
linder
10-03-2015, 11:13 AM
Hello,
You have to search the Registry to find the Java version (and to check if it is already installed). Similar to this:
http://www.lindersoft.com/forums/showthread.php?34358-JRE-Installed&p=61427&highlight=detect+java#post61427
Once you have detected the installation folder, you can use the "Edit Environment Variable" function to add the value to the &PATH% environment variable.
Hope this helps a bit.
Friedrich
lmodern1878
10-26-2015, 04:42 AM
Thanks for the reply:
I've been swamped with other projects as we can see by my other ridiculous questions here, and now I am finally circling back around to this one... I get the concept and am getting ready to implement it and now this realization just hit me: how to detect 64-bit windows? if it's a 64-bit OS check for both the 32 and 64-bit JRE, if either is found set %javahome32% and %javahome64% variables appropriately, if none is present at install time inform the user of this then offer to install both, then set the variables. If only a 32-bit OS only detect and set the variables related to 32-bit JRE completely ignoring the 64 bit related variables and JRE setup entirely.
on a slightly related note, to keep everything neat and tidy, should I include both JRE installers in my setup script as support files or how would I bundle those files into my installer for use at run time if they're not needed delete them wen the installer quits, if needed call them use them and wen the installer quits delete them (typical temp file behavior)
linder
10-26-2015, 10:35 AM
Hello,
You can use "Get System Info -> WOW64 Status" to detect 64-bit Windows operating systems. It returns "1" on x64 systems.
BTW, you can use "Set x64 Mode..." to switch into 64-bit mode to do 64-bit stuff (e.g. read 64-bit registry items).
Does this help?
Friedrich
lmodern1878
10-26-2015, 06:46 PM
thanks! I'll work on that bit project tonight. I'm technically supposed to be taking tech calls right now, so in between calls I'm replying to threads where needed (install dev is a hobby for me)
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.