Skip to content

Commit

Permalink
packaging: properly unregister Alloy when uninstalling on Windows (#166)
Browse files Browse the repository at this point in the history
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 #165.

As a temporary workaround to this bug, users should delete
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Alloy from the
32-bit registry.

Co-authored-by: Paschalis Tsilias <[email protected]>
  • Loading branch information
rfratto and tpaschalis authored Apr 17, 2024
1 parent 41c2df1 commit 3201389
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ Main (unreleased)

### Bugfixes

- Fixed issue with defaults for Beyla component not being applied correctly. (marctc)
- Fixed issue with defaults for Beyla component not being applied correctly. (marctc)

- 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)
-------------------
Expand Down
7 changes: 4 additions & 3 deletions packaging/windows/install_script.nsis
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3201389

Please sign in to comment.