2

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.

Artifix
  • 61
  • 1
  • 8
  • Have you tried to use Wix toolset for that? Add everything manually to installer or autogenerate the source file for installer. Msi just a container for your files – Pavel Anikhouski Nov 22 '19 at 20:00
  • at this point I've wasted a few days so I'll give it a try... i'm just hopelessly trying things with MS VS package installer.. thx @PavelAnikhouski – Artifix Nov 22 '19 at 20:14
  • Just lobbing a link your way for now: [WiX quick start tips](https://stackoverflow.com/questions/25004226/msi-vs-nuget-packages-which-are-is-better-for-continuous-delivery/25005864#25005864). [Alternative MSI tools](https://stackoverflow.com/questions/50225031/windows-service-not-shown-in-add-remove-programs-under-control-panel/50229840#50229840). And [a gateway to all things Advanced Installer](https://www.advancedinstaller.com/forums/viewtopic.php?f=5&t=29130) (commercial tool). – Stein Åsmul Nov 23 '19 at 11:12

1 Answers1

2

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

Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140
Artifix
  • 61
  • 1
  • 8
  • I forgot about that video, I have seen it before actually, and I have now added it to that ad-hoc link list of mine. Thanks for the update. Careful adding comments as answers, they close things aggressively here. However, in your case the link is actually a good answer I think, so should be OK. Took the liberty of formatting your answer a little. Hope it is OK. – Stein Åsmul Nov 26 '19 at 00:32
  • If you migrate to .NET Core 3.x, then the single file option is much simpler. Even if you still want a MSI package, you just pack up one file. – Lex Li Nov 26 '19 at 02:28
  • 1
    Do you have any samples of that Lex Li? Github.com? – Stein Åsmul Nov 26 '19 at 10:51