How to create msi and install from it? - windows

Is it correct msi file is the Windows equivalence of deb file in Debian?
In Debian/Ubuntu, after I compile a program into an executable, I can create a deb file out of the executable using a program called checkinstall. Then I can install a deb file by dpkg.
In Windows,
what is the program/command that can create a msi file from an executable built from source code?
What is the program/command that can install a msi file?
Thanks.

The Windows Installer consists of an SDK, database specification and runtime service. Introduced in 1999, it originally had redistributables that were nesseccary to "bootstrap" onto the system before and MSI could be installed. Various versions of this runtime have been been baked into various versions of Windows for a very long time now so generally this is no longer a concern. You can simply install the MSI.
Technically the SDK does come with some tools that could be used to create an MSI. However this would be like using notepad and CSC to write a .NET app. Almost no one would actually do it this way. One notable tool does come from the SDK: ORCA.exe. ORCA is a database editor which is very useful for examining MSIs and making minor modifications to already built MSI. It technically can be used to create an MSI but very few outside of Microsoft back in the early days ever did.
For the most part Microsoft left installer authoring tools to third parties. Windows Installer XML (open source), Industrial Strength Windows Installer XML (open source), InstallShield, Visual Studio Deployment Projects, InstallAware and AdavancedInstaller are a few to list. It is outside of the scope of Stack Overflow but I will link a 2 minute video showing how to use Visual Studio, WiX and IsWiX to create a simple MSI with a shortcut for a single EXE:
https://www.youtube.com/watch?v=nnV_OU6fk8c
Disclosure: I'm the project maintainer for the IsWiX on GitHub.
As for how to install an MSI. An MSI is a database not a program. It is installed by the Windows Installer service msiexec.exe
There is an extensive command line documented at:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx

There is no standard tool for creating MSI installer files. There are many, many third-party tools, free and paid, that will help you to create MSIs; you'll have to do some searching and comparing and figure out what works best for you. The command to install an MSI is the MSI itself, you don't need to explicitly run it with any other program like you do with deb/rpm packages.

Related

How does a (windows) installer contain files?

Just wondering how an installer such as a setup.exe contains the files it's supposed to install, when it's an offline installer. I get that I can create a msi or a setup.exe easily in Visual Studio, but what if I, for example, would want to write an installer with a custom gui with raw c++ (if possible)? How does a singular executable contain all the necessary files (such as the dll's)?
As Ken said, Windows Installer is a complex service. If you are into learning about it here are some resources:
Intro for Windows Installer:
https://learn.microsoft.com/en-us/windows/win32/msi/windows-installer-portal
How files are bundled inside an MSI:
https://learn.microsoft.com/en-us/windows/win32/msi/using-cabinets-and-compressed-sources
If you just want to build a native MSI use existing tools, there are plenty of options free or paid.

Creating .msi using Visual & Install (unSigned) and Visual Studio Community 2015 [duplicate]

Is there any way to compile the Nullsoft Installer Script (NSI) setup as a MSI package instead of an EXE?
Unfortunately, No.
NSIS lets you create scriptable, procedural installation packages. It's simple, easy to use and has a number of features not present in Windows Installer.
Windows Installer (MSI) creates database driven, transactional installation packages. When written properly a Windows Installer package is very robust, a file gets corrupted/deleted and it will be automatically reinstalled. Windows Installer is aware of UAC and only elevates when required, basically if you're creating software for the corporate market, you will need to provide an MSI.
Check out The Definitive Guide to Windows Installer for a good introduction to understanding MSI.
NSIS installers can be wrapped in MSI files using the MSI Wrapper. It is a small tool that I made for wrapping NSIS and Inno Setup installers. It uses WiX to compile the MSI but there is a GUI to help you instead of an XML file.
It was made because I needed a tool for creating MSI files based on traditional EXE installers. I needed support for uninstall and upgrades and only wanted the wrapped installers to show up once in the Add/Remove programs in the control panel.
I also wanted to be able to pass command line parameters to the wrapped installer when the MSI is installed.
If you want to use it or help me improve it, you can find it at http://www.exemsi.com.
I share the opinion that wrapping an executable installer in an MSI package is not the ideal solution. However, when you already have the exe it can make a lot of sense :-)
No (And there are no plans to support .MSI output), try WIX

How to create an Installer for multiple applications

My problem is the following:
I have multiple applications that I want pack in one installer so when the user runs it, they will be installed automatically instead of installing or copying each single application.
I have a program that's already a setup file (.exe) and two .exe files which can be executed manually and do not need an installation. So what I want is:
Build an installer so when the user opens it - the .exe file of the setup program gets installed and the other applications which dont need to be installed will be copied somewhere in a path.
Whats the best solution?
I think you need a packaging programs to create an installation package, such as:
AdvancedInstaller
InstallShield
InstallAnyware
The first two of them have a freeware version. Maybe you can see if the required features are available in the freeware version.
I would suggest Advanced Installer (allows easy chaining of installs) if you have no significant deployment experience. Otherwise I would suggest Wix and its "Burn" feature (ability to chain installers in sequence). Please read the following answers for context:
What installation product to use? InstallShield, WiX, Wise, Advanced Installer, etc
Windows Installer and the creation of WiX
Wix to Install multiple Applications
Read this if you want to get going with Wix quickly

How do I create a packaged installer that will install multiple applications, similar to XAMPP?

I'm trying to put together an installer package that will install VS2010, SQL Server 2008 R2, and some other development tools into a single executable installer. The idea is to create something similar to XAMPP's installer that installs Apache, PHP, Perl, and MySQL in one convenient installer.
The installers for almost every program are .msi files. Are there any applications that can 'package' all the installers into a single executable? Barring that, what other solutions are there out there to perform something like this? I've looked into using a batch file with the /passive switch for each .msi so it does an unattended install, but I'd like to make it look like a GUI application if at all possible.
Many commercial setup authoring tools offer more or less support for this. You basically create an EXE or MSI installer which acts as a wrapper for existing third-party packages.
Usually these packages are added as prerequisites, but they can also be executed through custom actions.
You can find a list of setup tools here:
http://en.wikipedia.org/wiki/List_of_installation_software
Another solution is to create your own EXE wrapper which shows custom UI and handles the third-party packages.

Why Visual Studio creates .exe installer files?

when I build solutions in Visual Studio, that generates installer files as .exe and .msi, .exe files are useful for what?
The .EXE file that is created by the installer project is a bootstrapper for the .MSI setup file. It is used to launch the .MSI setup file.
Generally, both will launch the setup program and allow the user to install the application. However, sometimes the setup.exe file will run a custom validation routine to determine if the user's computer meets the minimum requirements for installing the software.
For example, if the user does not have Windows Installer, they will not be able to launch the .MSI file, but the .EXE application will still run and inform them that they need to install Windows Installer first. For .NET applications specifically, the .EXE file verifies the presence of the appropriate version of the .NET Framework, and if it is not present, it prompts the user to download and install it.
You can customize the prerequisites that are required for your application in your installer project using Visual Studio. See these MSDN articles for details on how to do that:
http://msdn.microsoft.com/en-us/library/ms165429(v=VS.100).aspx
http://msdn.microsoft.com/en-us/library/7eh4aaa5(v=VS.100).aspx
Others have commented on the how (.exe bootstraps the .msi) but part of the reason why is that users know that .exe files are the things you run. I don't think your average user knows that .msi files are something that you can click on to install an application.
The .exe file is made for installing the prerequisites of your application.
Let's say your application uses the .Net 3.5 framework, you can tell the installer project to include the installation of the needed libraries if they're not already installed.
You may also deactivate it, so only the .msi is being created.
This page shows how to activate and configure the prerequisites setup, just uncheck the checkbox in order to deactivate it.
You also find more details on the process of Bootstrapping on MSDN:
the capability to automatically detect
the existence of components during
installation and install a
predetermined set of prerequisites
.exe files are useful for executing your programs that you've just built in Visual Studio, assuming you're not doing web applications.
Pretty much every Windows program out there is executed using files with an .exe suffix.
Installer exe files are normally just the msi wrapped in a bootstrapper. The bootstrapper can do anything, but normally its purpose is to ensure the user is running a sufficient version of Windows Installer, then extract the msi and invoke msiexec.exe to start installing the msi. Generating installers as exe's is deprecated these days, but some still do it.

Resources