question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement a publisher

See original GitHub issue

Introduction

As this project seems to be my main alternative to Squirrel while converting my apps to .NET Core 3.1 / .NET FW 5, I would like to put out the idea of a dedicated (Windows) installer / publisher in similar fashion to Squirrel. (I will be using the term .NET 5 for whatever the correct version will be.)

Notes

I guess making the Installer/Uninstaller parts are the hardest, however I will have to replace Squirrel eventually and it’s good to have some plan at least. This project does not need to be made under the Onova name, but if I ever start working on this, I will fork Onova. If Squirrel finishes the rework on time, I guess this will not be as needed. But still, I have issues even with the current working Squirrel so creating this would still benefit me (at least).

Publisher

  • Implemented in .NET 5
  • Available NuGet as Onova.Publish
  • Works the same as dotnet publish, except it creates additional files for the Onova update system

Input

  • Config file (e.g. some simple XML, not necessarily NuGet nuspec)
  • CLI (publisher.exe -> read config file from $(SolutionDirectory) -> output to ReleaseDir)

Output

  • Zip package

  • Changelog file

    • Version A - Read config file and append the changelog entry into a unified CHANGELOG file with version tags

      • This would mean that the Resolver would have to fetch just one file to get the whole changelog
      • On the other hand, the Resolver would have to use some sort of regex to find the last entry
      • The changelog could get gigantic and would defeat the purpose of this system
    • Version B - Copy changelog from config and paste to a new .changelog file that will have the same name as the zip package

      • Probably easier to implement and suits my use case better
      • If you want to show the user a list of all changelogs, you have to iterate over the manifest file and fetch all changelogs
    • Reason for this:

      • I need to show the user a changelog before the download happens, currently in Squirrel I just put it into a nuspec and then during update I fetch the whole package, before the user clicks yes/no (which is obviously bad in every aspect I can think of)
    • This feature also needs to implement custom Resolver (probably can reuse WebResolver)

  • Manifest file (publisher scans ReleaseDir for *.zip and creates text file for WebResolver)

  • Installer file (executable installer that embeds the zip for the newest version)

    • Must also contain an uninstaller
  • Hash file

    • Only a suggestion to implement - it is not required but I guess that it would be nice if the updater could also fetch a hash of the update package and check it in similar fashion to Squirrel

    • Why a standalone file? - The manifest file for WebResolver already contains the version number, I guess it could also be appended after the package URL to not break existing Resolver infrastructure (haven’t looked into the implementation)

    • Suggestion: If both Changelog and Hash files will be implemented, it is advised to create new Resolver that will get everything under one roof (e. g. AdvancedWebResolver)

Installer

  • This file is generated using Onova.Publish

  • Probably compiled at runtime (during publish) using Roslyn

  • Version A

    • Implemented in .NET 5
    • Uses the trimmed (.NET 5 containing) single package or the single file package with prompt to install if FW is missing, whichever actually works
  • Version B

    • Implemented in .NET 4.6.1
    • Nothing extra should be needed, let’s assume every system has this FW
    • We can check if .NET 5 is installed

Properties

  • Executable (.exe) file
  • Contains the newest .zip package from publish
  • Installer and uninstaller have icons (set in the publisher config)

Run

  • Creates a folder in %localappdata% and extracts the embedded zip package
  • Creates entry in Start Menu (also creates app publisher’s name folder)
  • Creates Windows registry entry for uninstaller
  • Run the app itself after installation

Uninstaller

  • Do whatever works on Windows to uninstall the correct files and itself (probably the same as Squirrel)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dady8889commented, Jul 21, 2021

Hey, just wanted to let you know that I have actually made it. You can check it out here.

0reactions
Tyrrrzcommented, Jul 21, 2021

@dady8889 that’s pretty sick, thanks for sharing 😮👏🏻 I’ll add a mention to the readme ✨

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a publication in Publisher
Open Publisher. If you're already in Publisher, select File > New. · Select or search for a template: Select a FEATURED template. Select...
Read more >
A C++ Implementation of Publisher-Subscriber
}; A publisher maintains a list of pointers to subscribers. Monitors implementing the subscriber interface can add themselves to the list using subscribe(), ......
Read more >
Mastering own Reactive-Streams implementation. Part 1
Through this topic, I will share basics coding steps, pitfalls, and patterns that will be useful for future implementors. In the first part...
Read more >
Publisher-Subscriber pattern - Azure Architecture Center
Learn about the Publisher-Subscriber pattern, which enables an application to announce events to many interested consumers asynchronously.
Read more >
How to implement Flow Publisher interface in Java 9
A Publisher interface is a provider of an unbounded number of sequenced elements, publishing them according to the demand received from its ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found