Kaseya Community

script to install .msi file

  • I am trying to script the install of a .msi file (myodbc.msi to be exact) and I can run the file from command line just like I am trying to get the script to run but it keeps failing with the script in the execute step.

    My script is:

    IF True
    THEN
    Get Variable
    Parameter 1 : 4
    Parameter 2 :
    Parameter 3 : agentDrv
    OS Type : 0
    Write File
    Parameter 1 : #agentDrv#tempmyodbc.msi
    Parameter 2 : VSASharedFiles.myodbc.msi
    OS Type : 0
    Execute File
    Parameter 1 : #agentDrv#tempmyodbc.msi
    Parameter 2 :
    Parameter 3 : 3
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : MyODBC 3.51.12 Installed
    OS Type : 0
    Delete File
    Parameter 1 : #agentDrv#tempmyodbc.msi
    OS Type : 0
    ELSE

    Anyone have any thoughts? The only thing I can think is that when I did a "myodbc.msi /?" from the command line to get the install options it shows an example:"msiexec /option" and maybe when I run it from the command line it automatically call the msiexec to launch the .msi file but it does not when I call the .msi file from the script. Does anyone know?

    Here is the error from my script log: "FAILED in processing THEN step 3, Execute File, with error Spawn Failed, C:\temp\myodbc.msi"

    Thanks.


    Legacy Forum Name: script to install .msi file,
    Legacy Posted By Username: sbennetta
  • MSI's are not executable, they are scripts that tell the MSI installer engine what to do. Run your MSI scripts with msiexec.exe.

    ==============================

    Script Name: MyODBC
    Script Description: Install's MyODBC Drivers

    IF True
    THEN
    Get Variable
    Parameter 1 : 4
    Parameter 2 :
    Parameter 3 : agentDrv
    OS Type : 0
    Write File
    Parameter 1 : #agentDrv#tempmyodbc.msi
    Parameter 2 :
    OS Type : 0
    Execute File
    Parameter 1 : %WinDrv%\System32\msiexec.exe
    Parameter 2 : /quiet /i #agentDrv#tempmyodbc.msi
    Parameter 3 : 3
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : MyODBC 3.51.12 Installed
    OS Type : 0
    Delete File
    Parameter 1 : #agentDrv#tempmyodbc.msi
    OS Type : 0
    ELSE

    ==============================

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: rfouche
  • There is a tool I just learned about built into XP made for just what you're looking to do. It's call iexpress. In Windows XP, navigate to windows\system32. Look for iexpress.exe. From there, select the file(s) you'd like to package, follow the steps, and save it as an msi. You can deploy just about anything this way. Enjoy!

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: mcmonagle