[Gpg4win-commits] [git] Gpg4win - branch, master, updated. gpg4win-2.3.1-241-g419e010

by Andre Heinecke cvs at cvs.gnupg.org
Wed May 3 17:06:04 CEST 2017


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  419e0101460fba2dcc07ee71ad89ce6b2c86d507 (commit)
       via  646641cdcbc9e99b6a94be850f6d66d8fa26dfd1 (commit)
      from  dca23c11d74e72e3961aa1f01a165d9d5936f385 (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 419e0101460fba2dcc07ee71ad89ce6b2c86d507
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed May 3 17:01:56 2017 +0200

    Fix run kleopatra / gpa at the end of installation
    
    * src/installer.nsi (FinishFunction): Don't use relative jumps.
    
    --
    Though shalt not use relative jumps with macros or be smitten
    by the wrath of NSIS.
    
     - kichik, NSIS Forums (rephrased)
    
    GnuPG-Bug-ID: 2308
    Task: T2308

diff --git a/src/installer.nsi b/src/installer.nsi
index 59663c4..90cfbc3 100644
--- a/src/installer.nsi
+++ b/src/installer.nsi
@@ -1,5 +1,6 @@
 # installer.nsi - Installer for GnuPG 4 Windows.    -*- coding: latin-1; -*-
 # Copyright (C) 2005, 2007 g10 Code GmbH
+# Copyright (C) 2017 Intevation GmbH
 #
 # This file is part of GPG4Win.
 #
@@ -152,11 +153,12 @@ Bitte die Sprache des Installations-Vorgangs angeben."
 
 Function FinishFunction
   IfSilent leave
-  Var /GLOBAL gpa_or_kleopatra
   !insertmacro SectionFlagIsSet ${SEC_kleopatra} \
-        ${SF_SELECTED} have_kleo 0
+        ${SF_SELECTED} have_kleo check_gpa
+check_gpa:
   !insertmacro SectionFlagIsSet ${SEC_gpa} \
-        ${SF_SELECTED} have_gpa 0
+        ${SF_SELECTED} have_gpa have_nothing
+have_nothing:
   ShowWindow $mui.FinishPage.Run ${SW_HIDE}
   goto leave
 have_kleo:
@@ -164,18 +166,19 @@ have_kleo:
   goto leave
 have_gpa:
   SendMessage $mui.FinishPage.Run.Text ${WM_SETTEXT} 0 "STR:$(T_RunGPA)"
-  StrCpy $gpa_or_kleopatra "GPA"
 leave:
 FunctionEnd
 
 Function RunAsUser
   !insertmacro SectionFlagIsSet ${SEC_kleopatra} \
-        ${SF_SELECTED} 0 skip_kleo
+        ${SF_SELECTED} do_kleo skip_kleo
+do_kleo:
   g4wihelp::DesktopShellRun "$INSTDIR\bin\kleopatra.exe"
   goto leave
 skip_kleo:
   !insertmacro SectionFlagIsSet ${SEC_gpa} \
-        ${SF_SELECTED} 0 leave
+        ${SF_SELECTED} do_gpa leave
+do_gpa:
   g4wihelp::DesktopShellRun "$INSTDIR\bin\gpa.exe"
 leave:
 FunctionEnd

commit 646641cdcbc9e99b6a94be850f6d66d8fa26dfd1
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed May 3 15:07:43 2017 +0200

    Remove some unused code
    
    * g4wihelp.c (path_add, path_remove): Removed.
    * installer.nsi (AddToPath, RemoveFromPath, Regkey_for_Env): Removed.
    * uninst-gpg4win.nsi (-un.gpg4win): Remove obsolete remove from
    path call.

diff --git a/src/g4wihelp.c b/src/g4wihelp.c
index 3fc742e..12b859a 100644
--- a/src/g4wihelp.c
+++ b/src/g4wihelp.c
@@ -966,181 +966,6 @@ read_w32_registry_string (HKEY root, const char *dir, const char *name)
 }
 
 
-#define ENV_HK HKEY_LOCAL_MACHINE
-#define ENV_REG "SYSTEM\\CurrentControlSet\\Control\\" \
-    "Session Manager\\Environment"
-  /* The following setting can be used for a per-user setting.  */
-#if 0
-#define ENV_HK HKEY_CURRENT_USER
-#define ENV_REG "Environment"
-#endif
-/* Due to a bug in Windows7 (kb 2685893) we better but a lower limit
-   than 8191 on the maximum length of the PATH variable.  Note, that
-   depending on the used toolchain we used to have a 259 byte limit in
-   the past.  */
-#define PATH_LENGTH_LIMIT 2047
-
-void __declspec(dllexport)
-path_add (HWND hwndParent, int string_size, char *variables,
-	  stack_t **stacktop, extra_parameters_t *extra)
-{
-  char dir[PATH_LENGTH_LIMIT];
-  char *path;
-  char *path_new;
-  int path_new_size;
-  char *comp;
-  const char delims[] = ";";
-  HKEY key_handle = 0;
-
-  g_hwndParent = hwndParent;
-  EXDLL_INIT();
-
-  setuservariable (INST_R0, "0");
-
-/*   MessageBox (g_hwndParent, "XXX 1", 0, MB_OK); */
-
-  /* The expected stack layout: path component.  */
-  if (popstring (dir, sizeof (dir)))
-    return;
-
-/*   MessageBox (g_hwndParent, "XXX 2", 0, MB_OK); */
-
-  path = read_w32_registry_string (ENV_HK, ENV_REG, "Path");
-  if (! path)
-    {
-      MessageBox (g_hwndParent, "No PATH variable found", 0, MB_OK);
-      return;
-    }
-
-/*   MessageBox (g_hwndParent, "XXX 3", 0, MB_OK); */
-
-  /* Old path plus semicolon plus dir plus terminating nul.  */
-  path_new_size = strlen (path) + 1 + strlen (dir) + 1;
-  if (path_new_size > PATH_LENGTH_LIMIT)
-    {
-      MessageBox (g_hwndParent, "PATH env variable too big", 0, MB_OK);
-      free (path);
-      return;
-    }
-
-/*   MessageBox (g_hwndParent, "XXX 4", 0, MB_OK); */
-
-  path_new = malloc (path_new_size);
-  if (!path_new)
-    {
-      free (path);
-      return;
-    }
-
-/*   MessageBox (g_hwndParent, "XXX 5", 0, MB_OK); */
-
-  strcpy (path_new, path);
-  strcat (path_new, ";");
-  strcat (path_new, dir);
-
-/*   MessageBox (g_hwndParent, "XXX 6", 0, MB_OK); */
-/*   MessageBox (g_hwndParent, dir, 0, MB_OK); */
-/*   MessageBox (g_hwndParent, "XXX 7", 0, MB_OK); */
-
-  /* Check if the directory already exists in the path.  */
-  comp = strtok (path, delims);
-  do
-    {
-/*       MessageBox (g_hwndParent, comp, 0, MB_OK); */
-
-      if (!strcmp (comp, dir))
-	{
-	  free (path);
-	  free (path_new);
-	  return;
-	}
-      comp = strtok (NULL, delims);
-    }
-  while (comp);
-  free (path);
-
-/*   MessageBox (g_hwndParent, "XXX 8", 0, MB_OK); */
-
-  /* Set a key for our CLSID.  */
-  RegCreateKey (ENV_HK, ENV_REG, &key_handle);
-  RegSetValueEx (key_handle, "Path", 0, REG_EXPAND_SZ,
-		 path_new, path_new_size);
-  RegCloseKey (key_handle);
-  SetEnvironmentVariable("PATH", path_new);
-  free (path_new);
-
-/*   MessageBox (g_hwndParent, "XXX 9", 0, MB_OK); */
-
-  setuservariable (INST_R0, "1");
-}
-
-
-void __declspec(dllexport)
-path_remove (HWND hwndParent, int string_size, char *variables,
-	     stack_t **stacktop, extra_parameters_t *extra)
-{
-  char dir[PATH_LENGTH_LIMIT];
-  char *path;
-  char *path_new;
-  int path_new_size;
-  char *comp;
-  const char delims[] = ";";
-  HKEY key_handle = 0;
-  int changed = 0;
-  int count = 0;
-
-  g_hwndParent = hwndParent;
-  EXDLL_INIT();
-
-  setuservariable (INST_R0, "0");
-
-  /* The expected stack layout: path component.  */
-  if (popstring (dir, sizeof (dir)))
-    return;
-
-  path = read_w32_registry_string (ENV_HK, ENV_REG, "Path");
-  /* Old path plus semicolon plus dir plus terminating nul.  */
-  path_new_size = strlen (path) + 1;
-  path_new = malloc (path_new_size);
-  if (!path_new)
-    {
-      free (path);
-      return;
-    }
-  path_new[0] = '\0';
-
-  /* Compose the new path.  */
-  comp = strtok (path, delims);
-  do
-    {
-      if (strcmp (comp, dir))
-	{
-	  if (count != 0)
-	    strcat (path_new, ";");
-	  strcat (path_new, comp);
-	  count++;
-	}
-      else
-	changed = 1;
-
-      comp = strtok (NULL, delims);
-    }
-  while (comp);
-  free (path);
-
-  if (! changed)
-    return;
-
-  /* Set a key for our CLSID.  */
-  RegCreateKey (ENV_HK, ENV_REG, &key_handle);
-  RegSetValueEx (key_handle, "Path", 0, REG_EXPAND_SZ,
-		 path_new, path_new_size);
-  RegCloseKey (key_handle);
-  free (path_new);
-
-  setuservariable (INST_R0, "1");
-}
-
 /** @brief Kill processes with the name name.
  *
  * This function tries to kill a process using ExitProcess.
diff --git a/src/installer.nsi b/src/installer.nsi
index 20b6e34..59663c4 100644
--- a/src/installer.nsi
+++ b/src/installer.nsi
@@ -31,14 +31,6 @@
 
 !include "WinMessages.nsh"
 
-# Define for the registry key to change the environment.  The
-# commented one may be used if the setting should affect only the
-# current user.
-!define Regkey_for_Env \
-    'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
-# !define Regkey_for_Env 'HKCU "Environment"'
-
-
 # We use the modern UI 2.
 !ifdef DEBUG
 !include "MUI2.nsh"
@@ -51,21 +43,8 @@
 # Set the package name.  Note that this name should not be sufficed
 #  with the version because this would get displayed in the start menu.
 Name "${PRETTY_PACKAGE}"
-
-
-# Set the output filename.
-!ifdef GPG4WIN_VANILLA
-OutFile "${PACKAGE}-vanilla-${VERSION}.exe"
-BrandingText "${PRETTY_PACKAGE}-vanilla-${VERSION}"
-!else
-!ifdef GPG4WIN_LIGHT
-OutFile "${PACKAGE}-light-${VERSION}.exe"
-BrandingText "${PRETTY_PACKAGE}-light-${VERSION}"
-!else
 OutFile "${PACKAGE}-${VERSION}.exe"
 BrandingText "${PRETTY_PACKAGE}-${VERSION}"
-!endif
-!endif
 
 # Details button conflicts with splashscreen
 ShowInstDetails nevershow
@@ -444,9 +423,7 @@ FunctionEnd
 # Called right before installation
 Function BeforeInstallHooks
     Call PrintCloseOtherApps
-!ifndef GPG4WIN_VANILLA
     Call CheckClawsUninstall
-!endif
 FunctionEnd
 
 # Called right before the final page to show more warnings.
@@ -676,28 +653,6 @@ Function TrimNewlines
 FunctionEnd
 
 
-# AddToPath - Adds the given dir to the search path.
-#        Input - head of the stack
-Function AddToPath
-  Exch $0
-  g4wihelp::path_add "$0"
-  StrCmp $R5 "0" add_to_path_done
-  SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-  add_to_path_done:
-  Pop $0
-FunctionEnd
-
-# RemoveFromPath - Remove a given dir from the path
-#     Input: head of the stack
-Function un.RemoveFromPath
-  Exch $0
-  g4wihelp::path_remove "$0"
-  StrCmp $R5 "0" remove_from_path_done
-  SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-  remove_from_path_done:
-  Pop $0
-FunctionEnd
-
 Function .onInit
   Call G4wRunOnce
 
diff --git a/src/uninst-gpg4win.nsi b/src/uninst-gpg4win.nsi
index 22820e7..80e77d6 100644
--- a/src/uninst-gpg4win.nsi
+++ b/src/uninst-gpg4win.nsi
@@ -26,10 +26,6 @@ Section "-un.gpg4win"
 
   DeleteRegValue HKLM "Software\GNU\GnuPG" "Install Directory"
 
-  # Remove the public directory from the PATH
-  Push "$INSTDIR\pub"
-  Call un.RemoveFromPath
-
   # Delete gpg4win included tools
   Delete "$INSTDIR\bin\sha1sum.exe"
   Delete "$INSTDIR\bin\sha256sum.exe"

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

Summary of changes:
 src/g4wihelp.c         | 175 -------------------------------------------------
 src/installer.nsi      |  60 +++--------------
 src/uninst-gpg4win.nsi |   4 --
 3 files changed, 9 insertions(+), 230 deletions(-)


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



More information about the Gpg4win-commits mailing list