C# – Wrap C# application in .msi installer

cnetwindowswindows-installer

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?

Best Answer

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.

Related Topic