From 22746179342ca50b4e3eea0c7dab3b672a69f0f3 Mon Sep 17 00:00:00 2001 From: GermanCoding Date: Sun, 21 Jun 2026 12:17:28 +0200 Subject: [PATCH] feat(installer)!: Stop all SyncTrayzor processes upon install/upgrade This is a potentially breaking change, and slightly invasive. Old SyncTrayzor versions (< 1.1.29) did not stop themselves upon uninstall, causing "ghost" SyncTrayzor processes to remain on the system. These can cause various issues, but most noticeably is that they lock the CEF cache, causing startup failures for the new instance. We cannot trivially stop these, as uninstaller information may already be lost if the user manually uninstalled v1 but did not stop the ghost afterwards. This change therefore ensures that *all* instances are stopped (if we have permission), no matter where they come from. This may cause disruptions for unrelated portable versions or cross-user instances, but the user can simply re-start these as needed. Having multiple SyncTrayzors running on the system is likely an edge-case anyway. --- installer/common.iss | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/installer/common.iss b/installer/common.iss index f257d4eb..dd7cde53 100644 --- a/installer/common.iss +++ b/installer/common.iss @@ -113,6 +113,26 @@ begin end; end; +function StopRunningSyncTrayzorProcesses(): Boolean; +var + ResultCode: Integer; +begin + Result := True; + + if not Exec(ExpandConstant('{sys}\taskkill.exe'), '/IM SyncTrayzor.exe /F /T', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then + begin + Log('Failed to launch taskkill for SyncTrayzor.exe processes; continuing setup'); + end + else if ResultCode = 0 then + begin + Log('Requested termination of SyncTrayzor.exe processes'); + end + else + begin + Log('taskkill exited with code ' + IntToStr(ResultCode) + '; continuing setup'); + end; +end; + procedure RestoreAutostartRegistry(); var NewValue: string; @@ -399,6 +419,8 @@ end; function InitializeSetup(): Boolean; begin Result := True; + StopRunningSyncTrayzorProcesses(); + if not EnsureNoLegacyX86() then begin Result := False;