+ Reply to Thread
Results 1 to 5 of 5

Thread: setup builder and Java question

  1. #1
    Join Date
    Apr 2015
    Location
    CA, Unitedd States
    Posts
    130

    Question setup builder and Java question

    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.

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: setup builder and Java question

    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/sho...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

  3. #3
    Join Date
    Apr 2015
    Location
    CA, Unitedd States
    Posts
    130

    Default Re: setup builder and Java question

    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)

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: setup builder and Java question

    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

  5. #5
    Join Date
    Apr 2015
    Location
    CA, Unitedd States
    Posts
    130

    Default Re: setup builder and Java question

    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)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •