is there a way to install more than one .msi and .exe file parallelly using PowerShell.
let's say we have all the installers in one directory
I found a script to install all the files sequentially.
Install all the files from a given folder with Powershell
Previous Answer: Two MSI files can not run concurrently, the reason is explained in this short, old answer on serverfault.
Essence: In essence MSI installers run as a transaction and hence set a mutex to "lock" the system while it finishes installing. This is primarily in the interest of supporting rollback - which means you bring the system back to the original state if the installation fails for some reason. The lock also helps to ensure general reliability by facilitating proper debuggability and logging of failed installs and prevention of deadlocks and duplicate overwrites, etc...
Things you should know:
While the mutex lock is set, other MSI files can be launched to the GUI section, but they can not be kicked off to do the actual installation (system update). You will get an error message if you do so.
Note that legacy style installers (exe files) do not heed this lock and can be run while MSI files are running, but you should not do so. Run installers in sequence and check for errors for each one. The improved I/O of modern computers means installers run very quickly, just do them in sequence. There are some speed-tweeks for MSI installers.
Links:
Other installation In Progress Hanging my Wix Install
Related
My goal:
I want to create a CMD command that will installs a program with adjusted install settings.
If I execute my .exe install file without any parameters, I have to click myself through the installation but I am able to change the install settings, like in which folder the setup will install the program or change the status of a checkbox.
However, I want to run the installation in /silent mode, in which I don't know how to change the install settings.
So the question is:
Is there anyway to give the shell a correct installation settings and then execute the file in silent mode?
I need this because I have to run the installation on multiple computers so it would be very comfortable if I had a script that runs the installation with correct settings.
Someone please guide.
Community: I'll elaborate later, but first let us do the easiest way. You could try to search for your software on sites dedicated to setup information and how to deploy various third party software silently:
https://www.itninja.com/software
Similar, terser answer: Silent run installer (.exe) with parameters on Windows
1) Standard Packaging Formats: If the setup.exe wraps a standard packaging format such as an MSI file, then you generally need to find a way to extract the package inside and customize its silent installation using standardized customization mechanisms involving command lines and MSI transforms.
2) Proprietary Packaging Formats: If the setup.exe is a proprietary format you need to either repackage it in a standard format (MSI) using tools to do so, or you need to run the installer in silent mode. The latter can be unreliable, but is often done for small scale distribution.
Look and Feel: Experience can teach you what tool was used to make the setup.exe by looking at the dialogs at runtime. Sometimes you see a company name or a tool name embedded in them.
So in summary:
Extract standard package if possible.
Customize standard package.
Repackage.
Install silently using original setup.exe.
Let's briefly describe these different tasks:
Extraction of Files:
There is a forest of tools that can create setup.exe files, it is impossible to cover all of them. They might feature all kinds of different command line switches. A setup.exe can even be totally proprietary, meaning no deployment tool was used to make it at all. It might have been compiled using Visual Studio for example.
A description of tools that can be used (non-MSI, MSI, admin-tools, multi-platform, etc...).
Common tools such as Inno Setup seem to make extraction hard (unofficial unpacker, not tried by me, run by virustotal). Whereas NSIS seems to use regular archives that standard archive software such as 7-Zip can open.
I try the following command lines to see if I can do a file extract:
setup.exe /a (Installshield MSI)
setup.exe /stage_only (Installshield Suite)
setup.exe /x (Wise, Advanced Installer)
setup.exe /extract_all (Installshield Installscript)
dark.exe -x outputfolder Setup.exe (WiX Burn Bundles - requires WiX toolkit installed)
Additionally some general tricks exist:
Launch the setup.exe and look in the system's temp folder for extracted files.
Another trick is to use 7-Zip, WinRAR, WinZip or similar archive tools to see if they can read the setup.exe format.
Some claim success by opening the setup.exe in Visual Studio. Not a technique I use.
The general approach for finding switches is to open a command prompt and go setup.exe /? or setup.exe /help or similar.
Also check for vendor online information and sites such as https://www.itninja.com/software.
A sprawling answer on this topic: Extract MSI from EXE.
If you manage to extract (or the file format is viewable as an archive), you can look for PDF, HTML, TXT or CHM files with further deployment info. Samples: ReadMe.txt, LSD.pdf, Large Scale Deployment.pdf, User Guide.chm, Manual.chm etc...
MSI - Customize Standard Package:
So, if the extract works and you extract an MSI file, then you can customize its installation in detail using standardized mechanisms. Make sure to look for the files with deployment information mentioned above - PDFs, CHMs, TXTs, etc... They could feature sample command lines for you to use more or less directly.
And crucially you could have extracted runtimes and prerequisites that also need to be deployed (.NET framework, Crystal Reports, Visual C++ Runtime, etc...). These are all managed and controlled on corporate networks and are not to be deployed with your package, but by their standardized packages.
Standardized customization mechanisms are great for corporate deployment, but require some MSI knowledge:
How to make better use of MSI files - a comprehensive description of MSI installation customization: with some sample command lines and description of the process.
A simplified view of MSI installation customization.
Here you can see that some setup.exe files can be installed directly in silent mode by passing in a command line using the /v parameter. These are Installshield MSI setups.
You can also see how the features in the MSI can be set at the command line.
A couple of concrete samples (extracted from links above):
Command Line Customization
msiexec.exe /i myinstaller.msi ADDLOCAL="Program,Dictionaries" SERIALKEY="1234-1234" /qn
ADDLOCAL specifies what features from the MSI to install (see feature sample screenshot here). The uppercase values such as SERIALKEY are PUBLIC properties that can be set on the command line. These vary from setup to setup. Look for documentation from vendor, check the Property table and check the setup dialogs.
Transform
msiexec.exe /i myinstaller.msi TRANSFORMS="mytransform.mst" /qn
The transform approach sets all the values needed inside a little file that is applied at installation time. It is called the transform. It is a little database fragment which is merged with the original MSI database at runtime.
Repackaging:
One way to create an MSI package from older-style, legacy setup.exe installers, is to "capture" the changes done to the system by using an Application Repackaging Tool which monitors changes made to the system whilst a setup.exe is being run.
This task may look easy, but it isn't. In fact it is very hard to clean up the resulting captures so you don't create "loose cannon" MSI files that cause problems on desktops throughout your organization. Corporations have dedicated teams to do this job and excellent MSI files can result that cause no problems when installed silently.
This task is not for the causal user in my opinion. It requires investment in the technology, expertise and time. Besides the tools available are pricey.
Silent Installation:
Most setup.exe files will at least attempt to install silently, though there are no guarantees. It is entirely possible that the setup.exe is impossible to install silently. I have seen it many times. In these cases repackaging is necessary, but even repackaging can fail at times. This is when it is time to push back on the vendor and ask them to get a grip about deployment. In a corporate world the software should be kicked head-first out of the application estate - if things work as they should.
Here is an old site dealing with the overall issue of silent installation of various setup.exe files: http://unattended.sourceforge.net/installers.php.
Here is a piece on silent uninstall which also describes silent running in general: Uninstall and Install App on my Computer silently
The general approach for finding such switches is to go setup.exe /? like you did. Often you can get a setup to install silently by trying something like this:
Visit https://www.itninja.com/software to check for switches from the community.
As stated above look for PDF, HTML, TXT or CHM files with further deployment info. Samples: ReadMe.txt, LSD.pdf, Large Scale Deployment.pdf, User Guide.chm, Manual.chm, etc...
Common: setup.exe /S, setup.exe /Q, setup.exe /quiet, setup.exe /VERYSILENT /NORESTART or similar.
Old-style Installshield setups need to have a response file recorded and then you install on all systems using the recorded dialog responses.
See this document.
Setup.exe /s /f1”c:\temp\my-answer-file.iss” /f2”c:\temp\my-log-file.iss”
Installshield Suites and regular Installshield setup.exe (links to Installshield's own help pages for setup.exe files)
Old Wise setups: https://www.itninja.com/blog/view/wise-setup-exe-switches
Some Links:
Create MSI from extracted setup files
MSI Deployment Tools List
Extract MSI from EXE
https://www.itninja.com/software
Uninstall and Install App on my Computer silently
Combine exe and msi file in one installer
How can I use powershell to run through an installer?
How to Install an NSIS Executable Silently For All Users
I am working on a project where we need to repeat certain steps with powershell to deploy stuff. i would like to create a process/install guidance (steps supported with UI) with WIX but after the msi has finished i have an entry in programs and features. I just need it to execute the powershell and the end without registering in windows. i might be using the wrong tooling or whatever, any suggestions are welcome.
Definitely not recommended unless you want to track the deployment of these scripts on different systems by checking the entries in ARP (Add/Remove Programs), and even then it clogs up the Add/Remove view of your computers. Most system administrators hate this approach, it is better to just write to your own registry key and read it back from every machine.
What are the scripts doing? Are you actually installing files.
Okay, I am trying to write an installer that installs multiple programs. The installer needs to be able to either get the files from a web server, or be able to package the files into a single installer file.
The end result I am looking for is a user hits a webpage, they can click a link to download a single installer file and the installer goes ahead and installs each of the programs. Quiet installations would be preferable but not absolutely necessary. I am trying to make this as user friendly and idiot proof as possible.
Grabbing the installers for each program from a web server would be preferable so it always grabs the latest version and I will not have to tweak the installer script each time the programs are updated.
I have looked into NSIS and MSI, and neither seem to be able to do what I need. I have entertained the idea of using Java Web Start to run a Java program that can install everything, but I am not sure the plausibility of that. If that is possible, then the user would not even need to run a file the Java Web Start would just take care of everything.
Perhaps Ninite will help.
If not, there are two possible solutions:
You can try using a MSI wrapper which installs the applications as prerequisites or through custom actions. It's dirty and complicated, but MSI is a standard.
You can write your own application which handles the installers. This is most likely the best approach.
I need to make installation file (.exe), but is that possible with batch script and how?
I made installation with some software (Deployment...) but I need to do that with script. I have all necessary files for my installation.
Is that possible?
Marko
Virtually every tool for building installation packages provides ability to include arbitrary sripts to the installation process. Just inspect your tool for this capability...
Here, we often include sripts in our WIX installations. Of course, user expirience is better when you building installation package nativelly, but in some cases this is acceptable practice (mostly when there is no non-tech users planned).
With a batch script, you will not be able to make a .exe (unless you call a .exe creator from within the batch script!). Why not try Inno Setup or NSIS? ISTool helps in creating Inno Setup scripts with ease and speed.
You can't make an .exe using nothing but a batch script. You can however use a batch script to create the installation specification file(s) and then run that file through an installer creator program like the ones mentioned in the other answers here. Perhaps you could be a bit clearer about what you actually need to do?
I have always wondered about this. So many application setups have a zip file that you unzip, and in it are a bunch of files, among other things an exe and an msi. What is the difference? They are often even about the same size. I am never really sure which one to execute, sometimes I do the exe and sometimes the msi, and it usually works with either one. But does one of them do anything that the other doesn't do? And if not, isn't it kind of a waste having two files that does the same thing? Especially when thinking about download size, etc...
Not sure if this should be here or on ServerFault, or maybe neither, but I figured since developers usually are the ones creating setup files, then developers might know why this is like it is =)
In the case where you have both exe and the msi the exe is just a loader for the msi. If you have an installation supporting multiple languages then the exe applies a language transform (mst) on the msi before installing.
You can consider the exe as a wrapper around the msi. The msi file may or may not be given separately. The reason why people give the msi file too is to facilitate a group policy installation (in a Windows Active Directory infrastructure) as you can only push down installations of msi files and not exes.
The setup.exe is a wrapper for the MSI, but it is not only a wrapper.
The setup.exe can rely on a setup.ini to define parameters
The setup.exe checks for the Windows Installer (a MSI cannot be installed otherwise)
The setup.exe can check for frameworks, like the .NET framework. The developer can pick one of those defined in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages (for Visual Studio 2008). If it is lacking, it will try to download it from http://www.microsoft.com/
The setup.exe can be reconfigured with msistuff.exe
The actual installation is done in the MSI. As Prashast said, the exe is just a wrapper, but the reason for having the exe, is that an exe is allways possible to run. If the user do not have MS Installer installed on the computer, or his version of MS Installer is older than the version required by your installation, then the MSI file is not possible to run.
The exe provides automatic installation of MS Installer (including some question to the user if he/she wants to do this) before running the MSI file. In most cases, the install packages needed for Microsoft Installer is included inside the setup.exe, or sometimes it is just the prerequisites check with a link to download the installation from Microsoft.
In very basic words,
you can deliver just the .msi file and it will install. but .exe will not work without the .msi