From 3484c23683dc097dd71e6448da19e46199617e2e Mon Sep 17 00:00:00 2001 From: "j.foucher" Date: Sat, 2 May 2026 11:38:07 +0200 Subject: [PATCH] ConfigStore: default installRoot to C:\ASTERION_VR for client installs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../Configuration/ConfigStore.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/PSLauncher.Core/Configuration/ConfigStore.cs b/src/PSLauncher.Core/Configuration/ConfigStore.cs index ca8542f..ccbeabd 100644 --- a/src/PSLauncher.Core/Configuration/ConfigStore.cs +++ b/src/PSLauncher.Core/Configuration/ConfigStore.cs @@ -65,17 +65,21 @@ public sealed class ConfigStore : IConfigStore File.Move(tmp, _configFile, overwrite: true); } + /// + /// Cible standard pour les déploiements clients : C:\ASTERION_VR. + /// 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. + /// 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"; } }