[PATCH] Windows installer: add an "Add/Remove Programs" entry

Lubomir I. Ivanov neolit123 at gmail.com
Tue May 14 10:25:08 PDT 2013


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

The NSIS script on installation will write a key to the registry
that will be shown to the user as a "Subsurface" entry (with icon)
in the list of installed programs that can be uninstalled
(e.g. in the Control Panel).
On uninstall, said registry key will be removed.

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
functionality not tested with the patch target file, but with an
isolated test case. should work as expected.
---
 packaging/windows/subsurface.nsi.in | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/packaging/windows/subsurface.nsi.in b/packaging/windows/subsurface.nsi.in
index 822f4c0..1ac0753 100644
--- a/packaging/windows/subsurface.nsi.in
+++ b/packaging/windows/subsurface.nsi.in
@@ -161,6 +161,13 @@ Section
     # Create the uninstaller
     WriteUninstaller "$INSTDIR\Uninstall.exe"
 
+    WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Subsurface" \
+        "DisplayName" "Subsurface"
+    WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Subsurface" \
+        "DisplayIcon" "$INSTDIR\subsurface.ico"
+    WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Subsurface" \
+        "UninstallString" "$INSTDIR\Uninstall.exe"
+
 SectionEnd
 
 #--------------------------------
@@ -189,5 +196,6 @@ Section "Uninstall"
 
     # Remove registry entries
     DeleteRegKey /ifempty HKCU "Software\Subsurface"
+    DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Subsurface"
 
 SectionEnd
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list