fix: installer stops the service reliably before upgrading and retries locked file copies; 1.1.5
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -213,6 +213,16 @@ def stop_service() -> None:
|
||||
_sc(["stop", SERVICE_NAME])
|
||||
|
||||
|
||||
def ensure_service_stopped(timeout: float = 45.0) -> None:
|
||||
"""Stop the service and make sure its host process is really gone (an upgrade must be able
|
||||
to overwrite the executable): SCM stop, wait, then kill any leftover host process."""
|
||||
stop_service()
|
||||
if not wait_service_state("STOPPED", timeout=timeout):
|
||||
subprocess.run(["taskkill", "/F", "/IM", "GTIFiscalAgentService.exe"], capture_output=True, text=True)
|
||||
wait_service_state("STOPPED", timeout=15)
|
||||
time.sleep(2)
|
||||
|
||||
|
||||
def remove_service() -> None:
|
||||
"""Stop then delete the service; both best effort (idempotent)."""
|
||||
stop_service()
|
||||
|
||||
Reference in New Issue
Block a user