How to silently install exe using powershell - powershell

I am trying to install trial version of Lotus Notes Designer using Powershell command
Start-Process -FilePath "EXEPath" -Verb runAs -ArgumentList "/qn"
But this command displays the normal installation wizard, how do I make it a silent installation?

Silent Install commands vary depending on the program itself and the installer they have used. Using /qn will work for most (but not all!) MSI installers, as there is a Microsoft standard that most will follow, but EXE installers can be very different as they do not have guidelines like an MSI.
Searching for the name of the program and 'silent install' will likely bring up the programs help pages or a blog which lists the commands you will need to use.
A search for "lotus notes designer silent install" brings up this article which lists the command as:
setup.exe /s /v"/qn"
Which you would use like this:
Start-Process -FilePath "C:\folder\setup.exe" -Verb runAs -ArgumentList '/s','/v"/qn"'
Note: I can't test this as I don't use Lotus Notes, but it should work, or at least give you a good idea on what to do.

Please try below command in powershell, it will install silently along with wait and ouput. Note: Your installer should be supporting /S option and didn't try with LotusNotes.
Start-Process .\installer.exe /S -NoNewWindow -Wait -PassThru

use this
Start-Process -FilePath "D:\Software\app.exe /S /NoPostReboot _?=D:\Software\app.exe" -NoNewWindow -Wait -PassThru $process.ExitCode

Related

Powershell script is not installing an exe while i try it runs through TFS Build

I have a powershell script which will install an exe. It works fine when i try it from a powershell ISE console, but it fails when i try it from TFS build step.
Note : My TFS user, agent user and triggering user are same.
Could anybody can shed some light on this issue ?
Start-Process -FilePath $installerFileName -Verb "runas" -ArgumentList $parameter -Wait
The above code is using to install the exe. $parameter is a list of custom parameters.
I am getting below error
[WixSession.GetSession][GetSessionValues]exception: Value cannot be null. Parameter name: s
What kind of exe are you trying to install? Dose that support silent installation? If UI pop up during the installation, then the agent needs to run in interactive mode.
Test on my side with below command to install/unistall the notepad++ with service mode, everyting works as expected:
start-process -FilePath "D:\Software\npp.7.5.8.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait
And:
start-process -FilePath "C:\Program Files\Notepad++\uninstall.exe" -ArgumentList '/S' -Verb runas -Wait

Calling a powershell script from InstallShield project

I'm having a weird problem.
I have an InstallShield project (which creates setup.exe) that contains a custom action item - calling a powershell script.
All the script does is to install 3 adobe reader updates (1 exe file and 2 msp files) on top of the already installed Adobe Reader 11.0.0.
When I'm calling the script my self - it works fine.
However, after the setup.exe finishes, it seems like only one update (the exe file) was really installed (the adobe reader version after the install is 11.00.10 which is the result of running only the exe file..).
All 3 adobe updates sit in the same folder and the powershell script first sets it location to this folder.
When running the updates manually after the installation - it also works fine and updates it to 10.00.22 (what it should be).
Any ideas why is this happening?
Here's my powershell script:
Set-Location "C:\myProject\adobeUpdates"
Start-Process .\AdbeRdr11010_en_US.exe -ArgumentList '/q /norestart /sPB /rs /msi' -WindowStyle hidden -Wait
ping 1.1.1.1 -n 1 -w 10000 # Tried to add a delay but wasn't helpful
Start-Process -FilePath “AdbeRdrUpd11021.msp” -ArgumentList '/qn' -Wait
Start-Process -FilePath “AdbeRdrUpd11022_incr.msp” -ArgumentList '/qn' -Wait
Thank you very much
Solved it, this is the working script:
Set-Location "C:\myProject\adobeUpdates"
Start-Process .\AdbeRdr11010_en_US.exe -ArgumentList '/q /norestart /sPB /rs /msi' -WindowStyle hidden -Wait
ping 1.1.1.1 -n 1 -w 10000
Start-Process .\AdbeRdrUpd11021.msp -ArgumentList '/qn' -Wait
Start-Process .\AdbeRdrUpd11022_incr.msp -ArgumentList '/qn' -Wait
I'm not sure what is the different and would love someone to explain but anyway it works just fine now.

Silent install an Installsheild that contains an MSI in Powershell?

I have an executable Installshield setup file that I need to install silently. It appears to call an MSI file as MSIEXEC is launched during installation. I've tried this in powershell:
Start-Process "C:\temp\mysetup.exe" -ArgumentList "/s /v /qn" -Wait
However that launches the GUI. Any ideas what I'm doing wrong? I've searched and searched and this seems to be what all the cool kids are doing but it refuses to work for me. Many thanks. :)
You can try the "Universal Silent Switch Finder" (ussf) to find and confirm the switch usage.
I figured it out - was just a syntax issue:
ORIGINAL:
Start-Process "C:\temp\mysetup.exe" -ArgumentList "/s /v /qn" -Wait
WORKING:
Start-Process "C:\temp\mysetup.exe" -ArgumentList '/s','/v/qn' -Wait
Thanks for the advice!

Listeners installation

I am creating a PowerShell script that automates the Oracle software install. Right now everything is working correctly until I trying and setup the two listeners for the software.
When manually installing the database software you have to open a new shell and execute these two commands after the software has been installed....
netca -silent -responsefile c:\path\to\netca_listener.rsp
netca -silent -responsefile c:\path\to\netca_callout_listener.rsp
I have been trying to execute these two rsp files like so..
saps -FilePath cmd.exe -ArgumentList "/c", "netca", "-silent", "-responsefile $first_rspfile" -WindowStyle Hidden -Wait
Typically the process will spin briefly, but then will do nothing, and the response files will pop open when the process starts running.
Any clues to what might be going on?
You don't need cmd /c in PowerShell. Try this:
Start-Process -FilePath "netca.exe" `
-ArgumentList #("-silent", "-responsefile $first_rspfile") `
-WindowStyle "Hidden" -Wait

EXE silent installation

I have following PowerShell script to install application without user intervention:
Start-Process -FilePath "C:\Temp\UpgradeClientInstaller\setup.exe" -ArgumentList "/S /v/qn"
by giving /s in argument list, it should install silently without user intervention but a popup is showing
Even I try with winrar.exe and zip.exe files giving the same result. Is this right way to do?
Have you tried the following command?
Start-Process -Wait -FilePath "C:\Setup.exe" -ArgumentList "/S" -PassThru
Please try this:
$pathvargs = {C:\Temp\UpgradeClientInstaller\setup.exe /S /v/qn }
Invoke-Command -ScriptBlock $pathvargs
Try this:
Start-Process -Wait -FilePath C:\setup.exe -Argument "/silent" -PassThru
Start-Process -Wait -FilePath "\full\path\setup.exe" -ArgumentList '/S','/v','/qn' -passthru
The quotes of the execute file are not necessarily.
I know the post is super old, but I feel like I could share some insight on the matter
I had to do something similar a few years ago. When you click "install" on the prompt, all it's doing is adding the cert to the TrustedPublisher store. That prompt can be avoided if you manually add it to the cert manager prior to running the installer.
I found that if you install the program on a test machine, you can export the Cert from certmgr.msc. Then you can install the cert using:
certutil -addstore "TrustedPublisher" <PathTo.cerFile> >nul 2>nul
This will install the cert to the TrustedPublisher store therefore eliminating the need for that message to appear.
I hope this helps Ramesh as well as anyone else who finds this in the future
Use this command it will not ask for any click on next and install the software.
Start-Process -Wait -ArgumentList "/silent" -PassThru -FilePath 'C:\Users\filename.exe'
Your problem seems to be Windows UAC and not the script itself.
Go to Control Panel -> System and Security -> Security and Maintenance
Click Change User Account Control settings.
Set the slider to "Never Notify".
This may be risky - but it works.
add the -NoNewWindow to stop the popup