From 99f2827beedca47c4e33c22d79b23b6f4f0cab57 Mon Sep 17 00:00:00 2001 From: Steve Brito Date: Wed, 4 Sep 2024 09:11:18 -0700 Subject: [PATCH] update exe uninstall to be more reliable --- system/system_windows.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/system/system_windows.go b/system/system_windows.go index 0ef93cc..0371e6b 100644 --- a/system/system_windows.go +++ b/system/system_windows.go @@ -102,13 +102,15 @@ func uninstallString(installSource, extension string) string { return un } default: - if strings.ToLower(v) == strings.ToLower(installSource) { + displayName, _, err := q.GetStringValue("DisplayName") + if err != nil { + continue + } + // Remove display name whitespace to conform to package name + if strings.ToLower(strings.ReplaceAll(displayName, " ", "")) == strings.ToLower(installSource) { // Check if the value exists, move on if it doesn't un, _, err := q.GetStringValue("QuietUninstallString") if err != nil { - continue - } - if un == "" { un, _, err = q.GetStringValue("UninstallString") if err != nil { // UninstallString not found, move on to next entry