vel
vel

Reputation: 1210

Powershell - run .MSI installation with arguments but Windows Installer pops up and nothing happens

I am using Powershell 7 to install .MSI application with some arguments (same installation with same arguments passed well when using for example Ansible tool). Every time I try to run script I am getting Windows Installer pop up window which someone mentioned ( someone wrote "This pop up is the msiexec help pop up. It’s telling you it doesn’t like your command line"). I tried several different orders but always getting this failure. I saw there was similar issue but it was completely different issue with Accepting License Terms, I do not have issue with that.

My arguments are:

$webDeployInstallerFilePath = "C:\fa_components\PRIME\SUN TEST 2020.1 (x64).msi"
$switch2 = @(
    "i `"$webDeployInstallerFilePath`""        
    "/quiet"
    "passive"
    "/l* C:\tmp_installation\logs\Prime_log.txt"
    "INSTALLDIR=C:\"
    "FRONTINIDIR=C:\ProgramData\Front\64bit\ini\"
    "FRONTINILOG=C:\ProgramData\Front\64bit\log\"
    "PRIME=C:\TEST Arena\"
    "ProgramMenuFolder=C:\ProgramData\"
    "COMMONAPPDATA_FRONTDIR=C:\ProgramData\Front\"
    "COMMONAPPDATA_FRONT64BITDIR=C:\ProgramData\Front\64bit\"
    "CommonAppDataFolder=C:\ProgramData\"

)

Program requires some of it needed argumets. I try to execute it with:

Start-Process msiexec.exe -ArgumentList $switch2 -Wait

I try to run my .ps1 script but as I mentioned I am getting only picture with windows installer and nothing happens (you can see that on following link) windows installer picture

Thanks in advance!

Upvotes: 0

Views: 5997

Answers (1)

Captain_Planet
Captain_Planet

Reputation: 1338

Yes, a few problems.

  • "i" should be "/i" (note the forward slash)
  • "passive" should be "/passive" (note the forward slash)
  • Because it has a space in the path, "PRIME=C:\TEST Arena\" should be "PRIME="C:\TEST Arena\""

Examples here: https://www.alkanesolutions.co.uk/2018/07/18/install-and-uninstall-msi-using-powershell/

$switch2 = @(
    "/i `"$webDeployInstallerFilePath`""        
    "/quiet"
    "/passive"
    "/l* C:\tmp_installation\logs\Prime_log.txt"
    "INSTALLDIR=C:\"
    "FRONTINIDIR=C:\ProgramData\Front\64bit\ini\"
    "FRONTINILOG=C:\ProgramData\Front\64bit\log\"
    "PRIME=`"C:\TEST Arena\`""
    "ProgramMenuFolder=C:\ProgramData\"
    "COMMONAPPDATA_FRONTDIR=C:\ProgramData\Front\"
    "COMMONAPPDATA_FRONT64BITDIR=C:\ProgramData\Front\64bit\"
    "CommonAppDataFolder=C:\ProgramData\"

)

Upvotes: 0

Related Questions