Skip to content

Start-Process MSIEXEC

Featured Replies

Hello, I'm working on a Powershell script to install Autodesk products. 

I'm having issues with a step and hopefully someone can help. 

I've tried this many different ways and keep running into errors.

Using double quotes

(Start-Process "msiexec.exe" -ArgumentList ""/i $dirFiles\ABDS2017\Img\x64\RVT\RVT.msi INSTALLDIR="C:\Program Files\Autodesk\" ADSK_SETUP_EXE=1 /qb!"" -NoNewWindow -Wait -PassThru).ExitCode

Error Cannot validate argument on parameter 'ArgumentList' Argument is null or empty.

Using a variable to define InstallDir

        $RevitInstallDir = "C:\Program Files\Autodesk\"
        (Start-Process "msiexec.exe" -ArgumentList "/i $dirFiles\ABDS2017\Img\x64\RVT\RVT.msi INSTALLDIR=$RevitInstallDir ADSK_SETUP_EXE=1 /qb!" -NoNewWindow -Wait -PassThru).ExitCode

Doing this I get the msiexec /option Required Parameter error.

Tried this also, Single Quotes with Quotes on Path

(Start-Process "msiexec.exe" -ArgumentList "/i $dirFiles\ABDS2017\Img\x64\RVT\RVT.msi INSTALLDIR="C:\Program Files\Autodesk\" ADSK_SETUP_EXE=1 /qb!" -NoNewWindow -Wait -PassThru).ExitCode

I receive A positional parameter cannot be found that accepts argument C:\Program

Using single quotes on InstallDir

(Start-Process "msiexec.exe" -ArgumentList "/i $dirFiles\ABDS2017\Img\x64\RVT\RVT.msi INSTALLDIR='C:\Program Files\Autodesk\' ADSK_SETUP_EXE=1 /qb!" -NoNewWindow -Wait -PassThru).ExitCode

Doing this I get the msiexec /option Required Parameter error.

Using single quotes on the outside

(Start-Process "msiexec.exe" -ArgumentList '/i $dirFiles\ABDS2017\Img\x64\RVT\RVT.msi INSTALLDIR="C:\Program Files\Autodesk\" ADSK_SETUP_EXE=1 /qb!' -NoNewWindow -Wait -PassThru).ExitCode

If I do this, it prevents the $dirFiles variable from working. 

 

The reason I'm using Start-Process is because I have many installers one after the other and I want one installer to wait till the one before it finishes. Any help would be appreciated! Thanks

  • 3 months later...

I know this is really old but i thought i'd get this anyway.

I like to split things up (makes things easier to write and troubleshoot)
Also use arrays for arguments to msiexec.so, for your install line--

$RevitInstallDir = "$env:ProgramFiles\Autodesk\"
$msifile = "$dirFiles\ABDS2017\Img\x64\RVT\RVT.msi"
$installdirargs = "INSTALLDIR" + "$RevitInstallDir"
$autodeskargs = @(
	"/i"
	"`"$msifile"`"
	"`"installdiragrs`""
	"ADSK_SETP_EXE=1"
	"/qb!"
)

$installcommand = start-process msiexec.exe -ArgumentList $autodeskargs -wait -PassThru

#to get the exitcode do --- $installcommand.ExitCode

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.