nexdome / ASCOM

NexDome ASCOM Driver
https://www.nexdome.com
MIT License
6 stars 7 forks source link

Package the firmware updater as a "trimmed, single-file stand-alone executable" #8

Closed NameOfTheDragon closed 4 years ago

NameOfTheDragon commented 5 years ago

The firmware updater is a .NET Core application that is published as a stand-alone executable. This has the advantage that end users don't have to install any runtimes to use it, but the disadvantage that it comes with about a zillion DLLs that make up the .NET Core runtime, which had to be copied into the installer and deployed to the end user system.

.NET Core 3.0 has some new build options that enable everything to be rolled into one single executable file. This includes all of the .NET Core runtimes and even the AVRDude programmer. One file to deploy, which is much cleaner.

The new build switches can be added on the command line or hand-edited into the *.pubxml publishing profile. The next version of Visual Studio will have these in the user interface but for now they have to be added manually. Here's an example:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PublishProtocol>FileSystem</PublishProtocol>
    <Configuration>Release</Configuration>
    <Platform>x86</Platform>
    <TargetFramework>netcoreapp30</TargetFramework>
    <PublishDir>bin\Release\netcoreapp30\publish\win-x86\</PublishDir>
    <RuntimeIdentifier>win-x86</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <PublishSingleFile>true</PublishSingleFile>
    <PublishTrimmed>true</PublishTrimmed>
    <PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>
    <_IsPortable>false</_IsPortable>
  </PropertyGroup>
</Project>

This would make for a simpler and more robust installed and should be added to the next release.