Skip to main content
Answer

Installing msi package using required software

  • February 28, 2024
  • 3 replies
  • 310 views

Forum|alt.badge.img

Hello everyone. I have been trying to find some examples, and I thought what I put would work, but its not. I am trying to install an msi package that has some extra arguments. For example, If I run this from a command line it works on a computer:

 

msiexec /i agentmanagersetup.msi /qn DEVREGCODE=XXXX TENANT=XXXX ALLUSERS=1

 

When using automox it has me do some of this in quotes and parentheses and this is where I am not sure what to do. I currently have this but its not working:

 

exit (Start-Process -FilePath 'msiexec.exe' -ArgumentList ('/qn', '/i', '"agentmanagersetup.msi DEVREGCODE=XXXX TENANT=XXXX ALLUSERS=1"') -Wait -Passthru).ExitCode

If I removed the DEVREGCODE and TENANT arguments and put them in their own quotes i would get an error about a token. If i put it the way I have it above, it doesnt seem like its running as i dont even see a failed in the activity report.

Not sure What I am doing wrong. Also, because the install has specific to our company, I replaced that data with the X’s.

Best answer by jack.smith

Give this a try.

$install = Start-Process -FilePath msiexec.exe -ArgumentList ('/i agentmanagersetup.msi DEVREGCODE=XXXX TENANT=XXXX ALLUSERS=1 /qn') -Wait -Passthru
Write-Output "Install ExitCode: $($install.ExitCode)"

 

 

3 replies

jack.smith
Forum|alt.badge.img+1
  • All Star
  • Answer
  • March 1, 2024

Give this a try.

$install = Start-Process -FilePath msiexec.exe -ArgumentList ('/i agentmanagersetup.msi DEVREGCODE=XXXX TENANT=XXXX ALLUSERS=1 /qn') -Wait -Passthru
Write-Output "Install ExitCode: $($install.ExitCode)"

 

 


Forum|alt.badge.img
  • Author
  • Novice
  • March 1, 2024

Thank you. I will give this a try.


Forum|alt.badge.img
  • Author
  • Novice
  • March 4, 2024

That worked, thank you very much.