From 85e2912d62b8ed7be28032e71222a21503561ce7 Mon Sep 17 00:00:00 2001 From: bruno Date: Sun, 26 Jul 2026 17:14:28 -0400 Subject: [PATCH] fix: backend data/ dans %APPDATA%\ObsiGate au lieu de Program Files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - spawn_backend: current_dir → app_data_dir() (writable sur Windows) - PYTHONPATH = exe_dir pour que 'import backend' trouve le package - Création de data/ dans app_data_dir avant le spawn Corrige PermissionError [WinError 5] Access is denied: 'data' --- desktop/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop/src/main.rs b/desktop/src/main.rs index a4369de..eb051e7 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -119,8 +119,13 @@ fn spawn_backend(exe_dir: &PathBuf) -> Result { info!("Starting backend: {}", python.display()); + // Use app data dir as CWD so 'data/' writes go to a writable location (%APPDATA%\ObsiGate) + let data_dir = app_data_dir(); + let _ = fs::create_dir_all(data_dir.join("data")); + let child = Command::new(&python) - .current_dir(exe_dir) + .current_dir(&data_dir) + .env("PYTHONPATH", exe_dir) .args([ "-m", "uvicorn", "backend.main:app",