fix MSI upgrade hanging due to service not stopped before file removal#415
Draft
inqrphl wants to merge 3 commits into
Draft
fix MSI upgrade hanging due to service not stopped before file removal#415inqrphl wants to merge 3 commits into
inqrphl wants to merge 3 commits into
Conversation
…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
…ateAction, it is sufficient that it has Before="RemoveExistingProducts"
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The commit is made entirely using AI, I will only mark it done once I test it.
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:
The corrected sequence during upgrades is now:
InstallInitialize -> stop service -> remove old files -> install new files -> start service -> InstallFinalize