Browse code

Fixes to win/openvpn.nsi

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>

Samuli Seppänen authored on 2011/03/15 23:36:41
Showing 1 changed files
... ...
@@ -7,6 +7,12 @@
7 7
 
8 8
 ; OpenVPN install script for Windows, using NSIS
9 9
 
10
+; Start menu entries don't get uninstalled properly on Windows Vista/7 unless we
11
+; explicitly state that the installer requires admin privileges. This is
12
+; caused by backwards compatibility tricks used on those platforms. For details,
13
+; see http://nsis.sourceforge.net/Shortcuts_removal_fails_on_Windows_Vista
14
+RequestExecutionLevel admin
15
+
10 16
 SetCompressor lzma
11 17
 
12 18
 !include "MUI.nsh"
... ...
@@ -394,7 +400,9 @@ Section "TAP Virtual Ethernet Adapter" SecTAP
394 394
 
395 395
   File "${GEN}\amd64\OemWin2k.inf"
396 396
   File "${GEN}\amd64\${TAPDRV}"
397
-  File "${GEN}\amd64\${PRODUCT_TAP_ID}.cat"
397
+
398
+  # Don't try to install TAP driver signature if it does not exist.
399
+  File /nonfatal "${GEN}\amd64\${PRODUCT_TAP_ID}.cat"
398 400
 
399 401
 goto tapend
400 402
 
... ...
@@ -408,7 +416,9 @@ tap-32bit:
408 408
   SetOutPath "$INSTDIR\driver"
409 409
   File "${GEN}\i386\OemWin2k.inf"
410 410
   File "${GEN}\i386\${TAPDRV}"
411
-  File "${GEN}\i386\${PRODUCT_TAP_ID}.cat"
411
+
412
+  # Don't try to install TAP driver signature if it does not exist.
413
+  File /nonfatal "${GEN}\i386\${PRODUCT_TAP_ID}.cat"
412 414
 
413 415
   tapend:
414 416
 
... ...
@@ -428,6 +438,8 @@ SectionEnd
428 428
 
429 429
 Section "Add Shortcuts to Start Menu" SecAddShortcuts
430 430
 
431
+  ; Required to handle shortcuts properly on Vista/7
432
+  SetShellVarContext all
431 433
   SetOverwrite on
432 434
   CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
433 435
   CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}\Documentation"
... ...
@@ -682,6 +694,9 @@ FunctionEnd
682 682
 
683 683
 Section "Uninstall"
684 684
 
685
+  ; Required to handle shortcuts properly on Vista/7
686
+  SetShellVarContext all
687
+
685 688
   ; Stop OpenVPN if currently running
686 689
 
687 690
   DetailPrint "Service REMOVE"