Build an msi package for Csharp using WiX
Preface
This page will describe in short terms how to build an msi package for an Csharp (C#) project. The resulting package will not give the end user any installation options to choose between.
Prerequisites
- Visual Studio. I used 2015 version.
- An C# project that does not need the end user to select install options.
- WiX --> http://wixtoolset.org/releases/ This was written while v3.10.3 was lates stable release.
- WaX --> In VS 2015 go to "Tools" -> "Extensions and updates", then click "Online" and in the search box type “wax”
Step by step
- Install WiX
- Install WaX
- Open the C# project solution you want to build an msi package for.
- Add a WiX setup project to the solution.
- Mark your solution in the solution explorer.
- Click "File" -> "Add" -> "New Project"
- Search for “Windows installer XML”
- Select "Setup project"
- Type in a name but know that this will be the filename of your msi package. I will use 'SetupProject' from now on and this will result in SetupProject.msi as filename.
- Click "Tools"
- Select "Wix Setup Editor"
- "Setup project to edit:" should already be filled in as "SetupProject (..\SetupProject)"
- As "Root directory" select "INSTALLFOLDER (SetupProject)"
- Select the "Projects to install" by ticking them off in the list of avilable projects in your solution.
- Click the + sign to the right of all the "Directory mappings"
- Click the + sign to the right of all the "File mappings"
- Make sure you see 5 green circles with a white checkmark in the WaX window, indicating that all is fine
- Close the WaX window on the X in top right corner.
- Save all file changes by pressing [CTRL + SHIFT + S] i Visual Studio.
- Open / Go to "Product.wxs" file in Visual Studio.
- Find the XML line that starts with <Product Id="*"
- The Manufacturer="" cannot be empty so fill in something reasonable.