Silent install of IBM Rational Doors 9.7 with Powershell

239 Views Asked by At

I am trying to perform a silent install of IBM Rational Doors 9.7 as explained here.

I want to perform the install with Powershell. I am constructing the arguments to Start-Process to run the installer like this:

$doors97installArgs = '/s /v"/l*v"install.log" /qn INSTALLDIR="C:\Program Files\IBM\Rational\DOORS\9.7.2.3\" CLIENTDATA="36990@<redacted>" LAPAGREE="Yes" TLLICENSESERVER="27200@<redacted>" -wait -verb open'

For Start-Process I am using this:

Start-Process -WorkingDirectory $doors97location -FilePath $doors97setupFullPath -ArgumentList $doors97installArgs

The values in $doors97location and $doors97setupFullPath evaluate correctly.

When Start-Process runs it immediately exits with no error message. What am I doing wrong?

3

There are 3 best solutions below

2
mklement0 On BEST ANSWER

There are two problems with your command:

  • You mistakenly included -wait and -verb open inside the argument-list string passed to Start-Process.

    • Note that -Verb Open is redundant, as it is implied. (-Verb is typically only used with RunAs, to request execution _with elevation).
  • The argument-list string is broken in that the embedded " chars. inside /v"..." aren't escaped.

However, since your intent is to run synchronously (Start-Process -Wait), for simplicity I suggest calling via cmd /c instead, which is implicitly synchronous while giving you the same control over the quoting on the resulting process command lines as with Start-Process; additionally, the installer process' exit code will be reflected in the automatic $LASTEXITCODE variable afterwards.

Based on the docs you link to, try the following (using an expandable here-string to make use of embedded quotes easier):

# Call the installer synchronously.
# 
cmd /c @"
cd /d "$doors97location"
"$doors97setupFullPath" /s /v"/l*v\"install.log\" /qn INSTALLDIR=\"C:\Program Files\IBM\Rational\DOORS\9.7.2.3\" CLIENTDATA=\"36990@<redacted>\" LAPAGREE=\"Yes\" TLLICENSESERVER=\"27200@<redacted>\""
"@  # NOTE: This closing delimiter must be *at the very start* of the line.

After this call, $LASTEXITCODE contains the installer's exit code.

4
FranciscoNabas On

Looks like Start-Process is trying to interpret something from this string.
Try changing the approach, using Start-Process to run a cmd command.
Like this:

Start-Process -FilePath cmd -WorkingDirectory $doors97location -Wait -ArgumentList '/c', 'setup.exe /s /v"/l*v"install.log" /qn INSTALLDIR="C:\Program Files\IBM\Rational\DOORS\9.7.2.3\" CLIENTDATA="36990@<redacted>" LAPAGREE="Yes" TLLICENSESERVER="27200@<redacted>" -wait -verb open'

Let me know how it turned out, and share any error that might come out.

2
js2010 On

There is probably no difference between silently installing a program in cmd or powershell, barring quoting issues. Since I don't see a "start /wait" in the docs, I'm assuming the setup.exe runs in the foreground, and doesn't require start-process to wait for it. If the quoting becomes an issue, it's an option to run the thing inside an install.bat file. I see a lot of backslashed double-quotes there.

C:\doors_server\setup.exe /s /v"/l*v\"C:\doors_server\install.log\" /qn PORTNUMBER=\"36677\" LAPAGREE=\"Yes\" DATABASEDIR=\"C:\Program Files(x86)\IBM\Rational\DOORS\9.version\data\" INSTALLDIR=\"C:\Program Files(x86)\IBM\Rational\DOORS\9.version\""