fix startup script

This commit is contained in:
2026-05-28 11:01:25 +02:00
parent f459ecf72c
commit 3da8c1eac9
5 changed files with 39 additions and 28 deletions

View File

@@ -1,13 +1,17 @@
Set WshShell = CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
strScriptDir = FSO.GetParentFolderName(WScript.ScriptFullName)
WshShell.CurrentDirectory = strScriptDir
' 1. Get the exact path to the python_env folder
strEnvDir = FSO.GetParentFolderName(WScript.ScriptFullName) & "\python"
pythonExe = strScriptDir & "\python\python.exe"
' 2. Set the working directory (crucial so pythonw.exe finds its DLLs)
WshShell.CurrentDirectory = strEnvDir
' Use cmd.exe /c (close when done) as a trusted bridge to launch the module
runCommand = "cmd.exe /c " & Chr(34) & pythonExe & Chr(34) & " -m wce_crm.gui"
' 3. Get the ABSOLUTE path to the executable, not just the file name
pythonExe = strEnvDir & "\pythonw.exe"
' Set back to 0 (Hidden).
' 4. Build the command using the absolute path
runCommand = Chr(34) & pythonExe & Chr(34) & " -m wce_crm.gui"
' 5. Run it completely hidden
WshShell.Run runCommand, 0, False