From 7df0cdef114ee8bdc4d9489c8a7d0fa22eae6ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuli=20Sepp=C3=A4nen?= Date: Fri, 27 Feb 2015 13:02:01 +0200 Subject: [PATCH] Removed openvpn-gui.exe restart functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems that openvpn-gui.exe loads libeay32.dll when it launches. This prevents the OpenVPN installer from overwriting that library when it needs to, in the "Dependencies" section. There are various workarounds, none of which are particularly pretty, so for now the restart functionality is simply removed. Signed-off-by: Samuli Seppänen --- nsis/openvpn-gui.nsi | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/nsis/openvpn-gui.nsi b/nsis/openvpn-gui.nsi index f9eac6a..8fea746 100644 --- a/nsis/openvpn-gui.nsi +++ b/nsis/openvpn-gui.nsi @@ -22,8 +22,6 @@ SetCompressor lzma !define MULTIUSER_EXECUTIONLEVEL Admin !define PACKAGE_NAME "OpenVPN-GUI" !define REG_KEY "HKLM Software\OpenVPN-GUI" -!define MUI_FINISHPAGE_RUN_TEXT "Start OpenVPN GUI" -!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\openvpn-gui.exe" ; Basic configuration Name "OpenVPN-GUI ${VERSION}" @@ -40,15 +38,12 @@ InstallDir "$PROGRAMFILES\${PACKAGE_NAME}" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES -!define MUI_PAGE_CUSTOMFUNCTION_SHOW StartGUI.show !insertmacro MUI_PAGE_FINISH ; Uninstaller pages !insertmacro MUI_UNPAGE_COMPONENTS !insertmacro MUI_UNPAGE_INSTFILES -Var /Global strGuiKilled ; Track if GUI was killed so we can tick the checkbox to start it upon installer finish - ;-------------------------------- ; Macros @@ -98,16 +93,6 @@ Function un.onInit ${EndIf} FunctionEnd -Function StartGUI.show - SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED} 0 - ShowWindow $mui.FinishPage.Run 0 - - ; if we killed the GUI to do the install/upgrade, automatically tick the "Start OpenVPN GUI" option - ${If} $strGuiKilled == "1" - SendMessage $mui.FinishPage.Run ${BM_SETCHECK} ${BST_CHECKED} 1 - ${EndIf} -FunctionEnd - ;-------------------- ; Sections @@ -116,6 +101,7 @@ Section -pre FindWindow $0 "OpenVPN-GUI" StrCmp $0 0 guiNotRunning + ; In silent mode always kill the GUI MessageBox MB_YESNO|MB_ICONEXCLAMATION "To perform the specified operation, OpenVPN-GUI needs to be closed. Shall I close it?" /SD IDYES IDNO guiEndNo DetailPrint "Closing OpenVPN-GUI..." Goto guiEndYes @@ -126,15 +112,11 @@ Section -pre guiEndYes: ; user wants to close GUI as part of install/upgrade FindWindow $0 "OpenVPN-GUI" - IntCmp $0 0 guiClosed + IntCmp $0 0 guiNotRunning SendMessage $0 ${WM_CLOSE} 0 0 Sleep 100 Goto guiEndYes - guiClosed: - ; Keep track that we closed the GUI so we can offer to auto (re)start it later - StrCpy $strGuiKilled "1" - guiNotRunning: ; openvpn-gui not running/closed successfully, carry on with install/upgrade