Artifix
Artifix

Reputation: 71

How to create .msi installer for self contained console app Visual Studio C#

I've got a console application written in C# .netcore 2.1

    using System;
    using System.Net;
    using System.Net.Http;
    using System.IO;
    using Newtonsoft.Json.Linq;  (Nuget package)

what works: I'm able to publish it to a folder as a self contained application. This spits out the exe file along with all the .dll required. (i can move this folder where ever i want and adding it to path allows me to run the console applicaiton as intended)

The problem I'm having is creating an .msi installer that will create a self contained console app.

What isn't working: I'm using MS VS Installer Projects. I add a Setup Project to my solution and in the File System I add the primary output for my program. annd "BuildProjecTOIutputGroupDependencies". Creating this .msi it installs only some of the libraries I have in my self contained publish folder and is also missing the program.exe

I'v tried manually adding the assemblies to the Application Folder like throwing it was missing and the .exe but then i got errors that .netcore was missing when trying to execute my application.

All my research leads to windows forms project msi's nothing on console applications (more specifically with additional dll's)

Any assistance would be appreciated. Thank you.

Upvotes: 2

Views: 7162

Answers (1)

Artifix
Artifix

Reputation: 71

Was able to complete the process with the Wix toolset recommendation. thx for the comments pointing me to a good tool.

The documentation is a bit much for a biginner. Found a good tutorial however on youtube. He goes through very detailed explanation and does it from scratch. Though I'd share incase anyone else runs into this question. Was able to create the msi and deploy as needed.

How To Create Windows Installer MSI (for .Net Core Wix):

Upvotes: 3

Related Questions