Silent run installer (.exe) with parameters on Windows
I have a windows setup file (.exe), which is used to install a software. This is a third party executable. During installation, it expects certain values and has a UI. I want to run this setup .exe silently without any manual intervention (even for providing the parameter values). After spending some time googling about the approach, I feel powershell should be able to help me with my requirements. Can anyone suggest if powershell would be the right tool for this, or does a better tool exists to get this requirement? Can python be used to implement this requirement?
Please note: Since this is a third party executable, I don't have the names of the parameters for which values must be provided to the UI during installation
Thank you
Solution 1:
Deployment: Note that it is not always possible to run a setup.exe silently with full control of parameters and with reliable silent running. It depends on how the installer was designed. In these cases I normally resort to repackaging - some more detail below on this.
Some general tips for dealing with deployment:
Software Library Tip: Maybe try to look up the software to see if others have dealt with it for silent installation and deployment: https://www.itninja.com/software
-
Extract Files: Is this an embedded MSI (Windows Installer) file or a legacy style
setup.exe
? Maybe try to extract the files first: Programmatically extract contents of InstallShield setup.exe (Installshield setup.exe files). More elaborate details:- How to run an installation in /silent mode with adjusted settings (extraction of non-Installshield setup.exe files - for example Advanced Installer or WiX setup.exe files)
- Extract MSI from EXE
Setup.exe: Just adding for completeness. You can try
setup.exe /?
orsetup.exe /help
or similar at the command line to check for embedded help in the exe.
MSI Transforms: If you discover and embedded MSI file in the setup.exe, then you can customize the installation parameters in a standardized way. details here: How to make better use of MSI files. Light weight customization is by command line, heavy weight customization via transforms.
Legacy Setup.exe: Legacy setup.exe
are often created with Inno Setup, NSIS, or a few other non-MSI setup authoring tools. Each with their own quirks for command line. Here is an old source for some samples: http://unattended.sourceforge.net/installers.php.
Repackaging: Corporate users often repackage such legacy setup.exe files and turn them into MSI or App-V packages (or the brand new MSIX format). On the topic of repackaging and also a piece on PowerShell and the availability of Windows Installer PowerShell Modules: How can I use powershell to run through an installer?.
Some Further Links:
- How to create windows installer
- System Administrator deployment tools, including repackaging tools