Opened 6 years ago

Last modified 22 months ago

#213 accepted Bug / Defect

OpenVPN GUI on 64-bit Windows (registry issue)

Reported by: ProGOLD Owned by: Samuli Seppänen
Priority: minor Milestone: release 2.4
Component: Generic / unclassified Version: OpenVPN 2.2.2 (Community Ed)
Severity: Patch Queue: New / awaiting ACK Keywords: GUI x86_64 nsis windows
Cc:

Description

Hello. My name is Kirill and I apologize for my English.

Creating an installer for my own VPN, based on OpenVPN, I found a bug with 64-bit Windows systems. The registry in 64-bit versions of Windows is divided into 32-bit and 64-bit keys. (http://support.microsoft.com/kb/305097/) So, OpenVPN registry keys are creating in HKLM/Software/Wow6432node/OpenVPN instead of HKLM/Software/OpenVPN. And OpenVPN GUI application does not take this into account. If OpenVPN was installed in default location (C:\Program Files (x86)\OpenVPN), I guess, GUI does not find registry keys, and it uses default values. Otherwise, it causes an error in CreateProcess? system call, because openvpn.exe does not exist in default folder.

If you have additional questions, I am ready to answer.

Thanks in advance.

Change History (7)

comment:1 Changed 6 years ago by David Sommerseth

Keywords: GUI x86_64 added; windows gui 64 removed
Owner: set to Samuli Seppänen
Priority: majorminor
Status: newassigned

comment:2 Changed 5 years ago by Samuli Seppänen

Keywords: nsis windows added
Milestone: release 2.2.2release 2.4
Status: assignedaccepted

I will have a look at this and if necessary fix this before 2.4.

comment:3 Changed 5 years ago by WebFooL

In my combined installer i use the x64.nsh and if statements so it installs the regvalues correct.

In the "SecService?" section:

	${If} ${RunningX64}
	SetRegView 64
	; set registry parameters for openvpnserv
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\Wow6432Node\${PACKAGE_NAME}" "config_dir" "$INSTDIR\config"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\Wow6432Node\${PACKAGE_NAME}" "config_ext"  "${OPENVPN_CONFIG_EXT}"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\Wow6432Node\${PACKAGE_NAME}" "exe_path"    "$INSTDIR\bin\openvpn.exe"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\Wow6432Node\${PACKAGE_NAME}" "log_dir"     "$INSTDIR\log"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\Wow6432Node\${PACKAGE_NAME}" "priority"    "NORMAL_PRIORITY_CLASS"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\Wow6432Node\${PACKAGE_NAME}" "log_append"  "0"
        ${Else}
        SetRegView 32
	; set registry parameters for openvpnserv
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PACKAGE_NAME}" "config_dir" "$INSTDIR\config"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PACKAGE_NAME}" "config_ext"  "${OPENVPN_CONFIG_EXT}"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PACKAGE_NAME}" "exe_path"    "$INSTDIR\bin\openvpn.exe"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PACKAGE_NAME}" "log_dir"     "$INSTDIR\log"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PACKAGE_NAME}" "priority"    "NORMAL_PRIORITY_CLASS"
	!insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\${PACKAGE_NAME}" "log_append"  "0"
        ${EndIf}

And in the "-post" section:

        ; Store install folder in registry
	${If} ${RunningX64}
	SetRegView 64
        WriteRegStr HKLM "SOFTWARE\Wow6432Node\${PACKAGE_NAME}" "" "$INSTDIR"
        ${Else}
        SetRegView 32
        WriteRegStr HKLM "SOFTWARE\${PACKAGE_NAME}" "" "$INSTDIR"
        ${EndIf}
	

And it works fine with OpenVPN-GUI 5.0.0.
Don't know about other versions of the OpenVPN-GUI.

Last edited 5 years ago by WebFooL (previous) (diff)

comment:4 Changed 2 years ago by Samuli Seppänen

There have been plenty of registry-related changes to OpenVPN-GUI. Please test one of the recent snapshot installers to see if this problem is still reproducible.

comment:5 Changed 22 months ago by debbie10t

Linked to: https://github.com/OpenVPN/openvpn-build/issues/49

These are the full details of this problem and as it has been outstanding for over three years ..

To reproduce (All actions are "Run as administrator"):

  1. Uninstall openvpn completely:
    Run Openvpn Uninstall.exe
    Delete registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Openvpn
  1. Install Openvpn (Use default settings)
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\OpenVPN]
    "config_dir"="C:\\Program Files\\OpenVPN\\config"
    "config_ext"="ovpn"
    "exe_path"="C:\\Program Files\\OpenVPN\\bin\\openvpn.exe"
    "log_dir"="C:\\Program Files\\OpenVPN\\log"
    "priority"="NORMAL_PRIORITY_CLASS"
    "log_append"="0"
    @="C:\\Program Files\\OpenVPN"
    
  1. Uninstall Openvpn Only:
    Run Openvpn Uninstall.exe
    Do not edit registry
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\OpenVPN]
    "config_dir"="C:\\Program Files\\OpenVPN\\config"
    "config_ext"="ovpn"
    "exe_path"="C:\\Program Files\\OpenVPN\\bin\\openvpn.exe"
    "log_dir"="C:\\Program Files\\OpenVPN\\log"
    "priority"="NORMAL_PRIORITY_CLASS"
    "log_append"="0"
    @="C:\\Program Files\\OpenVPN"
    
  1. Install Openvpn to a different path (eg: C:\#Tools)
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\OpenVPN]
    "config_dir"="C:\\Program Files\\OpenVPN\\config"
    "config_ext"="ovpn"
    "exe_path"="C:\\Program Files\\OpenVPN\\bin\\openvpn.exe"
    "log_dir"="C:\\Program Files\\OpenVPN\\log"
    "priority"="NORMAL_PRIORITY_CLASS"
    "log_append"="0"
    @="C:\\#Tools\\OpenVPN"
    
Note
config_dir, exe_path and log_dir are not correct.

Extra Notes:

  1. The "readme" file: INSTALL-win32.txt even on 64bit
  2. Is it possible to set the "readme" to explicitly open "on top" of all other windows because it quite often opens below other windows.
  3. I Still do not like joint 32/64bit installer. Double the size of the download and for no good reason.

comment:6 in reply to:  5 Changed 22 months ago by Gert Döring

Replying to debbie10t:

  1. The "readme" file: INSTALL-win32.txt even on 64bit

Well, the architecture *is* called "WIN32" - even if 64bit. Not our decision. (The alternative is "WIN16").

  1. I Still do not like joint 32/64bit installer. Double the size of the download and for no good reason.

So, I take it you are volunteering to do all the extra work involved in building and testing two installers? Because "I do not like it" is not a very convincing argument for causing more work for other people.

comment:7 in reply to:  5 Changed 22 months ago by Samuli Seppänen

Replying to debbie10t:

  1. Uninstall Openvpn Only:
    Run Openvpn Uninstall.exe
    Do not edit registry

Does "OpenVPN only" means that the service, openssl, lzo, etc. are not uninstalled? How did you do this? Looking at openvpn.nsi it looks like the Uninstall section is static (=remove everything, always).

  1. Install Openvpn to a different path (eg: C:\#Tools)
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\OpenVPN]
    "config_dir"="C:\\Program Files\\OpenVPN\\config"
    "config_ext"="ovpn"
    "exe_path"="C:\\Program Files\\OpenVPN\\bin\\openvpn.exe"
    "log_dir"="C:\\Program Files\\OpenVPN\\log"
    "priority"="NORMAL_PRIORITY_CLASS"
    "log_append"="0"
    @="C:\\#Tools\\OpenVPN"
    

This just a variant of "Value of exe_path in registry not updated during reinstall" issue you linked to.

Extra Notes:

  1. The "readme" file: INSTALL-win32.txt even on 64bit

Well this is indeed something that can be trivially fixed, now that the file is hosted in openvpn-build. How about issuing a PR?

  1. Is it possible to set the "readme" to explicitly open "on top" of all other windows because it quite often opens below other windows.

This would be good. I'm sure there is a way, I just don't know how complex it would be.

  1. I Still do not like joint 32/64bit installer. Double the size of the download and for no good reason.

The combined installer is only 1.66x the size of the old 64-bit installer, or 1.93x larger than the 32-bit installer. Significant increase indeed, but the total size (3724 KB) is still quite reasonable imho.

As for the actual benefits: people no longer have to figure out whether they need (or should have) a 32-bit or 64-bit version. For many this may not be an obvious choice. Plus support should a bit easier as we know in which registry the registry keys will be, and that usually OpenVPN is installed to C:\Program Files\OpenVPN. Also, as Gert said, testing procedures will be simplified a bit.

Note: See TracTickets for help on using tickets.