Class DetachedUpdater
- Namespace
- JD.AI.Core.Installation
- Assembly
- JD.AI.Core.dll
Launches a self-update as a detached, out-of-process script so the running binary can be replaced after the current process exits.
On Windows, executable files are locked by the OS while running, so
dotnet tool update -g JD.AI fails in-process. This launcher writes
a temporary script that waits for the parent process to fully exit (by polling
the PID), then performs the update. On Unix, file replacement works while a
process is running, so this is only used on Windows.
public static class DetachedUpdater
- Inheritance
-
DetachedUpdater
- Inherited Members
Methods
Launch(string, string?, bool, bool)
Launches an out-of-process updater that runs dotnet tool update -g <packageId>
after the current process exits. Returns immediately.
public static InstallResult Launch(string packageId, string? targetVersion = null, bool visibleWindow = true, bool pauseOnExit = true)
Parameters
packageIdstringThe dotnet tool package ID to update.
targetVersionstringSpecific version to pin, or null for latest.
visibleWindowboolWhether to launch a visible terminal window for update progress.
pauseOnExitboolWhether to pause at the end of the updater script.
Returns
- InstallResult
An InstallResult with
LaunchedDetached = trueon success.