How can I create an MSI setup?

InstallationWindows Installer

Installation Problem Overview


I've created setups for all my Delphi tools with Inno Setup for years. Now some users rather want an MSI installation package, so they can deploy the setups from a central server to all workstations.

How do I create one? Do I have to buy Visual Studio or some other product?

Installation Solutions


Solution 1 - Installation

You can use Wix (which is free) to create an MSI installation package.

WiX Tutorial - Creating an Installer MSI with Wix

Solution 2 - Installation

If you don't understand Windows Installer then I highly recommend The Definitive Guide to Windows Installer. You can't really use WiX without understanding MSI. Also worth downloading is the Windows Installer 4.5 SDK.

If you don't want to learn the Windows Installer fundamentals, then you'll need some wizard type package to hide all the nitty gritty details and hold your hand. There are plenty of options, some more expensive than others.

  • InstallShield
  • Advanced Installer
  • MSI Factory
  • etc..

However still I'd suggest picking up the above book and taking some time to understand what's going on "under the hood", it'll really help you figure out what's going wrong when customers start complaining that something is broken with the setup :)

Solution 3 - Installation

You can use Visual Studio - that's paid.

You can use https://www.advancedinstaller.com/ - that has a free edition.

You can use http://nsis.sourceforge.net/Main_Page - for example Winamp uses this installer - and is very configurable and is Open Source.

Solution 4 - Installation

Google "Freeware MSI installer".

e.g. https://www.advancedinstaller.com/

Several options here:

http://rbytes.net/software/development_c/install-and-setup_s/

Though being Windows, most are "shareware" rather than truly free and open source.

Solution 5 - Installation

You can use "Visual studio installer project" and its free...

This is very easy to create installer and has GUI.(Most of the freeware MSI creation tool does not have a GUI part)

You will find many tutorials to create an installer easily on the internet

To install. just search Visual Studio Installer Project in your Visual Studio

Visual Studio-> Tools-> Extensions&updates ->search Visual Studio Installer Project. Download it and enjoy...

Solution 6 - Installation

In Visual Studio (including the free community editions) you can install the Microsoft Visual Studio Installer Projects extension [1] which allows you to create an MSI installation package. To install it from within Visual Studio:

  1. Go to Extensions -> Manage Extensions in the menu bar
  2. Search for Installer Projects in the search box
  3. Select Microsoft Visual Studio Installer Projects and hit Download
  4. Restart Visual Studio

Once the extension is installed, you'll create a new project that will contain all of the files and settings for the MSI. To do this:

  1. Go to File -> New -> Project in the menu bar
  2. Change the drop down menus visible to show All languages, All platforms, and All project types respectively
  3. Scroll down in the project type list and towards the bottom select Setup Wizard: Create a Windows Installer project with the aid of a wizard.
  4. Hit Next.

Work through the prompts to choose the installer project name and location. Choose Create a setup for a Windows application at Step 2 and in Step 3 choose the executable and other files that should be included in the MSI (hit Add..). At the end, hit Create.

To build the actual MSI go to Build -> Build Solution in the top menu, and you should see a message like the following in the Output window:

Build started...
------ Starting pre-build validation for project 'Setup1' ------ 
------ Pre-build validation for project 'Setup1' completed ------
------ Build started: Project: Setup1, Configuration: Debug ------
Building file 'C:\Users\zelda\Source\Repos\Setup1\Setup1\Debug\Setup1.msi'...
Packaging file 'test.exe'...
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

What's created by default is a very basic MSI, but for additional configuration like creating custom actions, adding/changing registry keys, configuring the user interface associated with the MSI, etc., see the full documentation [2]

[1] https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2017InstallerProjects

[2] https://aka.ms/vdproj-docs

Solution 7 - Installation

Look for Windows Installer XML (WiX)

Solution 8 - Installation

You can purchase InstallShield, the market leader for creating installation packages. It offers many features beyond what you get with freeware solutions.

Warning: InstallShield is insanely expensive!

Solution 9 - Installation

In my opinion you should use Wix#, which nicely hides most of the complexity of building an MSI installation pacakge.

It allows you to perform all possible kinds of customization using a more easier language compared to WiX.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDaniel RikowskiView Question on Stackoverflow
Solution 1 - InstallationmezoidView Answer on Stackoverflow
Solution 2 - InstallationsaschabeaumontView Answer on Stackoverflow
Solution 3 - InstallationTimoteiView Answer on Stackoverflow
Solution 4 - Installationthe.jxcView Answer on Stackoverflow
Solution 5 - InstallationKarthikeyan SubramanianView Answer on Stackoverflow
Solution 6 - InstallationrecvfromView Answer on Stackoverflow
Solution 7 - InstallationThorsten DittmarView Answer on Stackoverflow
Solution 8 - InstallationWilliam LearaView Answer on Stackoverflow
Solution 9 - InstallationAleph0View Answer on Stackoverflow