]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixes to win/openvpn.nsi
authorSamuli Seppänen <samuli@openvpn.net>
Tue, 15 Mar 2011 14:36:41 +0000 (16:36 +0200)
committerDavid Sommerseth <davids@redhat.com>
Mon, 21 Mar 2011 14:15:15 +0000 (15:15 +0100)
Added support for generating installer with unsigned TAP drivers. Fixed Windows
Vista/7 Start menu shortcut uninstall failure.

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: James Yonan <james@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
win/openvpn.nsi

index cbae21a1859c86dd80015b44cb28b7d1c1975199..12226d51a7180cf7f0e40b67a95c4d7261d68ec4 100755 (executable)
@@ -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"