From 110e42d199e735ab1a31388c5678f59d0fa9510c Mon Sep 17 00:00:00 2001 From: Samuli Seppänen Date: Tue, 15 Mar 2011 16:36:41 +0200 Subject: Fixes to win/openvpn.nsi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support for generating installer with unsigned TAP drivers. Fixed Windows Vista/7 Start menu shortcut uninstall failure. Signed-off-by: Samuli Seppänen Acked-by: James Yonan Signed-off-by: David Sommerseth --- win/openvpn.nsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/win/openvpn.nsi b/win/openvpn.nsi index cbae21a..12226d5 100755 --- a/win/openvpn.nsi +++ b/win/openvpn.nsi @@ -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" -- cgit