Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes Windows azd update MSI replacement detection by switching from file metadata checks to content hashing, improving reliability when the MSI silently fails to overwrite the executable.
Changes:
- Add SHA-256 hashing to detect whether the MSI actually replaced
azd.exe. - Introduce a
hashFilehelper used byupdateViaMSIto compare pre/post install content.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
This pull request improves the reliability of detecting successful MSI-based updates by switching from file metadata checks to content hash verification. Instead of comparing modification time and file size, the code now computes and compares SHA-256 hashes of the binary before and after the update. This change ensures that updates are only considered successful if the file content has actually changed.
Update verification improvements:
updateViaMSI. This makes the update check more robust against silent failures. [1] [2]New utility function:
hashFilefunction that computes the SHA-256 hash of a file's contents for use in update verification.Dependency update:
crypto/sha256package to support the new hash-based verification.