changeset 794:fdc15f0cfdd8

(issue61) NSIS Write uninstall information and make URL configurable.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 15 Jul 2014 12:03:45 +0200
parents 6bb769d3cdc1
children 3a9b0c75f5a6
files packaging/create-dist-package.sh.in packaging/tmp-createpackage.sh.in packaging/trustbridge.nsi
diffstat 3 files changed, 35 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/packaging/create-dist-package.sh.in	Tue Jul 15 10:42:36 2014 +0200
+++ b/packaging/create-dist-package.sh.in	Tue Jul 15 12:03:45 2014 +0200
@@ -23,9 +23,12 @@
 cp @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi $TMPDIR
 cp -r @CMAKE_SOURCE_DIR@/packaging/resources $TMPDIR/resources
 LC_ALL="de_DE.latin-1" echo "company=Bundesamt für Sicherheit in der Informationstechnik" > $TMPDIR/meta.ini
+EST_SIZE=$(du -s $TMPDIR/windows | cut -f 1)
 echo "version_number=@PROJECT_VERSION@" >>  $TMPDIR/meta.ini
 echo "setupname=%1TrustBridge-@PROJECT_VERSION@.exe" >> $TMPDIR/meta.ini
 echo "productname=TrustBridge" >> $TMPDIR/meta.ini
+echo "info_url=https://wald.intevation.org/projects/trustbridge/" >> $TMPDIR/meta.ino
+echo "size=$EST_SIZE" >> $TMPDIR/meta.ini
 cp $WINDOWS_NSSDIR/*.dll $TMPDIR/windows
 cd $TMPD
 zip -r TrustBridge-@PROJECT_VERSION@.zip TrustBridge-@PROJECT_VERSION@
--- a/packaging/tmp-createpackage.sh.in	Tue Jul 15 10:42:36 2014 +0200
+++ b/packaging/tmp-createpackage.sh.in	Tue Jul 15 12:03:45 2014 +0200
@@ -19,6 +19,8 @@
 cp $NSSDIR/*.dll $TMPDIR
 cp $EXEFILES $TMPDIR
 
+EST_SIZE=$(du -s $TMPDIR | cut -f 1)
+
 echo $TMPDIR
 makensis -Dfiles_dir=$TMPDIR \
     -Dcompany="Bundesamt für Sicherheit in der Informationstechnik" \
@@ -26,5 +28,7 @@
     -Dsetupname="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.exe" \
     -Dproductname="TrustBridge" \
     -Dpath_sep="/" \
+    -Dinfo_url="https://wald.intevation.org/projects/trustbridge/" \
+    -dsize=$EST_SIZE \
     -Dproductname_short="TrustBridge" @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi
 rm -r $TMPDIR
--- a/packaging/trustbridge.nsi	Tue Jul 15 10:42:36 2014 +0200
+++ b/packaging/trustbridge.nsi	Tue Jul 15 12:03:45 2014 +0200
@@ -90,8 +90,8 @@
 ;!define MUI_FINISHPAGE_RUN $INSTDIR\trustbridge.exe
 ;!define MUI_FINISHPAGE_RUN_TEXT "Anwendung starten"
 ;!define MUI_FINISHPAGE_RUN_FUNCTION RunAsUser
-!define MUI_FINISHPAGE_LINK "Mehr unter http://www.bsi.bund.de" 
-!define MUI_FINISHPAGE_LINK_LOCATION "http://www.bsi.bund.de"
+!define MUI_FINISHPAGE_LINK "Mehr unter ${info_url}"
+!define MUI_FINISHPAGE_LINK_LOCATION "${info_url}"
 
 !insertmacro MUI_PAGE_WELCOME
 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
@@ -166,6 +166,27 @@
   WriteRegDword SHCTX "System\CurrentControlSet\services\eventlog\Application\${productname_short}" "TypesSupported" 5
   WriteRegDword SHCTX "System\CurrentControlSet\services\eventlog\Application\${productname_short}" "CategoryCount" 3
 
+; Register Uninstaller
+
+  WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
+                   "DisplayName" "${productname}"
+  WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
+                   "DisplayIcon" "$\"$INSTDIR\trustbridge.exe$\""
+  WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
+                   "DisplayVersion" "${version_number}"
+  WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
+                   "Publisher" "${company}"
+  WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
+                   "URLInfoAbout" "${info_url}"
+  WriteRegDword SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
+                   "EstimatedSize" "${size}"
+
+
+  WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
+                   "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
+  WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
+                 "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
+
   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 
   ;Create shortcuts
@@ -190,4 +211,9 @@
 
   DeleteRegKey /ifempty SHCTX "Software\${productname_short}"
 
+; Unregister logging
+  DeleteRegKey SHCTX "System\CurrentControlSet\services\eventlog\Application\${productname_short}" 
+
+; Remove uninstaller
+  DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}"
 SectionEnd

http://wald.intevation.org/projects/trustbridge/