Drop legacy PSLauncher.exe backward compat (not in prod yet)
Simplifies the rename done in ce3979d : PS_Launcher.exe is the only
name. Removes the dual-path lookup in LauncherSelfUpdater, the
duplicated taskkill blocks in the .bat scripts, the legacy patterns
in .gitignore, and the explanatory comments about the migration.
Cleaner code, single source of truth for the binary name.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,11 +44,7 @@ public sealed class LauncherSelfUpdater : ILauncherSelfUpdater
|
||||
IProgress<DownloadProgress>? progress,
|
||||
CancellationToken ct)
|
||||
{
|
||||
// 1. Localise le launcher en cours d'exécution. Le nom du fichier peut varier
|
||||
// selon l'install : PS_Launcher.exe (nouvelles installs >= v0.14.0) OU
|
||||
// PSLauncher.exe (anciennes installs auto-updatées qui ont gardé leur nom
|
||||
// de fichier). On prend le nom courant tel quel — l'updater écrasera ce
|
||||
// fichier sans le renommer, donc le nom historique perdure sur ces machines.
|
||||
// 1. Localise le PS_Launcher.exe en cours d'exécution
|
||||
var processModule = SysProcess.GetCurrentProcess().MainModule
|
||||
?? throw new InvalidOperationException("Cannot locate current process module");
|
||||
var targetExe = processModule.FileName!;
|
||||
@@ -68,26 +64,14 @@ public sealed class LauncherSelfUpdater : ILauncherSelfUpdater
|
||||
var downloadedPath = await _downloadManager.DownloadAsync(downloadJob, progress, ct).ConfigureAwait(false);
|
||||
_logger.LogInformation("New launcher downloaded to {Path}", downloadedPath);
|
||||
|
||||
// 3. Localise l'updater à côté du target. Cherche d'abord le nouveau nom
|
||||
// (PS_Launcher.Updater.exe, depuis v0.14.0) puis fallback sur l'ancien
|
||||
// (PSLauncher.Updater.exe) pour compat backward avec les installs faites
|
||||
// avec un installer < v0.14.0.
|
||||
// 3. Localise PS_Launcher.Updater.exe (à côté du target)
|
||||
var updaterPath = Path.Combine(installDir, "PS_Launcher.Updater.exe");
|
||||
if (!File.Exists(updaterPath))
|
||||
{
|
||||
var legacyUpdater = Path.Combine(installDir, "PSLauncher.Updater.exe");
|
||||
if (File.Exists(legacyUpdater))
|
||||
{
|
||||
_logger.LogInformation("Using legacy updater path {Path} (pre-v0.14 install layout)", legacyUpdater);
|
||||
updaterPath = legacyUpdater;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new FileNotFoundException(
|
||||
"Updater (PS_Launcher.Updater.exe / PSLauncher.Updater.exe) introuvable à côté du launcher. " +
|
||||
"Réinstalle le launcher depuis l'installeur officiel.",
|
||||
updaterPath);
|
||||
}
|
||||
throw new FileNotFoundException(
|
||||
"PS_Launcher.Updater.exe est manquant à côté de PS_Launcher.exe. " +
|
||||
"Réinstalle le launcher depuis l'installeur officiel.",
|
||||
updaterPath);
|
||||
}
|
||||
|
||||
// 4. Copie le .new dans le staging dir si downloaded est ailleurs
|
||||
|
||||
Reference in New Issue
Block a user