Kaseya Community

Java 6 Update 20 - Single Procedure for 32-bit and 64-bit OS

  • thirteentwenty
    I have a update 21 script!


    can you share? i'd really like to deploy this.

    Legacy Forum Name: Kaseya2 Scripts,
    Legacy Posted By Username: jwible
  • Too long for a single post sorry

    <?xml version="1.0" encoding="utf-8"?>
    <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">
      <Procedure name="Java 6 Update 21 32 and 64 Bit" treePres="3">
        <Body description="Install Java 6 Update 20 for both 32 and 64 bit Windows Operating Systems.&#xA;&#xA;Finally got 32-bit Java installing on a 64-bit OS with no special MSI! &#xA;&#xA;If you are not a direct Kaseya partner, please keep reference to the original author and/or source if you take a procedure or unique methodology as-is.&#xA;&#xA;Benjamin Lavalley, Sr. Product Marketing Manager, Kaseya&#xA;benjamin.lavalley@kaseya.com">
          <If description="">
            <Condition name="CheckRegistryValue">
              <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\Identifier" />
              <Parameter xsi:type="EnumParameter" name="Condition" value="Contains" />
              <Parameter xsi:type="StringParameter" name="Value" value="64" />
            </Condition>
            <Then>
              <If description="">
                <Condition name="TestRegistryKey64">
                  <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_21" />
                  <Parameter xsi:type="EnumParameter" name="Condition" value="NotExists" />
                </Condition>
                <Then>
                  <Statement description="" name="ExecuteShellCommand" continueOnFail="false">
                    <Parameter xsi:type="StringParameter" name="Command" value="echo 64updateneeded &gt;&gt; #vagentconfiguration.agenttempdir#\updateneeded" />
                    <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                    <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                  </Statement>
                </Then>
              </If>
              <If description="">
                <Condition name="TestRegistryKey">
                  <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\wow6432node\JavaSoft\Java Runtime Environment\1.6.0_21" />
                  <Parameter xsi:type="EnumParameter" name="Condition" value="NotExists" />
                </Condition>
                <Then>
                  <Statement description="" name="ExecuteShellCommand" continueOnFail="false">
                    <Parameter xsi:type="StringParameter" name="Command" value="echo bothupdateneeded &gt;&gt;&gt;&gt; #vagentconfiguration.agenttempdir#\updateneeded" />
                    <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                    <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                  </Statement>
                </Then>
              </If>
            </Then>
            <Else>
              <If description="">
                <Condition name="TestRegistryKey">
                  <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_21" />
                  <Parameter xsi:type="EnumParameter" name="Condition" value="NotExists" />
                </Condition>
                <Then>
                  <Statement description="" name="ExecuteShellCommand" continueOnFail="false">
                    <Parameter xsi:type="StringParameter" name="Command" value="echo 32updateneeded &gt;&gt; #vagentconfiguration.agenttempdir#\updateneeded" />
                    <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                    <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                  </Statement>
                </Then>
              </If>
            </Else>
          </If>
          <If description="Install Java 6 Update 15  Benjamin Lavalley, Sr. Sales Engineer, Kaseya benjamin.lavalley@kaseya.com">
            <Condition name="TestFile">
              <Parameter xsi:type="StringParameter" name="Path" value="#vagentconfiguration.agenttempdir#\updateneeded" />
              <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" />
              <Parameter xsi:type="StringParameter" name="Value" value="" />
            </Condition>
            <Then>
              <If description="">
                <Condition name="CheckVariable">
                  <Parameter xsi:type="StringParameter" name="VariableName" value="#vagentlabel.online#" />
                  <Parameter xsi:type="EnumParameter" name="Condition" value="Equals" />
                  <Parameter xsi:type="StringParameter" name="Value" value="1" />
                </Condition>
                <Then>
                  <If description="">
                    <Condition name="UserResponseIsYes">
                      <Parameter xsi:type="StringParameter" name="Message" value="Java needs to be updated on your machine. Continue?" />
                      <Parameter xsi:type="IntegerParameter" name="Timeout" value="1" />
                    </Condition>
                    <Then>
                      <Statement description="" name="WriteScriptLogEntry" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="Comment" value="User Approved" />
                      </Statement>
                      <Statement description="" name="ExecuteShellCommand" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="Command" value="echo continue &gt;&gt; #vagentconfiguration.agenttempdir#\continue" />
                        <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                        <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                      </Statement>
                    </Then>
                    <Else>
                      <Statement description="" name="WriteScriptLogEntry">
                        <Parameter xsi:type="StringParameter" name="Comment" value="User Denied" />
                      </Statement>
                    </Else>
                  </If>
                </Then>
                <Else>
                  <Statement description="" name="ExecuteShellCommand">
                    <Parameter xsi:type="StringParameter" name="Command" value="echo continue &gt;&gt; #vagentconfiguration.agenttempdir#\continue" />
                    <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                    <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                  </Statement>
                </Else>
              </If>
              <If description="">
                <Condition name="TestFile">
                  <Parameter xsi:type="StringParameter" name="Path" value="#vagentconfiguration.agenttempdir#\continue" />
                  <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" />
                  <Parameter xsi:type="StringParameter" name="Value" value="" />
                </Condition>
                <Then>
                  <Statement description="" name="GetVariable" continueOnFail="false">
                    <Parameter xsi:type="EnumParameter" name="VariableType" value="FileContent" />
                    <Parameter xsi:type="StringParameter" name="SourceContent" value="#vagentconfiguration.agenttempdir#\updateneeded" />
                    <Parameter xsi:type="StringParameter" name="VariableName" value="updateneeded" />
                  </Statement>
                  <Statement description="" name="CloseApplication" continueOnFail="false" osType="Windows">
                    <Parameter xsi:type="StringParameter" name="ApplicationName" value="safari.exe" />
                  </Statement>
                  <Statement description="" name="CloseApplication" continueOnFail="false" osType="Windows">
                    <Parameter xsi:type="StringParameter" name="ApplicationName" value="firefox.exe" />
                  </Statement>
                  <Statement description="" name="CloseApplication" continueOnFail="false" osType="Windows">
                    <Parameter xsi:type="StringParameter" name="ApplicationName" value="opera.exe" />
                  </Statement>
                  <Statement description="" name="CloseApplication" continueOnFail="false" osType="Windows">
                    <Parameter xsi:type="StringParameter" name="ApplicationName" value="iexplore.exe" />
                  </Statement>
    


    Legacy Forum Name: Kaseya2 Scripts,
    Legacy Posted By Username: thirteentwenty



    [edited by: Brendan Cosgrove at 5:51 PM (GMT -8) on 12-20-2010] .
  •               <If description="">
                    <Condition name="CheckVariable">
                      <Parameter xsi:type="StringParameter" name="VariableName" value="#updateneeded#" />
                      <Parameter xsi:type="EnumParameter" name="Condition" value="Contains" />
                      <Parameter xsi:type="StringParameter" name="Value" value="64updateneeded" />
                    </Condition>
                    <Then>
                      <Statement description="" name="GetURL" continueOnFail="false" osType="Windows">
                        <Parameter xsi:type="StringParameter" name="URL" value="http://javadl.sun.com/webapps/download/AutoDL?BundleId=41293" />
                        <Parameter xsi:type="StringParameter" name="ResponseFileName" value="#vAgentConfiguration.AgentTempDir#\jre-6u21-windows-x64.exe" />
                        <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" />
                      </Statement>
                      <Statement description="" name="ExecuteShellCommand" continueOnFail="false" osType="Windows">
                        <Parameter xsi:type="StringParameter" name="Command" value="&quot;#vAgentConfiguration.AgentTempDir#\jre-6u21-windows-x64.exe&quot; /s IEXPLORER=1 MOZILLA=1 ADDLOCAL=ALL REBOOT=Suppress JAVAUPDATE=0 JU=0 AUTOUPDATECHECK=0" />
                        <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                        <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                      </Statement>
                      <Statement description="" name="WriteScriptLogEntry" continueOnFail="false" osType="Windows">
                        <Parameter xsi:type="StringParameter" name="Comment" value="64-bit Java 6 Update 21 installed for 64-bit OS" />
                      </Statement>
                      <Statement description="" name="DeleteFile" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="Path" value="&quot;#vAgentConfiguration.AgentTempDir#\jre-6u21-windows-x64.exe&quot;" />
                      </Statement>
                    </Then>
                  </If>
                  <If description="">
                    <Condition name="CheckVariable">
                      <Parameter xsi:type="StringParameter" name="VariableName" value="#updateneeded#" />
                      <Parameter xsi:type="EnumParameter" name="Condition" value="Contains" />
                      <Parameter xsi:type="StringParameter" name="Value" value="32updateneeded" />
                    </Condition>
                    <Then>
                      <Statement description="" name="GetURL" continueOnFail="false" osType="Windows">
                        <Parameter xsi:type="StringParameter" name="URL" value="http://javadl.sun.com/webapps/download/AutoDL?BundleId=41290" />
                        <Parameter xsi:type="StringParameter" name="ResponseFileName" value="#vAgentConfiguration.AgentTempDir#\jre-6u21-windows-i586-s.exe" />
                        <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" />
                      </Statement>
                      <Statement description="" name="ExecuteShellCommand" continueOnFail="false" osType="Windows">
                        <Parameter xsi:type="StringParameter" name="Command" value="&quot;#vAgentConfiguration.AgentTempDir#\jre-6u21-windows-i586-s.exe&quot; /s IEXPLORER=1 MOZILLA=1 ADDLOCAL=ALL REBOOT=Suppress JAVAUPDATE=0 JU=0 AUTOUPDATECHECK=0" />
                        <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                        <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
                      </Statement>
                      <Statement description="" name="WriteScriptLogEntry" continueOnFail="false" osType="Windows">
                        <Parameter xsi:type="StringParameter" name="Comment" value="32-bit Java 6 Update 21 installed for 32-bit OS" />
                      </Statement>
                      <Statement description="" name="DeleteFile" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="Path" value="&quot;#vAgentConfiguration.AgentTempDir#\jre-6u21-windows-i586-s.exe&quot;" />
                      </Statement>
                    </Then>
                  </If>
                  <If description="">
                    <Condition name="CheckVariable">
                      <Parameter xsi:type="StringParameter" name="VariableName" value="#updateneeded#" />
                      <Parameter xsi:type="EnumParameter" name="Condition" value="Contains" />
                      <Parameter xsi:type="StringParameter" name="Value" value="bothupdateneeded" />
                    </Condition>
                    <Then>
                      <Statement description="" name="GetURL" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="URL" value="http://javadl.sun.com/webapps/download/AutoDL?BundleId=41290" />
                        <Parameter xsi:type="StringParameter" name="ResponseFileName" value="#vAgentConfiguration.AgentTempDir#\jre-6u21-windows-i586-s.exe" />
                        <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" />
                      </Statement>
                      <Statement description="" name="SetRegistryValue" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-18\ProfileImagePath" />
                        <Parameter xsi:type="StringParameter" name="Value" value="%systemroot%\syswow64\config\systemprofile" />
                        <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
                      </Statement>
                      <Statement description="" name="ExecuteShellCommand" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="Command" value="&quot;#vAgentConfiguration.AgentTempDir#\jre-6u21-windows-i586-s.exe&quot; /s IEXPLORER=1 MOZILLA=1 ADDLOCAL=ALL REBOOT=Suppress JAVAUPDATE=0 JU=0 AUTOUPDATECHECK=0" />
                        <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />
                        <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="True" />
                      </Statement>
                      <Statement description="" name="SetRegistryValue" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-18\ProfileImagePath" />
                        <Parameter xsi:type="StringParameter" name="Value" value="%systemroot%\system32\config\systemprofile" />
                        <Parameter xsi:type="EnumParameter" name="DataType" value="String" />
                      </Statement>
                      <Statement description="" name="WriteScriptLogEntry" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="Comment" value="32-bit Java installed for 64-bit OS" />
                      </Statement>
                      <Statement description="" name="DeleteFile" continueOnFail="false">
                        <Parameter xsi:type="StringParameter" name="Path" value="&quot;#vAgentConfiguration.AgentTempDir#\jre-6u21-windows-i586-s.exe&quot;" />
                      </Statement>
                    </Then>
                  </If>
                  <Statement description="" name="DeleteFile" continueOnFail="true">
                    <Parameter xsi:type="StringParameter" name="Path" value="#vagentconfiguration.agenttempdir#\continue" />
                  </Statement>
                  <Statement description="" name="DeleteFile" continueOnFail="false">
                    <Parameter xsi:type="StringParameter" name="Path" value="#vagentconfiguration.agenttempdir#\updateneeded" />
                  </Statement>
                </Then>
                <Else>
                  <Statement description="" name="WriteScriptLogEntry" osType="Windows">
                    <Parameter xsi:type="StringParameter" name="Comment" value="Java Update denied. " />
                  </Statement>
                  <Statement description="" name="ScheduleScript">
                    <Parameter xsi:type="StringParameter" name="TimeDelay" value="60" />
                    <Parameter xsi:type="StringParameter" name="MachineID" value="#vagentconfiguration.Machine_GroupID#" />
                  </Statement>
                </Else>
              </If>
            </Then>
            <Else>
              <Statement description="" name="DeleteFile">
                <Parameter xsi:type="StringParameter" name="Path" value="#vagentconfiguration.agenttempdir#\updateneeded" />
              </Statement>
              <Statement description="" name="WriteScriptLogEntry" osType="Windows">
                <Parameter xsi:type="StringParameter" name="Comment" value="Java 6 update 21 already installed." />
              </Statement>
            </Else>
          </If>
        </Body>
      </Procedure>
    </ScriptExport>
    Sorry, been busy feeding on the new forums... I prefer it here

    Legacy Forum Name: Kaseya2 Scripts,
    Legacy Posted By Username: thirteentwenty



    [edited by: Brendan Cosgrove at 5:52 PM (GMT -8) on 12-20-2010] .