From dd457c9d19b5b8eac1eb01ef408adf13f8efd2bc Mon Sep 17 00:00:00 2001
From: FlawlessCasual17 <07e5297d5b@c0x0.com>
Date: Wed, 20 Nov 2024 15:45:59 -0700
Subject: [PATCH] mp3tag_fixed: Change `pre_uninstall` script

Signed-off-by: FlawlessCasual17 <07e5297d5b@c0x0.com>
---
 bucket/mp3tag_fixed.json | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bucket/mp3tag_fixed.json b/bucket/mp3tag_fixed.json
index b410307c6..4a94c7359 100644
--- a/bucket/mp3tag_fixed.json
+++ b/bucket/mp3tag_fixed.json
@@ -55,10 +55,12 @@
         "Copy-Item \"$scriptsdir\\uninstall-mp3tag-context.cmd\" \"$dir\\uninstall-mp3tag-context.cmd\""
     ],
     "pre_uninstall": [
-        "reg delete 'HKCU\\SOFTWARE\\Classes\\*\\shell\\&Mp3tag' /f",
-        "reg delete 'HKCU\\SOFTWARE\\Classes\\*\\shell\\Mp3tag' /f",
-        "reg delete 'HKCU\\SOFTWARE\\Classes\\Directory\\shell\\&Mp3tag' /f",
-        "reg delete 'HKCU\\SOFTWARE\\Classes\\Directory\\shell\\Mp3tag' /f"
+        "if ($cmd -eq 'uninstall') {",
+        "    reg delete 'HKCU\\SOFTWARE\\Classes\\*\\shell\\&Mp3tag' /f",
+        "    reg delete 'HKCU\\SOFTWARE\\Classes\\*\\shell\\Mp3tag' /f",
+        "    reg delete 'HKCU\\SOFTWARE\\Classes\\Directory\\shell\\&Mp3tag' /f",
+        "    reg delete 'HKCU\\SOFTWARE\\Classes\\Directory\\shell\\Mp3tag' /f",
+        "}"
     ],
     "checkver": {
         "url": "https://www.mp3tag.de/en/download.html",