1

I have a utility editor application that goes with another main application. The main application is a Windows EXE usually, but there is also a Unix and a Mac version. This application was written by another company for us. It is not C#.

We have a utility editor program that works with the main application. The original version is a WinForms app, but it is showing it's age and some of the functionality no longer works on today's Windows. So the app is being rewritten in WPF with .NET Core 3.1, with the hope that maybe we will also compile it for Unix and Mac someday, if possible. They want it to be a stand-alone app so it can more easily be used by students at different universities and other organizations. Click-Once, MSIX, and copying larger folders are not options. They want a standalone EXE(s) they can upload/distribute for 32 and 64 bit Windows initially, often sent on DVD.

But I am having build issues for WPF. I have tried to publish the app, and the VS Installer add-on, but they were failures, which appears to be the common complaint on the internet. For some reason, you always end up with a DLL application instead of an EXE, and it doesn't run and I am not alone per the discussions on the internet. I am thinking is has something to do with the .NET Core but I just don't know enough about it to know how to resolve it. One article hinted that the DLL might be the portable part, and then you need a platform specific module that runs it??? Did I misunderstand that? If so, How do I create one?

I am now looking into third party tools. It appears Wix might be worth exploring, but the learning curve is billed as large, so the boss is nervous. I am also not sure about the Unix or Mac builds. Will those be different tools yet again? According to this it probably is, but this is 2 years old: How to build installers for .NET Core app?

Has anyone been successful in building a WPF .NET Core 3.1 setup.EXE that actually installs a usable application? If so, what tools did you use? Can you provide any advice for what I might be missing? I can get the setup.exe, but the app that it installs is not usable.

I would be ever so grateful for any help you can provide. This community has been SOOO helpful to me for many years and I can usually find the answer from previous questions without ever asking anything myself. So I have no rating. But I have been a user for over 10 years! Please don't hold that against me? But this time I am stumped. It could just be I am tooo new to .NET Core (first app in it) and I don't have the right search terms. I am usually a Web developer. But Web is not an option here.

Thank you for your consideration, MLY

mly
  • 51
  • 5

1 Answers1

2

A bit late, you might have already figured out a solution, but for anyone else wondering.
One way is to use ClickOnce.

If using Visual Studios, you should be able to right click your main project and select "Publish". Then you should be able to click "New" publish profile. From the options that come up you can either select "ClickOnce", and then you should be presented with some settings. For you, most importantly, would be two of those tabs, "Install location" and "Configuration". In the former you can choose "From cd/dvd, or usb" since you mention that is a method of delivering the executable you will need.
And in the latter, you can select "Deployment mode" to be "self-contained", and under "File-publish options" choose "Produce single file".

This should ultimately produce an EXE for your application that can be used as a standalone. Note that using VS19 there are some issues that seem to not allow this to happen https://github.com/dotnet/sdk/issues/11351 However using VS22 this does not seem to be an issue, I at least have not experienced it there.

For more information https://learn.microsoft.com/en-us/dotnet/desktop/wpf/app-development/deploying-a-wpf-application-wpf?view=netframeworkdesktop-4.8 https://learn.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-using-clickonce-folder?view=vs-2022

Also, F.Y.I, WPF applications only run on windows, so you wont be able to deploy them on Mac or Unix at all. There is some community support for using Xamarin.Forms with WPF, but if you need multi-OS deployment you should not start developing this application with WPF in the first place.

dbonstack
  • 49
  • 4