Kaseya Community

Should I be able to run a basic *.msi file from within a procedure?

  • I know I can use the Patch Management section to manage software installs, but I'm trying to create some basic procedures that do some work before and after I do an install.  I'm now struggling with my second attempt at this, I gave up on the first app I was trying to install because I thought it was the app, now I'm thinking it's something I'm missing about running an MSI file from a procedure. 

    The account I'm managing here doesn't allow end users to install their own software so we impersonate our "kadmin" account to run the install.  I've tried running the actual install as a "Shell Command" (shown below) and also tried it as an "Execute File" step.  Here's an example of one of my procedures below:

     

      <?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="600 - AndersonIQ 10.0 Install" treePres="3">
    - <Body description="In order for this to work, the file you're going to install needs">
    - <Statement description="Write an Entry into the Procedure Log" name="WriteScriptLogEntry" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Comment" value="Starting AndersenIQ Version 10.0 Install" />
      </Statement>
    - <If description="Let's check to make sure the program is sitting in c:\kworking">
    - <Condition name="TestFile">
      <Parameter xsi:type="StringParameter" name="Path" value="c:\kworking\Intelligent Quote 10.0.msi" />
      <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" />
      <Parameter xsi:type="StringParameter" name="Value" value="" />
      </Condition>
    - <Then>
    - <Statement description="Write an Entry into the Procedure Log" name="WriteScriptLogEntry" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Comment" value="AndersenIQ file "Intelligent Quote 10.0.msi" exists. Continuing the process." />
      </Statement>
    - <Statement description="Set the login credentials to execute a file or shell command as this user - Windows 2000 and above only." name="ImpersonateUser" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="UserName" value="kadmin" />
      <Parameter xsi:type="StringParameter" name="Password" value="###########" />
      <Parameter xsi:type="StringParameter" name="Domain" value="" />
      </Statement>
    - <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=""c:\kworking\Intelligent Quote 10.0.msi /q"" />
      <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User" />
      <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />
      </Statement>
    - <Statement description="The install takes a few minutes, but we told the prior step to wait, so we are just giving it another 30 seconds to be real safe before we delete the installer." name="PauseScript" continueOnFail="false">
      <Parameter xsi:type="IntegerParameter" name="Seconds" value="300" />
      </Statement>
    - <Statement description="Write an Entry into the Procedure Log" name="WriteScriptLogEntry" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Comment" value="Completed with setup - ready to remove files" />
      </Statement>
    - <Statement description="Delete the specified file - full path to the filename required." name="DeleteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="c:\kworking\Intelligent Quote 10.0.msi" />
      </Statement>
    - <Statement description="Display a message dialog to the user." name="SendMessage" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Message" value="Ok - We're done! We just completed an install of Andersen IQ Quoting application - version 10.0. If you have questions or comments, email us at helpdesk@appliedintegration.net or call (801) 266-4888. Thanks and have a nice day!" />
      <Parameter xsi:type="BooleanParameter" name="Immediate" value="True" />
      </Statement>
      </Then>
    - <Else>
    - <Statement description="Write an Entry into the Procedure Log" name="WriteScriptLogEntry">
      <Parameter xsi:type="StringParameter" name="Comment" value="AndersenIQ Setup file "Intelligent Quote 10.0.msi" is missing. Unable to Proceed." />
      </Statement>
      </Else>
      </If>
      </Body>
      </Procedure>
      </ScriptExport>
  • Hmmm...  Might have just answered my own question...  I think it might have been the spaces in my installer file.  

  • You need to launch MSI files with MSIEXEC.exe. For example...

    Execute File

    File: %WINDIR%\system32\msiexec.exe

    Parameters: /q /i yourInstaller.msi

    Also, execute as SYSTEM wherever possible to avoid UAC prompts and other bullshit.

  • I see.  I was just trying to fire off the .msi file.  Thanks!