86

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?

Daniel Rikowski
  • 71,375
  • 57
  • 251
  • 329

9 Answers9

57

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

WiX Tutorial - Creating an Installer MSI with Wix

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130
mezoid
  • 28,090
  • 37
  • 107
  • 148
  • Wix has a somewhat steep learning curve, but it is hands down the most reliable way to generate an MSI file. – Stein Åsmul Jun 11 '11 at 03:04
  • 3
    Here is a list of ["**get started with Wix links**"](http://stackoverflow.com/questions/25004226/msi-vs-nuget-package-what-is-better-for-continues-delivery/25005864#25005864). – Stein Åsmul Apr 29 '15 at 07:59
  • I've been using WiX for more or less to years. I have to say, yes, it's a bit annoying when learning how to use it. But once you understand it, it's ok. But I'm trying to add the generated msi to a custom .exe, with no luck... Do you know how can I embed the resulting .msi into a custom setup.exe? – Sonhja Jun 08 '15 at 14:30
  • @Sonhja That's a very good question. You should consider asking it as a separate question on Stackoverflow. – mezoid Jun 11 '15 at 00:49
  • 2
    Give [WixSharp](https://wixsharp.codeplex.com/) a look, instead of modifying the XML by hand you write C# code to create your installer. – Daniel Jun 02 '17 at 00:21
17

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 :)

saschabeaumont
  • 22,080
  • 4
  • 63
  • 85
15

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.

Bogdan Mitrache
  • 10,536
  • 19
  • 34
Timotei
  • 1,909
  • 2
  • 22
  • 31
  • 5
    NSIS does not create MSI packages, does it (haven't checked in some time)? – Thorsten Dittmar Jun 25 '09 at 07:40
  • mhh... winamp's setup is .msi. and is created by NSIS:D – Timotei Jun 25 '09 at 09:32
  • 3
    See this question regarding creating MSI in NSIS. Short: It is not possible, and it will not be supported. http://stackoverflow.com/questions/1858434/build-nsis-script-as-a-msi-package – jonathan Oct 08 '13 at 12:03
  • 1
    AdvancedInstaller is great if you can afford to buy the professional version, which can make signatures part of the deployment cycle. NSIS does not make .msi, and takes some scripting to get working, but does the job of installing and uninstalling. – hg. Apr 03 '14 at 13:22
13

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.

Bogdan Mitrache
  • 10,536
  • 19
  • 34
the.jxc
  • 3,373
  • 21
  • 21
13

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

recvfrom
  • 389
  • 6
  • 14
  • I chose this one because it's what in my existing project but the project file cannot be loaded. So I followed this then after this I saw the Setup project now being loaded. – user3856437 Sep 24 '21 at 19:40
8

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...

  • Cool. Thx. It was most simple installer. Here is video for it install and use: https://www.youtube.com/watch?v=fehVTLNQorQ – Dmitry Dronov Jun 18 '20 at 16:05
2

Look for Windows Installer XML (WiX)

Thorsten Dittmar
  • 55,956
  • 8
  • 91
  • 139
1

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!

grg
  • 5,023
  • 3
  • 34
  • 50
William Leara
  • 10,595
  • 4
  • 36
  • 58
  • 4
    Installshield is also insanely buggy unfortunately. Another alternative used to be Wise from Altiris, but I believe this has now been bought out by Symantec. The safe option is to use Wix. It is fully capable, free, and worth the learning curve. – Stein Åsmul Jun 11 '11 at 03:02
  • I should clarify that the bugs in Installshield are concentrated in the problematic Installscript MSI project type. – Stein Åsmul Sep 01 '14 at 01:01
1

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.

Aleph0
  • 5,816
  • 4
  • 29
  • 80