Skip to contentSkip to conversation

Fixes to win/openvpn.nsi

PATCH Applied Samuli Seppänen 2 participants 2 messages Mar 15, 2011 – Mar 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixes to win/openvpn.nsi

Added support for generating installer with unsigned TAP drivers. Fixed Windows Vista/7 Start menu shortcut uninstall failure.

---
 win/openvpn.nsi |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
win/openvpn.nsi +17 -2
index cbae21a..16837a1 100755
@@ -7,6 +7,12 @@
 
 ; OpenVPN install script for Windows, using NSIS
 
+; Start menu entries don't get uninstalled properly on Windows Vista/7 unless we 
+; explicitly state that the installer requires admin privileges. This is 
+; caused by backwards compatibility tricks used on those platforms. For details, 
+; see http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista 
+RequestExecutionLevel admin
+
 SetCompressor lzma
 
 !include "MUI.nsh"
@@ -394,7 +400,9 @@ Section "TAP Virtual Ethernet Adapter" SecTAP
 
   File "${GEN}\amd64\OemWin2k.inf"
   File "${GEN}\amd64\${TAPDRV}"
-  File "${GEN}\amd64\${PRODUCT_TAP_ID}.cat"
+
+  # Don't try to install TAP driver signature if it does not exist.
+  File /nonfatal "${GEN}\amd64\${PRODUCT_TAP_ID}.cat"
 
 goto tapend
 
@@ -408,7 +416,9 @@ tap-32bit:
   SetOutPath "$INSTDIR\driver"
   File "${GEN}\i386\OemWin2k.inf"
   File "${GEN}\i386\${TAPDRV}"
-  File "${GEN}\i386\${PRODUCT_TAP_ID}.cat"
+
+  # Don't try to install TAP driver signature if it does not exist.
+  File /nonfatal "${GEN}\i386\${PRODUCT_TAP_ID}.cat"
 
   tapend:
 
@@ -428,6 +438,8 @@ SectionEnd
 
 Section "Add Shortcuts to Start Menu" SecAddShortcuts
 
+  ; Required to handle shortcuts properly on Vista/7
+  SetShellVarContext all
   SetOverwrite on
   CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
   CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}\Documentation"
@@ -682,6 +694,9 @@ FunctionEnd
 
 Section "Uninstall"
 
+  ; Required to handle shortcuts properly on Vista/7
+  SetShellVarContext all
+
   ; Stop OpenVPN if currently running
 
   DetailPrint "Service REMOVE"
Signature · 1 line
1.6.3.3
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines · Samuli Seppänen

Added support for generating installer with unsigned TAP drivers. Fixed Windows Vista/7 Start menu shortcut uninstall failure.

---
 win/openvpn.nsi |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

Applied to beta2.2 and merged into allmerged.

commit 110e42d199e735ab1a31388c5678f59d0fa9510c

Author: Samuli Seppänen <[email protected]...>
Date:   Tue Mar 15 16:36:41 2011 +0200
    Fixes to win/openvpn.nsi

    Signed-off-by: Samuli Seppänen <[email protected]...>
    Acked-by: James Yonan <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2HuQEACgkQDC186MBRfrqyFACfep720cLd3ge1VTmikFqdznet OxgAnjE8SaUs+3hIRwmDQuHMlzKdqQGn
=v1/4
-----END PGP SIGNATURE-----