Kaseya Community

Writing a procedure to silently install/update Java with no UAC prompts

This question is answered

First off I would like to say that I am aware of the software deployment module, however my company is interested in trying procedures before adding another monthly expense

I have proedures in place for flash and reader, and simply by executing on system account I was able to get around UAC with those. However, Java appears to not want to install via system account, so we tried a convoluted procedure to check for UAC registry keys, store them, delete them, install java, then reinstate the UAC registry keys. My partner was working on it so I don't know the details but it didnt end up working and exhibited very strange functionality on some systems that  have had UAC turned off (which led me to think maybe we forgot a registry key)

At any rate, I feel this is something that had to have already been done by now, if someone has some insight it would be appreciated.

Thanks!

Verified Answer
  • run ninite in the background to update java everywhere, in this case to 7 u11. Steps:

    download java installer from ninite

    upload to shared script files

    run the script below

    done

    <?xml version="1.0" encoding="UTF-8"?>

    -<ScriptExport xmlns="www.kaseya.com/.../Scripting" xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:xsi="www.w3.org/.../XMLSchema-instance"> -<Procedure folderId="31892457818424963153853212" id="1827261028" treePres="3" name="install or update java"> -<Body description="install or update java using ninite"> -<If description="Fresh install basic apps"> <Condition name="True"/> -<Then> -<Statement name="GetVariable" description="" continueOnFail="false"> <Parameter name="VariableType" value="AgentInstallDrive" xsi:type="EnumParameter"/> <Parameter name="SourceContent" value="" xsi:type="StringParameter"/> <Parameter name="VariableName" value="agentDrv" xsi:type="StringParameter"/> </Statement> -<Statement name="WriteFile" description="" continueOnFail="false"> <Parameter name="Path" value="#agentDrv#temp\Ninite Java Installer.exe" xsi:type="StringParameter"/> <Parameter name="ManagedFile" value="VSASharedFiles\Ninite Java Installer.exe" xsi:type="StringParameter"/> <Parameter name="DeleteAfter" value="False" xsi:type="BooleanParameter"/> </Statement> -<Statement name="ExecuteFile" description="" continueOnFail="false"> <Parameter name="Path" value="#agentDrv#temp\Ninite Java Installer.exe" xsi:type="StringParameter"/> <Parameter name="Arguments" value="" xsi:type="StringParameter"/> <Parameter name="ExecuteAccount" value="System" xsi:type="EnumParameter"/> <Parameter name="WaitComplete" value="True" xsi:type="BooleanParameter"/> </Statement> </Then> </If> </Body> </Procedure> </ScriptExport>

All Replies
  • run ninite in the background to update java everywhere, in this case to 7 u11. Steps:

    download java installer from ninite

    upload to shared script files

    run the script below

    done

    <?xml version="1.0" encoding="UTF-8"?>

    -<ScriptExport xmlns="www.kaseya.com/.../Scripting" xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:xsi="www.w3.org/.../XMLSchema-instance"> -<Procedure folderId="31892457818424963153853212" id="1827261028" treePres="3" name="install or update java"> -<Body description="install or update java using ninite"> -<If description="Fresh install basic apps"> <Condition name="True"/> -<Then> -<Statement name="GetVariable" description="" continueOnFail="false"> <Parameter name="VariableType" value="AgentInstallDrive" xsi:type="EnumParameter"/> <Parameter name="SourceContent" value="" xsi:type="StringParameter"/> <Parameter name="VariableName" value="agentDrv" xsi:type="StringParameter"/> </Statement> -<Statement name="WriteFile" description="" continueOnFail="false"> <Parameter name="Path" value="#agentDrv#temp\Ninite Java Installer.exe" xsi:type="StringParameter"/> <Parameter name="ManagedFile" value="VSASharedFiles\Ninite Java Installer.exe" xsi:type="StringParameter"/> <Parameter name="DeleteAfter" value="False" xsi:type="BooleanParameter"/> </Statement> -<Statement name="ExecuteFile" description="" continueOnFail="false"> <Parameter name="Path" value="#agentDrv#temp\Ninite Java Installer.exe" xsi:type="StringParameter"/> <Parameter name="Arguments" value="" xsi:type="StringParameter"/> <Parameter name="ExecuteAccount" value="System" xsi:type="EnumParameter"/> <Parameter name="WaitComplete" value="True" xsi:type="BooleanParameter"/> </Statement> </Then> </If> </Body> </Procedure> </ScriptExport>

  • Thank you for your reply.

    I am looking for silent/unattended install, and I believe simply running the ninite Java installer will only bring up the ninite window, as well as a UAC pop up. I am trying to avoid both.

  • actually that script runs as SYSTEM in the background, so it does not cause the window to pop up. It also does not cause UAC prompts. I just retested that myself on win7 enterprise x64. No UAC or user interaction. As with any script though I recommend you test it yourself.

    the only downside is it will cause a surge in network traffic since every single agent you run against will download the installer (30 MB I think). Just stagger them.

  • I've tried importing this script as a procedure, and get errors,

    ◾The file you are trying to import is not formatted correctly. It contains invalid XML.

    ◾Data at the root level is invalid. Line 3, position 1.

    Am I missing something?  Looks like it was exported from a Kaseya procedure, seems like I should be able to just import and go.

  • I wasn't able to get his working either, looks like an old procedure schema or something? Anyway, wrote my own. Thanks Marc for the tip - I had no idea running ninite as system would work in this manner, I had assumed that since functionality that I was looking for was available with ninite pro, they would block doing it without a license. So far though it is working as expected, other than 2 instances that did not install all programs but after rebooting and testing again it worked, and the machine in question is a very dirty test machine so I was surprised it worked at all.

    Below is my procedure, if you wish to take it. I store my installer on an external webserver, so I have it get URL contents.. you can also host this on your Kaseya machine like Marc did with his procedure.

    <?xml version="1.0" encoding="utf-8"?>

    <ScriptExport xmlns:xsi="www.w3.org/.../XMLSchema-instance" xmlns:xsd="www.w3.org/.../XMLSchema" xmlns="www.kaseya.com/.../Scripting">

     <Procedure name="Ninite- Java Reader Flash FlashIE" treePres="3" id="1254669930" folderId="44472461957228915424792188">

       <Body description="">

         <Statement description="Create a named procedure variable and assign a value retrieved from the managed machine by the agent." name="GetVariable" continueOnFail="false">

           <Parameter xsi:type="EnumParameter" name="VariableType" value="AgentTempDirectory" />

           <Parameter xsi:type="StringParameter" name="SourceContent" value="" />

           <Parameter xsi:type="StringParameter" name="VariableName" value="agentDir" />

         </Statement>

         <Statement description="Write an Entry into the Procedure Log" name="WriteScriptLogEntry" continueOnFail="false">

           <Parameter xsi:type="StringParameter" name="Comment" value="Downloading java 32" />

         </Statement>

         <Statement description="Get the response from a web page." name="GetURL" continueOnFail="false">

           <Parameter xsi:type="StringParameter" name="URL" value="url-to-ninite-exe.com/ninite.exe" />

           <Parameter xsi:type="StringParameter" name="ResponseFileName" value="#agentDir#/ninite.exe" />

           <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="True" />

         </Statement>

         <Statement description="Write an Entry into the Procedure Log" name="WriteScriptLogEntry" continueOnFail="false">

           <Parameter xsi:type="StringParameter" name="Comment" value="Ninite Download completed" />

         </Statement>

         <If description="">

           <Condition name="TestFile">

             <Parameter xsi:type="StringParameter" name="Path" value="#agentDir#\ninite.exe" />

             <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" />

             <Parameter xsi:type="StringParameter" name="Value" value="" />

           </Condition>

           <Then>

             <Statement description="Execute the given command as if it were typed in at a command prompt." name="ExecuteShellCommand" continueOnFail="false">

               <Parameter xsi:type="StringParameter" name="Command" value="#agentDir#\ninite.exe" />

               <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" />

               <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />

             </Statement>

             <Statement description="Write an Entry into the Procedure Log" name="WriteScriptLogEntry" continueOnFail="false">

               <Parameter xsi:type="StringParameter" name="Comment" value="Ninite nstalled" />

             </Statement>

           </Then>

         </If>

       </Body>

     </Procedure>

    </ScriptExport>

  • community.kaseya.com/.../17111.aspx