From 114ac3f2105c259b950f308674024e01b1bd2cd5 Mon Sep 17 00:00:00 2001 From: Ahmet Ozturk Date: Wed, 15 Jul 2026 18:32:14 +0200 Subject: [PATCH 1/4] ai commit: fix MSI upgrade hanging due to service not stopped before file removal During upgrades, RemoveExistingProducts (scheduled by MajorUpgrade) ran before CustomPreUpdateAction, which is what stops the snclient Windows service. This meant the old snclient.exe was still held by the running service when MSI tried to delete it. Combined with Restart Manager being disabled (MSIRESTARTMANAGERCONTROL=Disable), MSI could not shut down the process holding the file, causing the installer to show a "Files in Use" dialog or silently fail. Fixed by: - Setting MajorUpgrade Schedule="afterInstallInitialize" so old files are removed after InstallInitialize instead of before it - Adding Before="RemoveExistingProducts" to CustomPreUpdateAction so snclient.exe install pre stops the service before file removal The corrected sequence during upgrades is now: InstallInitialize -> stop service -> remove old files -> install new files -> start service -> InstallFinalize --- packaging/windows/snclient.wxs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/windows/snclient.wxs b/packaging/windows/snclient.wxs index 3e91cf67..f4ef52a8 100644 --- a/packaging/windows/snclient.wxs +++ b/packaging/windows/snclient.wxs @@ -15,7 +15,7 @@ - + @@ -99,7 +99,7 @@ - + From c1c2952eb64f01bd1cf37ae58ed929fd87342f6c Mon Sep 17 00:00:00 2001 From: Ahmet Ozturk Date: Wed, 15 Jul 2026 18:40:05 +0200 Subject: [PATCH 2/4] ai commit: remove After="InstallInitialize" direftive in CustomPreUpdateAction, it is sufficient that it has Before="RemoveExistingProducts" --- packaging/windows/snclient.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/windows/snclient.wxs b/packaging/windows/snclient.wxs index f4ef52a8..bca1a164 100644 --- a/packaging/windows/snclient.wxs +++ b/packaging/windows/snclient.wxs @@ -99,7 +99,7 @@ - + From 89b425a16ef9b334c5afa052a8181d2cfb944766 Mon Sep 17 00:00:00 2001 From: Ahmet Ozturk Date: Thu, 16 Jul 2026 14:37:15 +0200 Subject: [PATCH 3/4] ai commit: Fix MSI upgrade hanging due to service not stopped before file removal During upgrades, RemoveExistingProducts ran before CustomPreUpdateAction, so the old snclient.exe was still held by the running service when MSI tried to delete it. MSIRESTARTMANAGERCONTROL is disabled, so Restart Manager could not shut down the process, causing the installer to hang on a "Files in Use" dialog. Fixed by scheduling MajorUpgrade to afterInstallExecute, which installs the new product on top of the old and removes stale components later. CustomPreUpdateAction runs after InstallInitialize, well before InstallFiles, so the service is stopped before the binary is replaced. Resulting upgrade sequence: InstallInitialize -> stop service -> InstallFiles (overwrites exe) -> InstallExecute -> RemoveExistingProducts -> start service -> InstallFinalize --- packaging/windows/snclient.wxs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/windows/snclient.wxs b/packaging/windows/snclient.wxs index bca1a164..848c639f 100644 --- a/packaging/windows/snclient.wxs +++ b/packaging/windows/snclient.wxs @@ -15,7 +15,7 @@ - + @@ -99,7 +99,7 @@ - + From 92ea605186771ce75ca125440a36fac086b1a8fb Mon Sep 17 00:00:00 2001 From: Ahmet Ozturk Date: Fri, 17 Jul 2026 09:34:37 +0200 Subject: [PATCH 4/4] ai commit: Fix MSI upgrade: stop service before RemoveExistingProducts During upgrades, RemoveExistingProducts ran before CustomPreUpdateAction, which stops the snclient Windows service. The old snclient.exe was still locked by the running service when MSI tried to delete it. With MSIRESTARTMANAGERCONTROL disabled, Restart Manager could not intervene, causing the installer to hang on a "Files in Use" dialog. Fixed by scheduling MajorUpgrade to afterInstallInitialize and placing CustomPreUpdateAction before RemoveExistingProducts, so the service is stopped prior to file removal. afterInstallExecute was considered but broke tmp_installer.ini creation during upgrades since MSI skips re-running IniFile ops for already-installed components. --- packaging/windows/snclient.wxs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/windows/snclient.wxs b/packaging/windows/snclient.wxs index 848c639f..bca1a164 100644 --- a/packaging/windows/snclient.wxs +++ b/packaging/windows/snclient.wxs @@ -15,7 +15,7 @@ - + @@ -99,7 +99,7 @@ - +