summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2015-04-28 15:15:44 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2015-04-28 15:16:59 +0200
commitde83d0eb28f889938e1fef57f0f1e42a776abad6 (patch)
tree116bf993a2b5384b2960be4f2e9a90bd0ca8d501
parent177e6d964dcdc0d02e1fbd76ed7d6f7eba38c123 (diff)
nsis: Add uninstall entry in Windows Control Panel
This commit replaces the 'Uninstall' symlink in Windows Start Menu with an uninstall entry in Windows Add/Remove section in the Control Panel.
-rw-r--r--spice-guest-tools.nsis42
1 files changed, 31 insertions, 11 deletions
diff --git a/spice-guest-tools.nsis b/spice-guest-tools.nsis
index e642d61..91c4dd2 100644
--- a/spice-guest-tools.nsis
+++ b/spice-guest-tools.nsis
@@ -34,14 +34,19 @@
SetCompressor /SOLID lzma
!include "driver.nsh"
+!include "FileFunc.nsh"
!include "WinVer.nsh"
!include "x64.nsh"
-Name "SPICE Guest Tools"
-Caption "SPICE Guest Tools Installer"
-OutFile "spice-guest-tools-0.100.exe"
+!define NAME "SPICE Guest Tools"
+!define PUBLISHER "The SPICE Project"
+!define URL "http://spice-space.org"
+!define VERSION "0.100"
+Name "${NAME}"
+Caption "${NAME} Installer"
+OutFile "spice-guest-tools-${VERSION}.exe"
BrandingText " "
-InstallDir "$PROGRAMFILES\SPICE Guest Tools"
+InstallDir "$PROGRAMFILES\${NAME}"
# SilentInstall silent
ShowInstDetails nevershow
@@ -119,11 +124,27 @@ Section "spice-guest-tools"
Call InstallDriver
Call InstallVdAgentService
-SectionEnd
-Section "Start Menu Shortcuts"
- CreateDirectory "$SMPROGRAMS\spice-guest-tools"
- CreateShortCut "$SMPROGRAMS\spice-guest-tools\Uninstall SPICE Guest Tools.lnk" "$INSTDIR\Uninstall spice-guest-tools.exe" "" "$INSTDIR\Uninstall spice-guest-tools.exe" 0
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools" \
+ "DisplayName" "${NAME}"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools" \
+ "DisplayVersion" "${VERSION}"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools" \
+ "Publisher" "${PUBLISHER}"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools" \
+ "URLInfoAbout" "${URL}"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools" \
+ "UninstallString" "$\"$INSTDIR\Uninstall spice-guest-tools.exe$\""
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools" \
+ "QuietUninstallString" "$\"$INSTDIR\Uninstall spice-guest-tools.exe$\" /S"
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools" \
+ "NoModify" "1"
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools" \
+ "NoRepair" "1"
+ ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
+ IntFmt $0 "0x%08X" $0
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools" \
+ "EstimatedSize" "$0"
SectionEnd
Section "Uninstall"
@@ -131,9 +152,6 @@ Section "Uninstall"
SetOutPath "$TEMP"
- Delete /rebootok "$SMPROGRAMS\spice-guest-tools\Uninstall SPICE Guest Tools.lnk"
- RMDir "$SMPROGRAMS\spice-guest-tools"
-
Delete /rebootok "$INSTDIR\version.txt"
Delete /rebootok "$INSTDIR\Uninstall spice-guest-tools.exe"
Delete /rebootok "$INSTDIR\32\vdagent.exe"
@@ -144,6 +162,8 @@ Section "Uninstall"
RMDir /rebootok "$INSTDIR\64"
RMDir /rebootok /r "$INSTDIR\drivers"
RMDir /rebootok "$INSTDIR"
+
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SpiceGuestTools"
SectionEnd
Section -post