Interface IUpdaterLauncher
Contract for launching and monitoring the external updater process.
public interface IUpdaterLauncher
Methods
LaunchUpdater(string, string, string, string, Action, Action<string>)
Launches an external updater executable and hands control of the install over to it.
IMPORTANT: This method returns an IEnumerator and the caller
MUST invoke it via MonoBehaviour.StartCoroutine. The implementation
uses yield return new WaitForSeconds(...) which requires a Unity
coroutine host with a main-thread UnitySynchronizationContext. Calling this
method outside of a Unity coroutine context (e.g., from a thread-pool thread
or without a MonoBehaviour) will result in undefined behavior.
Implementations must not block until the updater exits. The updater terminates the calling process by PID before patching and relaunches the client afterwards, so waiting for its exit is a mutual wait that strands every completion path.
IEnumerator LaunchUpdater(string updaterPath, string currentClientVersion, string latestServerVersion, string patchesDirectory, Action onComplete, Action<string> onError)
Parameters
updaterPathstringThe full path to the updater executable.
currentClientVersionstringThe current version of the client.
latestServerVersionstringThe latest version available on the server.
patchesDirectorystringThe directory the patch archive was downloaded into.
onCompleteActionCallback invoked once the updater has started successfully and taken over. This signals a successful handoff, not a completed patch — the caller should shut the launcher down so the updater can replace the client binaries.
onErrorAction<string>Callback invoked with an error message if the updater fails to launch or exits with an error before handoff.
Returns
- IEnumerator
An IEnumerator for use in a Unity Coroutine.
Remarks
The patch directory is passed explicitly rather than left for the updater to derive. Both sides defaulting to "Patches under the install root" agreed only by convention, and the failure when they disagreed was silent: the updater found no archive, did nothing, and relaunched the client at the same version, so the launcher immediately detected the same mismatch and tried again forever.