3
votes

I have created a C# application in Visual Studio 2017. Now I would like to distribute my application as a single windows installer file. I was hoping for a simple one-click solution (select all the files I want to include -> voila! there's the installer). But it seems to be not that easy :-(

I often read that Visual Studio supports setup projects. But that does not seem to be the case anymore, right?

Third party tools are either very complicated (e.g. Wix, Inno Setup) or very expensive (e.g. Advanced Installer).

Is there really no simple way to wrap some files in an .msi Windows installer? Does Microsoft provide no tooling to create such installers?

3
Did you try NSIS, it is free and not that hard to use. I use only this, therefore I can not help you with .msi installer.Julo
Added some links to descriptions of both MSI and non-MSI tools. Just for reference.Stein Åsmul
See Damien_The_Unbeliever's answer for very good point on build automation.Stein Åsmul

3 Answers

3
votes

or very expensive (e.g. Advanced Installer).

There is a also a free edition which includes a Visual Studio extension for Advanced Installer, which you can use to build MSI packages.

The following tutorial shows how you can use the features from the free edition ("Simple" project type):

P.S. I work on the team building Advanced Installer.

5
votes

At one point, Microsoft did remove the "Visual Studio Installer Project" support from Visual Studio1. And then they later relented and added support back. I can't remember which versions didn't have support, I think it was 2012 and 2013.

These days (for VS2017), to get the Visual Studio Installer Project support, you add it from the marketplace:

This extension provides the same functionality that currently exists in Visual Studio 2015 for Visual Studio Installer projects. To use this extension, you can either open the Extensions and Updates dialog, select the online node, and search for "Visual Studio Installer Projects Extension," or you can download directly from this page.

Personally, however, I'd go with WIX. It does have a learning curve but I think it's learning worth doing.


1For what I personally see as very good reasons. You had to have a full-blown install of Visual Studio to make them work, they didn't really integrate with MSBuild, which makes them a pain if/when you want to move to automating your builds.

4
votes

VS Installer Projects: Several good answers already - worth trying out. As stated by others you can use Microsoft Visual Studio 2017 Installer Projects - as limited as they are (bullet list form). They feature some pre-requisite functionality as I recall. I have limited experience with the tool. Could work for something very simple, but you will quickly discover limitations.

WiX: Personally I would use WiX since it is also free and flexible - it takes some effort, but is very capable. Here is a WiX quick start tip answer (frankly not my favorite answer, but it has been upvoted more than usual and updated frequently - hopefully it still has its essence of helpfulness).

IsWiX: There is also IsWix - a GUI tool to help create WiX setups (Chris Painter's work). His WiX tutorials and a quick youtube demo.

Et Al: The commercial tools (Installshield, Advanced Installer (see Bogdan's answer in this "thread"), PACE Suite, etc...) are also good - your time costs too. Can be shocking once you add it up - and you will definitely get running quicker with a commercial tool. How to create windows installer (links to pretty comprehensive lists of tools and some MSI information). Further links below.


Other than that, I'll just link to a few pre-existing answers with info about various tools: