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:
2026-05-03 10:08:23 +02:00
parent ce3979d131
commit c706d09e72
10 changed files with 9 additions and 54 deletions

View File

@@ -10,11 +10,6 @@
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>Resources\favicon.ico</ApplicationIcon>
<!-- AssemblyName définit le nom du .exe en sortie. Renommé en v0.14.0 :
PSLauncher.exe → PS_Launcher.exe pour s'aligner sur le nom du repo
et du produit. Les anciens installs (qui ont PSLauncher.exe) gardent
leur nom de fichier après auto-update : le self-updater écrase le
fichier au path courant sans le renommer. Le code reste rétro-compatible. -->
<AssemblyName>PS_Launcher</AssemblyName>
<Company>ASTERION VR</Company>
<Product>PROSERVE Launcher</Product>

View File

@@ -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

View File

@@ -6,9 +6,6 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<!-- Renommé v0.14.0 : PSLauncher.Updater.exe → PS_Launcher.Updater.exe.
La compat backward est gérée côté LauncherSelfUpdater qui essaie d'abord
le nouveau nom puis fallback sur l'ancien. -->
<AssemblyName>PS_Launcher.Updater</AssemblyName>
<RootNamespace>PSLauncher.Updater</RootNamespace>
<Version>0.14.0</Version>