Fix msiexec hang on Windows — add /qn /norestart to install.ps1#673
Draft
Fix msiexec hang on Windows — add /qn /norestart to install.ps1#673
Conversation
e06393f to
c35f2dd
Compare
Without /qn, msiexec shows a UI dialog on error (e.g. MSI mutex conflict 1618). In Session 0 (SSM/non-interactive), this dialog is invisible and blocks indefinitely. Adding /qn ensures silent mode so errors return immediately. /norestart prevents unexpected reboots.
c35f2dd to
bdf87f8
Compare
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.
Summary
Fixes indefinite msiexec hang during CloudWatch Agent installation on Windows when another MSI is already in progress (error 1618).
Without
/qn, msiexec shows a UI dialog on error. In Session 0 (non-interactive), this dialog is invisible and blocks indefinitely until the calling process times out.Changes
packaging/windows/install.ps1line 17:/qn(quiet, no UI) — ensures msiexec runs in silent mode so errors return exit codes instead of showing dialogs/norestart— prevents unexpected reboots on hosts managed via automation-PassThruand exit code check — throws on non-zero exit so failures are reported instead of silently proceeding tocond-restart/norestartsuppresses the rebootuninstall.ps1is NOT affected (uses WMI, not msiexec).Before (hangs on error, no exit code check):
After (returns immediately, fails explicitly):
Testing
Reproduced on Windows Server 2025. Process evidence confirmed: msiexec PID stuck in Session 0 with invisible Windows Installer dialog, ThreadWaitReason=UserRequest. MSI mutex NOT held — confirms dialog-wait, not mutex-wait. With
/qn, msiexec returns error 1618 immediately instead of hanging. Exit code check ensures real errors propagate while 3010 (reboot-needed) is accepted.