0

I am new to power shell, I want to install .msi for this we are using below command,

Start-Process msiexec.exe -Wait -ArgumentList 'C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi'

However this is giving me an error. Along with this it should automatically accept next button. Please help me for the same.

Kundan
  • 1,394
  • 1
  • 13
  • 26
Pradeep Yadav
  • 63
  • 1
  • 1
  • 8
  • According to [this](https://support.mozilla.org/en-US/kb/deploy-firefox-msi-installers#w_supported-msiexec-options) you should add the `/q` switch for silent install on the .msi. If you unpack the msi first and use the `.exe`, the silent switch is `-ms`. What error did you get? Please add that error in full to your question. – Theo Mar 11 '20 at 10:48
  • I tried both of below commands -1 Start-Process msiexec.exe -Wait -ArgumentList 'C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi /q' and Start-Process msiexec.exe -Wait -ArgumentList 'C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi /ms' bot of tem gives error as prompt message Windows ® Installer. V 5.0.18362.1 msiexec /Option [Optional Parameter] .... – Pradeep Yadav Mar 11 '20 at 11:12
  • Can you try `Start-Process msiexec.exe -Wait -ArgumentList '"C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi"', '/i', '/q'` – Theo Mar 11 '20 at 11:21
  • still getting pop up message with details like.... Windows ® Installer. V 5.0.18362.1 msiexec /Option [Optional Parameter] Install Options Installs or configures a product /a Administrative install - Installs a product on the network /j [/t ] [/g ] Advertises a product - m to all users, u to current user Uninstalls the product Display Options /quiet Quiet mode, no user interaction /passive ... – Pradeep Yadav Mar 11 '20 at 12:55
  • Some previous answers: [Silent installation](https://stackoverflow.com/a/53436779/129130) (describes a Powershell module for the task and regular cmd.exe versions for silent installation). [Silent installation](https://superuser.com/a/1248364/11906) (short version - from Superuser). – Stein Åsmul Mar 11 '20 at 13:04
  • tried the same, however still getting error. – Pradeep Yadav Mar 12 '20 at 11:28

3 Answers3

1

I have tried this and it worked, Start-Process msiexec.exe -Wait -ArgumentList '/i "C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi" /q /le "C:\Users\abc.xuz\Downloads\Firefox.log"'

Regards, Pradeep

Pradeep Yadav
  • 63
  • 1
  • 1
  • 8
0

This might help Silent installation of a MSI package

If you planning to automate the installtion then why don't you consider using chocolatey. Its a far better way than writting your own custom script.

It also provides option for installation/uninstall, specific version of package etc.

Steps to use chocolatey

  1. You need to Install chocolatey on your machine first
  2. Use choco install firefox to install it. Find more details here
Kundan
  • 1,394
  • 1
  • 13
  • 26
0

With below instruction, you can download MSI installer and print its version

git-bash command

curl -O https://download.microsoft.com/download/a/a/c/aacb9da7-b103-4bec-99ab-cfaf28b0ba78/x64/DacFramework.msi

power-shell command

Start-Process msiexec.exe -Wait -ArgumentList '/i "D:\a\r1\a\DacFramework.msi" /q /le "D:\a\r1\a\DacFramework.log"'

git-bash command set

echo "change directory to DAC bin"
cd "/c/Program Files/Microsoft SQL Server/150/DAC/bin"

echo "print present working directory"
pwd

echo "ls SqlPackage.exe"
ls SqlPackage.exe

echo "sql package version"
./SqlPackage.exe -version

output is as below

15.0.5164.1