From d49e828dc49b2ac326d3c865ce12564ac71f5ff8 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Wed, 10 Apr 2024 08:56:32 -0400 Subject: [PATCH] packaging: properly unregister Alloy when uninstalling on Windows grafana/agent#6550 fixed an issue where the service settings were not being removed properly, but inadvertedly broke the process of removing the application from the Add/Remove programs list. Alloy is registered as a program to the 32-bit registry, and so it must be removed from the 32-bit registry and not the 64-bit registry. Fixes grafana/alloy#165. As a temporary workaround to this bug, users should delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Alloy from the 32-bit registry. --- CHANGELOG.md | 8 ++++++++ packaging/windows/install_script.nsis | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5751aaeaf..f1982e7728 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ This document contains a historical list of changes between releases. Only changes that impact end-user behavior are listed; changes to documentation or internal API changes are not present. +Unreleased +---------- + +### Bugfixes + +- Fix an issue on Windows where uninstalling Alloy did not remove it from the + Add/Remove programs list. (@rfratto) + v1.0.0 (2024-04-09) ------------------- diff --git a/packaging/windows/install_script.nsis b/packaging/windows/install_script.nsis index 9361f3c09a..b51ff8c8d3 100644 --- a/packaging/windows/install_script.nsis +++ b/packaging/windows/install_script.nsis @@ -239,9 +239,10 @@ Section "uninstall" RMDir /r "$INSTDIR" # Install directory. RMDir /r "$APPDATA\${APPNAME}" # Application data. - # Remove service and uninstaller information from the registry. + # Remove service and uninstaller information from the registry. Note that the + # service settings are stored in the 64-bit registry (so we use /reg:64), + # while the uninstaller information is stored in the 32-bit registry. nsExec::ExecToLog 'Reg.exe delete "HKLM\SOFTWARE\GrafanaLabs\Alloy" /reg:64 /f' Pop $0 - nsExec::ExecToLog 'Reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" /reg:64 /f' - Pop $0 + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" SectionEnd