Table of Contents

Class SelfUpdater

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

Replaces the running application with an already downloaded and verified package, then restarts it — the same "press Update and it just happens" behaviour on every platform.

Each platform ships differently, so each is applied differently: Windows runs the silent installer, Linux swaps the AppImage file the app is running from, and macOS mounts the .dmg and replaces the .app bundle. What they share is the shape: nothing is touched until a complete, checksum-verified package exists on disk, and any failure leaves the current install working.

public static class SelfUpdater
Inheritance
SelfUpdater
Inherited Members

Properties

Blocker

Why an in-place update isn't possible here, or null when it is.

public static string? Blocker { get; }

Property Value

string

Remarks

Not every install can replace itself: an AppImage moved into /opt by root, a macOS bundle in a read-only location, or the app started straight from dotnet run. Those cases fall back to opening the release page, which is what every platform but Windows used to do unconditionally.

CanUpdateInPlace

public static bool CanUpdateInPlace { get; }

Property Value

bool

Methods

Apply(string)

Applies packagePath and relaunches. The caller must have verified its checksum and stopped the servers first.

public static void Apply(string packagePath)

Parameters

packagePath string

PackageFileName(string?)

What to call the downloaded package on disk.

public static string PackageFileName(string? assetName)

Parameters

assetName string

Returns

string