diff --git a/server/scripts/start-hidden.vbs b/server/scripts/start-hidden.vbs index 6448bea..5932d82 100644 --- a/server/scripts/start-hidden.vbs +++ b/server/scripts/start-hidden.vbs @@ -1,25 +1,18 @@ -' Launch wled_controller silently (no console, no window). -' Used by the Start Menu / autostart / desktop shortcut created by the -' NSIS installer. Must set the same env vars as LedGrab.bat, otherwise -' the server runs with built-in defaults (wrong config path, wrong data -' dir) and the UI appears to be unconfigured on every startup. - Set fso = CreateObject("Scripting.FileSystemObject") Set WshShell = CreateObject("WScript.Shell") - ' Get the directory of this script (scripts\), then go up to app root scriptDir = fso.GetParentFolderName(WScript.ScriptFullName) appRoot = fso.GetParentFolderName(scriptDir) WshShell.CurrentDirectory = appRoot -' Set environment variables for the child process. WshShell.Environment("Process") -' is writable and child processes spawned via Run inherit it. +' Set env vars for the child process (inherited via WshShell.Run) Set procEnv = WshShell.Environment("Process") procEnv("PYTHONPATH") = appRoot & "\app\src" procEnv("WLED_CONFIG_PATH") = appRoot & "\app\config\default_config.yaml" -' Use embedded Python if present (installed dist), otherwise system Python -embeddedPython = appRoot & "\python\pythonw.exe" +' Use embedded python.exe (NOT pythonw.exe) with WindowStyle=0. +' Same pattern as the Media Server sibling app. +embeddedPython = appRoot & "\python\python.exe" If fso.FileExists(embeddedPython) Then WshShell.Run """" & embeddedPython & """ -m wled_controller", 0, False Else