Fix Local Agent 1.13.1 Windows dashboard startup

This commit is contained in:
A R R R Associates
2026-08-22 19:36:51 +05:30
parent 4b0ac5ce2b
commit 215ad2c6c6
5 changed files with 43 additions and 7 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import io
from pathlib import Path from pathlib import Path
import zipfile import zipfile
ERP_LOCAL_AGENT_VERSION = "1.13.0" ERP_LOCAL_AGENT_VERSION = "1.13.1"
ERP_LOCAL_AGENT_NAME = "ERP Local Agent" ERP_LOCAL_AGENT_NAME = "ERP Local Agent"
RUNTIME_ROOT = Path(__file__).resolve().parent / "local_agent_runtime" RUNTIME_ROOT = Path(__file__).resolve().parent / "local_agent_runtime"
_DETERMINISTIC_ZIP_TIMESTAMP = (2026, 1, 1, 0, 0, 0) _DETERMINISTIC_ZIP_TIMESTAMP = (2026, 1, 1, 0, 0, 0)
@@ -35,13 +35,48 @@ def _popup(title: str, message: str, error: bool = False) -> None:
def _pid_alive(pid: int) -> bool: def _pid_alive(pid: int) -> bool:
if pid <= 0: if pid <= 0:
return False return False
if os.name == "nt":
try:
import ctypes
PROCESS_QUERY_LIMITED_INFORMATION = 0x1000
STILL_ACTIVE = 259
kernel32 = ctypes.windll.kernel32
handle = kernel32.OpenProcess(
PROCESS_QUERY_LIMITED_INFORMATION,
False,
int(pid),
)
if not handle:
return False
try:
exit_code = ctypes.c_ulong()
if not kernel32.GetExitCodeProcess(
handle,
ctypes.byref(exit_code),
):
return False
return exit_code.value == STILL_ACTIVE
finally:
kernel32.CloseHandle(handle)
except Exception:
return False
try: try:
os.kill(pid, 0) os.kill(pid, 0)
return True return True
except OSError: except OSError:
return False return False
def _supervisor_running() -> bool: def _supervisor_running() -> bool:
try: try:
if not SUPERVISOR_LOCK.exists(): if not SUPERVISOR_LOCK.exists():
@@ -1,4 +1,4 @@
Option Explicit Option Explicit
Dim fso, shell, baseDir, launcher, pyw, py, cmd Dim fso, shell, baseDir, launcher, pyw, py, cmd
Set fso = CreateObject("Scripting.FileSystemObject") Set fso = CreateObject("Scripting.FileSystemObject")
@@ -15,9 +15,9 @@ If Not fso.FileExists(launcher) Then
End If End If
If fso.FileExists(pyw) Then If fso.FileExists(pyw) Then
cmd = """" & pyw & """ """ & launcher & """" cmd = Chr(34) & pyw & Chr(34) & " " & Chr(34) & launcher & Chr(34)
ElseIf fso.FileExists(py) Then ElseIf fso.FileExists(py) Then
cmd = """" & py & """ """ & launcher & """" cmd = Chr(34) & py & Chr(34) & " " & Chr(34) & launcher & Chr(34)
Else Else
MsgBox "ERP Local Agent Python environment was not found.", 16, "ERP Local Agent" MsgBox "ERP Local Agent Python environment was not found.", 16, "ERP Local Agent"
WScript.Quit WScript.Quit
@@ -1 +1,2 @@
__version__ = "1.13.0" __version__ = "1.13.1"
AGENT_NAME = "ERP Local Agent"
@@ -1,3 +1,3 @@
@echo off @echo off
cd /d "%~dp0" cd /d "%~dp0"
wscript.exe "%~dp0Open ERP Local Agent Dashboard.vbs" wscript.exe "%~dp0Open ERP Local Agent Dashboard.vbs"