/build/static/layout/Breadcrumb_cap_w.png

Silent install Java in multi architecture environment

I'm looking to install the lastest version of Java based on which architecture the machine has x64/x86.

I have found this article so far, and have not tested it.

http://wpkg.org/Java#Install_JRE_7_with_exe_and_msi_in_a_mixed_32-bit.2F64-bit_environment_in_one_package

Here's the section I was interested in:

Install JRE 7 with exe and msi in a mixed 32-bit/64-bit environment in one package

The intent is to have one package which installs Java for all Windows machines.

It installs :

  • i586 version of Java on 32-bit OS
  • i586 and x64 version of Java on 64-bit OS.
  • .exe on XP and lower
  • .msi on Vista and higher

This is because I've encountered some problems using the MSI with XP.

There is also a "REG" command which removes the Java AutoUpdate, a call to "C:\Program Files\Fichiers communs\Java\Java Update\jusched.exe"

<?xml version="1.0" encoding="UTF-8"?>
 
<packages>
<!-- jre install with the msi ; for 32-bit and 64-bit hosts -->
<package
 id="Java"
 name="Java(TM) 7"
 revision="%version%"
 reboot="false"
 priority="178"
 >
    <variable name="updatever" value="07" />
    <variable name="shortupdatever" value="7" />
    <variable name="version" value="7.0.%updatever%" />
    <variable name="autoupdate" value="0" />
 
    <check architecture="x86" type="file" condition="exists" path="%PROGRAMFILES%\Java\jre7\bin\java.exe" />
    <check architecture="x64" type="file" condition="exists" path="%PROGRAMFILES(X86)%\Java\jre7\bin\java.exe" />
    <check type="logical" condition="or">
        <check type="uninstall" condition="exists" path="Java 7" />
        <check type="uninstall" condition="exists" path="Java 7 Update %updatever%" />
        <check type="uninstall" condition="exists" path="Java 7 Update %shortupdatever%" />
    </check>
 
    <install cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
      <exit code='any' />
    </install>
    <!-- .exe install (XP, 2003) -->
    <install os=".+5\.[1-2]\.\d{4}"
 cmd='%SOFTWARE%\java\jre-7u%shortupdatever%-windows-i586.exe /s REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' />
    <!-- .msi (Seven) install http://wpkg.org/Java#Install_JRE_with_msi_without_removing_old_version_in_a_mixed_32-bit.2F64-bit_environment -->
    <install os=".+6\.[0-1]\.\d{4}"
 cmd='msiexec /qn /i %SOFTWARE%\java\jre1.7.0_%updatever%\jre1.7.0_%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' />
    <!-- remove Java Quick Starter -->
    <install cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister'>
      <exit code='any' />
    </install>
    <install cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" -unregister'>
      <exit code='any' />
    </install>
    <!-- remove Java Auto Update -->
    <install cmd='REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v SunJavaUpdateSched /f'>
      <exit code='any' />
    </install>
 
    <downgrade include="install" />
 
    <upgrade include="install" />
 
    <remove cmd='msiexec /qn /x {26A24AE4-039D-4CA4-87B4-2F832170%updatever%FF}' />
 
<!-- jre 64-bit install with the msi ; for 64-bit hosts only -->
    <check architecture="x64" type="file" condition="exists" path="%PROGRAMFILES%\Java\jre7\bin\java.exe" />
    <check architecture="x64" type="logical" condition="or">
        <check type="uninstall" condition="exists" path="Java 7 (64-bit)" />
        <check type="uninstall" condition="exists" path="Java 7 Update %updatever% (64-bit)" />
        <check type="uninstall" condition="exists" path="Java 7 Update %shortupdatever% (64-bit)" />
    </check>
 
    <install architecture="x64" cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
        <exit code='any' />
    </install>
    <install architecture="x64"
 cmd='msiexec /qn /i %SOFTWARE%\java\jre1.7.0_%updatever%_x64\jre1.7.0_%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1'
 />
    <!-- remove Java Quick Starter -->
     <install architecture="x64" cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister'>
      <exit code='any' />
    </install>
    <install architecture="x64" cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" -unregister'>
      <exit code='any' />
    </install>
 
    <downgrade include="install" />
 
    <upgrade include="install" />
 
    <remove architecture="x64" cmd='msiexec /qn /x {26A24AE4-039D-4CA4-87B4-2F864170%updatever%FF}' />
 
</package>
 
</packages>

Not sure if this will work with Kace or not.

 


0 Comments   [ + ] Show comments

Answers (2)

Posted by: joeostrander 11 years ago
Third Degree Blue Belt
1

I initially did what you're talking about.. but then found it worked out better for us to deploy both 32 and 64bit versions of Java to x64 systems.  On x64, some of our users use a 32bit browser and some use a 64bit browser*; having both versions of Java insures that whatever browser they use, they'd be covered.

In KACE, I set the x64 package to only deploy to x64 systems and the x86 package to deploy to both.  I use the MSI for both packages.

*Win7 has IE 32bit & IE64bit...


Comments:
  • After reading what you posted... That makes more sense. How would I go about doing this? I suppose setup a smart label based on architecture? - akilpatrick 11 years ago
    • In the software record, under Supported Operating Sytems, you can specify what OSes are approved. In this case, your default may show it OK as is, since Java 64bit won't exist on any 32bit PCs and you're OK with 32bit being on either. So then you just have to find the record for the each version, upload the MSI for each and create a Managed Install for each. Oh and if you're using labels, assign 1 label to both packages. - joeostrander 11 years ago
  • OK great! Thank you, I will try that and see. As far as the MSI goes, just extract the MSI and data.cab file, zip it, and upload to Kace?

    have you tried doing just the .EXE with the set parameters? - akilpatrick 11 years ago
Posted by: jagadeish 11 years ago
Red Belt
0

Did you try this with KACE? What are the problems you have encountered using the MSI with XP?


Comments:
  • I have not tested it yet. I will later this afternoon. - akilpatrick 11 years ago
  • We use KACE to distribute the MSI for XP 32 and Win7 64 and haven't really noticed any issues using the MSI. I should note that we are using version 6_23 of Java... so I can't speak for 7.

    Here's the command line I use:
    msiexec /i jre1.6.0_23.msi /qn IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 AUTOUPDATECHECK=0 JU=0 - joeostrander 11 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
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