Skip to main content

I am trying to install MSI file using automox.


unfortunately everything I try fails exept executing the MSI install from BAT file.


If I place the MSI command in a BAT file the deployment works correctly.



Here is the BAT file command which works for deployment using automox:


QuickCardSetup.msi /qb tclientkey=ClientKeyHere


then in automox I have:


return $(Start-Process “cmd.exe” “/c quickcard.bat” -Passthru -Wait).ExitCode



if I try to do the same using powershell the execution will eventually time out:


exit(Start-Process -FilePath ‘msiexec.exe’ -ArgumentList (’/qb’, ‘’“QuickCardSetup.msi” “tclientkey=ClientKeyHere”’) -Wait -Passthru).ExitCode



I have tried different arguments without any luck /i /qn


Not sure what I am missing.


Any help is appreciated.

Hello @L4d1k - thank you for posting this. I am running into the same issues with executing .msi installers via Automox and have yet to find a solution. Hopefully my replying will encourage more traction here.



My intent is to install a VPN client with a config file using a command like this:



msiexec /i PSwinInstaller.msi CONFIGFILE=Pulse.pulsepreconfig /qn



Works when ran locally. Automox support suggested the same syntax you mentioned:



exit (Start-Process -FilePath 'msiexec.exe' -ArgumentList ('/qn', '/i', '"PSwinInstaller.msi"', 'CONFIGFILE=Pulse.pulsepreconfig') -Wait -Passthru).ExitCode



^^this works locally but times out when pushed through Automox. For your .bat workaround, did you use a worklet and upload both the .bat and .msi file to it? I’ve tried this since seeing your post and I’m still unsuccessful. For reference, I used a worklet with ‘Exit 1’ in the Eval code and in the rememdiation code block, I used your Automox code from above but referencing my .bat file.


Hello crypto_hales,


yes I think it has something to do with automox and how it handles the powershell execution.


The only way I was able to get couple of my MSI installs to work using automox was by placing the MSI installation commands in a BAT file which I executed using automox.


I hope we can find a solution.


I suggest trying something like this. I use this as an example to install 7-zip. Just verified it is working.



try {

Start-Process -FilePath 'msiexec.exe' -ArgumentList ('/qn', '/i', '7z1900-x64.msi') -Wait -Passthru

Exit 0

} catch { $Exception = $error[0].Exception.Message + "`nAt Line " + $error[0].InvocationInfo.ScriptLineNumber

Write-Error $Exception

Exit -1

}


@L4d1k FWIW, I have been getting the below to work for my MSI file without .BAT



$CurrentUser = (Get-WmiObject -class win32_process | Where-Object name -Match explorer).getowner().user



msiexec /i pulseWindowsInstaller.msi CONFIGFILE="Pulse.pulsepreconfig" /qb



Start-Sleep -s 30



Set-Location C:\Users\${CurrentUser}\Desktop



New-Item -Path . -Name "testfile1.txt" -ItemType "file" -Value "This is a text string."



Not the cleanest but it works for the install. The first line grabs the current user, second line successfully runs the MSI, third pauses for 30 seconds, 4th changes to the desktop and drops a text file on the desktop just to verify the code is being run all the way through.



@d.mccleskey thanks for replying with what looks like a cleaner solution. I will test and report back.


Reply