Extract some common parts of the uninstaller.
authorCarl Hetherington <cth@carlh.net>
Sat, 25 Nov 2023 21:05:24 +0000 (22:05 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 26 Nov 2023 23:53:17 +0000 (00:53 +0100)
platform/windows/wscript

index eb32596acea243515b4df610924b6dbec6b6895f..e5a54c94e4e5706e24af6625c9c31aad8d80c250 100644 (file)
@@ -462,14 +462,14 @@ SectionEnd
 !insertmacro MUI_LANGUAGE "English"
     """, file=f)
 
-    if debug:
-        print("""
+    print("""
 Section "Uninstall"
 RMDir /r "$INSTDIR\\*.*"
 RMDir "$INSTDIR"
-Delete "$DESKTOP\\DCP-o-matic 2 debug.lnk"
-        """, file=f)
+    """, file=f)
 
+    if debug:
+        print('Delete "$DESKTOP\\DCP-o-matic 2 debug.lnk"', file=f)
         for s, l in tools:
             print('Delete "$DESKTOP\\DCP-o-matic 2 %s debug.lnk"' % l, file=f)
 
@@ -481,13 +481,7 @@ DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\U
  SectionEnd
         """, file=f)
     else:
-        print("""
-Section "Uninstall"
-RMDir /r "$INSTDIR\\*.*"
-RMDir "$INSTDIR"
-Delete "$DESKTOP\\DCP-o-matic 2.lnk"
-        """, file=f)
-
+        print('Delete "$DESKTOP\\DCP-o-matic 2.lnk"', file=f)
         for s, l in tools:
             print('Delete "$DESKTOP\\DCP-o-matic 2 %s.lnk"' % l)