Setup returns different exit code when called from PSADT

Hi - we experience a very strange behavior that we can’t explain… Maybe someone else has seen this before or knows why this happened…

We need to install a pretty complex software - PI Processbook from OSI Soft. The installation has multiple steps in a batch - install.cmd. That batch starts approx. 10 different setups. Some MSI installs, but also some installations using OSISoft’s setup.exe. When we call the install.cmd from a command line in system context or from a administrative PowerShell commandline - everything works fine and all steps in that batch return 0. When we run the same install.cmd (Execute-Process -Path “$dirFiles\install.cmd”) on the same computer from the deploy_application.ps1, then some of the steps in the CMD return 1 instead of 0 (but still successfully installed). We can reproduce this behavior. It’s always the setup.exe that returns a different return code when called from PSADT. Any ideas what can cause this strange behavior? I couldn’t believe it until I saw it reproduced on my VM?!?

Thanks,
Stefan

Hello Stefan,

what toolkit version are you talking about?
Also, .CMD isnt an executable. It is still opened by cmd.exe so you should target cmd.exe and pass the batch file as a parameter unless you use -UseShellExecute. You should take a look at the parameters and use the ones you need.

Hi Luki,

thanks for the reply - we’re using toolkit 3.8.0 - and you’re right - .cmd isn’t an executable - I changed the deploy_application.ps1 from

Execute-Process -Path “$dirFiles\install.cmd” -Parameters “$InstallParameters” -WindowStyle Hidden -ContinueOnError $false

to

Execute-Process -Path “C:\Windows\System32\cmd.exe” -Parameters “/c $dirFiles\install.cmd” -WindowStyle Hidden -ContinueOnError $false

But this doesn’t change the behavior - still receiving exit code 1 instead of 0 for some steps…

Thanks,
Stefan

Is it possible for you to upgrade to 3.8.3 ?

Sure – let me try – I’ll get back once I’ve the results!

Thanks,

Stefan

I tried with 3.8.3 - the problem’s gone now. All steps in the CMD now return 0 as expected…

Thanks,
Stefan