[Gpg4win-commits] [git] Gpg4win - branch, master, updated. gpg4win-3.0.2-4-g7a45576

by Andre Heinecke cvs at cvs.gnupg.org
Wed Jan 10 14:33:02 CET 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG for Windows".

The branch, master has been updated
       via  7a45576ec9c60ce3884caf6ffcf9825ebfddc328 (commit)
      from  c1ad59315f5506af4122da730654e346327a8ca4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7a45576ec9c60ce3884caf6ffcf9825ebfddc328
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Jan 10 14:29:38 2018 +0100

    Add update handling to installer and uninstaller
    
    * src/gpg4win.nsi (is_update): New var.
    * src/inst-gpg4win.nsi (SEC_gpg4win): Call uninstaller with is_update.
    * src/inst-sections.nsi (SEC_gpa, SEC_kleopatra): Handle desktop links
    depending on update.
    * src/installer-finish.nsi: Don't delete desktop links on update.
    * src/installer.nsi: Parse is update variable from cmd line.
    
    --
    For now this only adds proper Desktop shortcut handling. If
    a user has explicitly deleted a desktop shortcut of Kleopatra
    or GPA it does not add another one on update.
    But in the future we could probably do more things differently
    on update.
    
    GnuPG-Bug-Id: T3729

diff --git a/src/gpg4win.nsi b/src/gpg4win.nsi
index c12a992..c3b896a 100644
--- a/src/gpg4win.nsi
+++ b/src/gpg4win.nsi
@@ -173,6 +173,7 @@ SetCompressor /SOLID lzma
 
 # Variables
 VAR is_minimal
+VAR is_update
 
 # Sections
 !include "Sections.nsh"
diff --git a/src/inst-gpg4win.nsi b/src/inst-gpg4win.nsi
index dee3627..e7a8da9 100644
--- a/src/inst-gpg4win.nsi
+++ b/src/inst-gpg4win.nsi
@@ -24,6 +24,7 @@ Section "-gpg4win" SEC_gpg4win
   SetOutPath "$INSTDIR"
   File "${BUILD_DIR}/../gpg4win-${VERSION}.tar.bz2"
 !else
+  StrCpy $is_update "0"
 # Start the slideshow.
   SetDetailsPrint none
 
@@ -48,8 +49,9 @@ Section "-gpg4win" SEC_gpg4win
   ReadRegStr $1 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPG4Win" "InstallLocation"
   IfErrors skip_uninst 0
 
-  ExecWait '$0 /S _?=$1'
+  ExecWait '$0 /S /UPDATE=1 _?=$1'
 # Deleting here does not work?
+  StrCpy $is_update "1"
   Delete /REBOOTOK "$1\gpg4win-uninstall.exe"
   RmDir "$1"
 
diff --git a/src/inst-sections.nsi b/src/inst-sections.nsi
index c865045..96c806f 100644
--- a/src/inst-sections.nsi
+++ b/src/inst-sections.nsi
@@ -1042,6 +1042,7 @@ is_no_admin:
     SectionGetFlags ${SEC_gpa} $R0
     IntOp $R0 $R0 & ${SF_SELECTED}
     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_desktop
+    StrCmp $is_update '1' no_gpa_desktop
     CreateShortCut "$DESKTOP\GPA.lnk" \
 	"$INSTDIR\bin\gpa.exe" \
         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
@@ -1052,6 +1053,7 @@ is_no_admin:
     SectionGetFlags ${SEC_kleopatra} $R0
     IntOp $R0 $R0 & ${SF_SELECTED}
     IntCmp $R0 ${SF_SELECTED} 0 no_kleopatra_desktop
+    StrCmp $is_update '1' no_kleopatra_desktop
     CreateShortCut "$DESKTOP\Kleopatra.lnk" \
 	"$INSTDIR\bin\kleopatra.exe" \
         "" "$INSTDIR\bin\kleopatra.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_kleopatra)
diff --git a/src/installer-finish.nsi b/src/installer-finish.nsi
index 69808f1..9285128 100644
--- a/src/installer-finish.nsi
+++ b/src/installer-finish.nsi
@@ -235,12 +235,14 @@ is_no_admin:
   Delete "$SMPROGRAMS\Kleopatra.lnk"
 
   # Delete Desktop links.
+  StrCmp $is_update '1' no_desktop_delete
 !ifdef HAVE_PKG_GPA
   Delete "$DESKTOP\GPA.lnk"
 !endif
 !ifdef HAVE_PKG_KLEOPATRA
   Delete "$DESKTOP\Kleopatra.lnk"
 !endif
+no_desktop_delete:
 
   Delete "$INSTDIR\${PACKAGE}-uninstall.exe"
 
diff --git a/src/installer.nsi b/src/installer.nsi
index 5e52c8b..1613646 100644
--- a/src/installer.nsi
+++ b/src/installer.nsi
@@ -721,6 +721,12 @@ Function un.onInit
 !endif
   # Remove the language preference.
   !insertmacro MUI_UNGETLANGUAGE
+  StrCpy $is_update "0"
+  ${un.GetParameters} $R0
+  ClearErrors
+  ${un.GetOptions} $R0 /UPDATE= $R1
+  IfErrors +2
+  StrCpy $is_update "1"
 FunctionEnd
 
 # This must be in a central place.  Urgs.

-----------------------------------------------------------------------

Summary of changes:
 src/gpg4win.nsi          | 1 +
 src/inst-gpg4win.nsi     | 4 +++-
 src/inst-sections.nsi    | 2 ++
 src/installer-finish.nsi | 2 ++
 src/installer.nsi        | 6 ++++++
 5 files changed, 14 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GnuPG for Windows
http://git.gnupg.org



More information about the Gpg4win-commits mailing list