Hi all,

I took a stab at fixing Trac ticket #249:

<https://community.openvpn.net/openvpn/ticket/249>

The fix does not seem to cause any regressions if using the interactive
installation method. Silent installation has not been tested yet. Links
to new installers are here (build 002):

<https://community.openvpn.net/openvpn/ticket/249#comment:2>

Please test the installers and/or comment on the patch. It was aped from
the suggestion given by the bug reporter which seemed to make sense.

Best regards,

-- 
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock

>From 209acaca040b14917b40ffd5314cde79efe8dd7c Mon Sep 17 00:00:00 2001
From: Samuli Seppänen <sam...@openvpn.net>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Fri, 11 Jan 2013 15:00:24 +0200
Subject: [PATCH 2/3] Fix to Trac ticket #249

---
 windows-nsis/openvpn.nsi |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/windows-nsis/openvpn.nsi b/windows-nsis/openvpn.nsi
index afc382f..13543f6 100755
--- a/windows-nsis/openvpn.nsi
+++ b/windows-nsis/openvpn.nsi
@@ -35,6 +35,9 @@ ShowUninstDetails show
 ;Remember install folder
 InstallDirRegKey HKLM "SOFTWARE\${PACKAGE_NAME}" ""
 
+; This is required for silent installations to work
+InstallDir "$PROGRAMFILES\${PACKAGE_NAME}"
+
 ;--------------------------------
 ;Modern UI Configuration
 
@@ -384,13 +387,12 @@ Function .onInit
 
 	!insertmacro MULTIUSER_INIT
 	SetShellVarContext all
-
-	${If} "${ARCH}" == "x86_64"
-		SetRegView 64
-		StrCpy $INSTDIR "$PROGRAMFILES64\${PACKAGE_NAME}"
-	${Else}
-		StrCpy $INSTDIR "$PROGRAMFILES\${PACKAGE_NAME}"
-	${EndIf}
+    
+    ${If} "${ARCH}" == "x86_64"
+        SetRegView 64
+        StrCmp $INSTDIR "$PROGRAMFILES\${PACKAGE_NAME}" 0 +2
+        StrCpy $INSTDIR "$PROGRAMFILES64\${PACKAGE_NAME}"
+    ${EndIf}
 
 	# Delete previous start menu
 	RMDir /r "$SMPROGRAMS\${PACKAGE_NAME}"
-- 
1.7.9.5

Reply via email to