ConfigStore: default installRoot to C:\ASTERION_VR for client installs

Previous default fell back to %UserProfile%\ASTERION_VR which is
fine for dev but unconventional for end users; the standard
deployment path is plainly C:\ASTERION_VR. New first-launch behavior:

1. If a sibling ASTERION_VR exists next to the exe (portable / dev
   layout), prefer it — keeps the development workflow intact.
2. Otherwise, default to C:\ASTERION_VR. The folder is created on
   the first install (Directory.CreateDirectory in ZipInstaller
   handles non-existent parents).

Existing users with an explicit installRoot in their config.json are
unaffected — only fresh configs (or empty installRoot) hit this path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-02 11:38:07 +02:00
parent e7d4b7a04c
commit 3484c23683

View File

@@ -65,17 +65,21 @@ public sealed class ConfigStore : IConfigStore
File.Move(tmp, _configFile, overwrite: true);
}
/// <summary>
/// Cible standard pour les déploiements clients : <c>C:\ASTERION_VR</c>.
/// Si un dossier ASTERION_VR existe déjà à côté de l'exe (mode dev / portable),
/// il est préféré pour ne pas casser l'environnement de développement.
/// </summary>
private static string ResolveDefaultInstallRoot()
{
// Mode dev / portable : ASTERION_VR à côté de l'exe (par ex. dans le repo)
var exeDir = AppContext.BaseDirectory;
var sibling = Path.Combine(Path.GetDirectoryName(exeDir.TrimEnd(Path.DirectorySeparatorChar))!, "ASTERION_VR");
var sibling = Path.Combine(
Path.GetDirectoryName(exeDir.TrimEnd(Path.DirectorySeparatorChar))!,
"ASTERION_VR");
if (Directory.Exists(sibling)) return sibling;
var dev = @"C:\ASTERION\GIT\PS_Launcher\ASTERION_VR";
if (Directory.Exists(dev)) return dev;
return Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"ASTERION_VR");
// Cible standard pour les clients (créée au premier install si absente)
return @"C:\ASTERION_VR";
}
}