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, package, verified by checksum and by the publisher's signature, 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
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
Methods
ApplyAsync(VerifiedPackage)
Applies package and relaunches. The caller must have verified its
checksum and signature (that is what AppUpdateCoordinator.VerifiedPackage is)
and stopped the servers first.
public static Task ApplyAsync(AppUpdateCoordinator.VerifiedPackage package)
Parameters
packageAppUpdateCoordinator.VerifiedPackage
Returns
Remarks
The package sat on disk between that verification and now, in a folder the user can write to, so each platform checks it once more at the point of use: Windows in the helper that runs the installer (see McServerLauncher.Services.UpdateHelper), Linux on the copy it is about to move into place. macOS does not: its script runs as the user and replaces an app the user can already replace, so there is no privilege for a swapped file to gain.
PackageFileName(string?)
What to call the downloaded package on disk.
public static string PackageFileName(string? assetName)
Parameters
assetNamestring