diff --git a/CHANGELOG.md b/CHANGELOG.md index e621e601b88e..183490b615e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,6 +129,8 @@ v0.40.0 (2024-02-27) - Fix an issue where changing the configuration of `loki.write` would cause a panic. (@rfratto) +- Fix issue where registry was not being properly deleted. (@mattdurham) + ### Other changes - Removed support for Windows 2012 in line with Microsoft end of life. (@mattdurham) diff --git a/packaging/grafana-agent-flow/windows/install_script.nsis b/packaging/grafana-agent-flow/windows/install_script.nsis index 469a2cbd97b0..5e253890c2d5 100644 --- a/packaging/grafana-agent-flow/windows/install_script.nsis +++ b/packaging/grafana-agent-flow/windows/install_script.nsis @@ -193,6 +193,8 @@ Section "uninstall" RMDir /r "$APPDATA\${APPNAME}" # Application data. # Remove service and uninstaller information from the registry. - DeleteRegKey HKLM "Software\Grafana\Grafana Agent Flow" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" + nsExec::ExecToLog 'Reg.exe delete "HKLM\SOFTWARE\Grafana\Grafana Agent Flow" /reg:64 /f' + Pop $0 + nsExec::ExecToLog 'Reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" /reg:64 /f' + Pop $0 SectionEnd diff --git a/packaging/grafana-agent/windows/install_script.nsis b/packaging/grafana-agent/windows/install_script.nsis index b08a8216c691..a39ec0d4dc0d 100644 --- a/packaging/grafana-agent/windows/install_script.nsis +++ b/packaging/grafana-agent/windows/install_script.nsis @@ -229,6 +229,7 @@ Section "uninstall" RMDir /r $APPDATA\grafana-agent-wal - # Remove uninstaller information from the registry - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" + # Remove service and uninstaller information from the registry. + nsExec::ExecToLog 'Reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" /reg:64 /f' + Pop $0 SectionEnd