[PATCH] (issue61) NSIS Write uninstall information and make URL configurable

Wald Commits scm-commit at wald.intevation.org
Tue Jul 15 12:03:48 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1405418625 -7200
# Node ID fdc15f0cfdd871d6a4b51dfb189b899cb5a57ce4
# Parent  6bb769d3cdc1ecb81ce79fc69072794c87144167
(issue61) NSIS Write uninstall information and make URL configurable.

diff -r 6bb769d3cdc1 -r fdc15f0cfdd8 packaging/create-dist-package.sh.in
--- 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- at 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- at PROJECT_VERSION@.zip TrustBridge- at PROJECT_VERSION@
diff -r 6bb769d3cdc1 -r fdc15f0cfdd8 packaging/tmp-createpackage.sh.in
--- 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- at 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
diff -r 6bb769d3cdc1 -r fdc15f0cfdd8 packaging/trustbridge.nsi
--- 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


More information about the Trustbridge-commits mailing list