2026-09-03 01:56:29 +08:00
|
|
|
' DCU EtherCAT desktop window (pywebview/WebView2). No console, no browser tab.
|
|
|
|
|
' Browser-tab launcher: ecat_web.vbs Console-mode debug launcher: ecat_web.bat
|
2026-09-03 22:08:38 +08:00
|
|
|
' 本文件在 launch\ 下: 先取自身所在目录, 再上一层拿到项目根。
|
2026-09-03 01:56:29 +08:00
|
|
|
Set sh = CreateObject("WScript.Shell")
|
|
|
|
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
2026-09-03 22:08:38 +08:00
|
|
|
here = fso.GetParentFolderName(WScript.ScriptFullName)
|
|
|
|
|
base = fso.GetParentFolderName(here)
|
2026-09-03 01:56:29 +08:00
|
|
|
sh.CurrentDirectory = base
|
|
|
|
|
sh.Environment("PROCESS")("PYTHONUTF8") = "1"
|
|
|
|
|
' WebView2: keep GPU rasterization but disable GPU compositing.
|
|
|
|
|
' Full hardware acceleration white-screens this window on some GPU drivers;
|
|
|
|
|
' --disable-gpu-compositing fixes it while still using the GPU for raster.
|
|
|
|
|
sh.Environment("PROCESS")("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS") = "--disable-gpu-compositing"
|
|
|
|
|
sh.Run """" & base & "\venv\Scripts\pythonw.exe"" """ & base & "\ecat_server.py"" --window", 0, False
|