I am seeing some odd behavior running the installer for Autodesk 3D Studio Max 2021. The key issue with an Autodesk installer is it is actually a staged installer, you launch an EXE, which reads data from some XML files, and launches a number of other installers, both EXE and MSI.
Autodesk provides a BAT file for automation, which looks like this
chcp 65001
"\\px\Rollouts\ADSK\2021\3ds_Max_2021\Deployment\image\Installer.exe" -i deploy -q --offline_mode -o \\px\Rollouts\ADSK\2021\3ds_Max_2021\Deployment\image\Deployment.xml -m \\px\Rollouts\ADSK\2021\3ds_Max_2021\Deployment\image\{35156605-CE91-4AF6-8207-56211CB30369}\setup.xml
Echo Done
timeout /t 600
I added the echo and timeout lines to verify when control returns to the BAT file, given that they are not using Start /wait.
I have also migrated the install from the BAT to a PS1 like this
$executable = '"\\px\Rollouts\ADSK\2021\3ds_Max_2021\Deployment\image\Installer.exe"'
$deploymentXML = '"\\px\Rollouts\ADSK\2021\3ds_Max_2021\Deployment\image\Deployment.xml"'
$setupXML = '"\\px\Rollouts\ADSK\2021\3ds_Max_2021\Deployment\image\{35156605-CE91-4AF6-8207-56211CB30369}\setup.xml"'
$argumentList = "-i deploy -q --offline_mode -o $deploymentXML -m $setupXML"
$exitCode = (Start-Process -FilePath $executable -Argumentlist $argumentList -Wait -ErrorAction Stop -PassThru).ExitCode
Write-Host "TaskExitCode: $exitCode"
In theory this should work. The installer runs while PowerShell waits for it to complete, and on completion control returns to PowerShell and the message is displayed. But in PowerShell that never happens, control never returns to PowerShell. At least in Windows 10. In Windows 7 it works as expected. And the BAT file works as expected in both cases.
One of the items being installed by the main install is something called Autodesk Desktop App, which is a service that runs and check for updates. If I remove this from the install (it's a simple XML edit) then control returns to PowerShell and the message displays as expected, even in Windows 10.
So, my question is, does this make sense, that Start-Process -wait
is perhaps waiting on a service that was installed and started by the EXE called by Start-Process
? And that this should only happen in later versions of Powershell?
I have tested a number of different products, with and without Desktop App installing, and removing it allows the main install to properly complete and return control as expected, but I want to know WHY this works, since my sample for testing is rather limited. I want to be sure there isn't some other possible explanation.