Fix Local Agent 1.13.1 Windows dashboard startup
This commit is contained in:
@@ -35,13 +35,48 @@ def _popup(title: str, message: str, error: bool = False) -> None:
|
||||
def _pid_alive(pid: int) -> bool:
|
||||
if pid <= 0:
|
||||
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:
|
||||
os.kill(pid, 0)
|
||||
return True
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
def _supervisor_running() -> bool:
|
||||
try:
|
||||
if not SUPERVISOR_LOCK.exists():
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Option Explicit
|
||||
Option Explicit
|
||||
|
||||
Dim fso, shell, baseDir, launcher, pyw, py, cmd
|
||||
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||
@@ -15,9 +15,9 @@ If Not fso.FileExists(launcher) Then
|
||||
End If
|
||||
|
||||
If fso.FileExists(pyw) Then
|
||||
cmd = """" & pyw & """ """ & launcher & """"
|
||||
cmd = Chr(34) & pyw & Chr(34) & " " & Chr(34) & launcher & Chr(34)
|
||||
ElseIf fso.FileExists(py) Then
|
||||
cmd = """" & py & """ """ & launcher & """"
|
||||
cmd = Chr(34) & py & Chr(34) & " " & Chr(34) & launcher & Chr(34)
|
||||
Else
|
||||
MsgBox "ERP Local Agent Python environment was not found.", 16, "ERP Local Agent"
|
||||
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"
|
||||
wscript.exe "%~dp0Open ERP Local Agent Dashboard.vbs"
|
||||
|
||||
Reference in New Issue
Block a user