From 755e09e5c1f68a886c7b3960d9dfd2c9fc57ccf4 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Mon, 27 Jul 2020 03:54:14 +0200 Subject: [PATCH 01/11] Don't include OpenSSL headers in vpndrvinst.c The inclusion of the headers is probably a very old leftover, from when OpenSSL was not encapsulated into Mayaqua yet. In fact, there was a "HAM_C" (defined in vpndrvinst.c) definition check in Mayaqua/Encrypt.h preventing the redefinition of OpenSSL types. --- src/Mayaqua/MayaType.h | 2 +- src/vpndrvinst/vpndrvinst.c | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/Mayaqua/MayaType.h b/src/Mayaqua/MayaType.h index d7390a08..cc29bbed 100644 --- a/src/Mayaqua/MayaType.h +++ b/src/Mayaqua/MayaType.h @@ -16,7 +16,7 @@ #endif // WINDOWS_H -#if !defined(ENCRYPT_C) && !defined(HAM_C) +#if !defined(ENCRYPT_C) // Structure which is used by OpenSSL typedef struct x509_st X509; typedef struct evp_pkey_st EVP_PKEY; diff --git a/src/vpndrvinst/vpndrvinst.c b/src/vpndrvinst/vpndrvinst.c index b18421a5..5baf1d7a 100644 --- a/src/vpndrvinst/vpndrvinst.c +++ b/src/vpndrvinst/vpndrvinst.c @@ -4,8 +4,6 @@ #include -#define HAM_C - #ifdef WIN32 #define HAM_WIN32 #define _WIN32_WINNT 0x0502 @@ -27,17 +25,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include "vpndrvinst.h" From c084ce30f985a988506f3e99284d9ca78f4b0169 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Mon, 27 Jul 2020 04:38:51 +0200 Subject: [PATCH 02/11] CMake: build vpndrvinst --- src/CMakeLists.txt | 4 ++++ src/vpndrvinst/CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/vpndrvinst/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d78ef5f..fb71a372 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -155,6 +155,10 @@ if(WIN32) add_subdirectory(PenCore) add_dependencies(hamcore-archive-build PenCore) + # vpndrvinst + add_subdirectory(vpndrvinst) + add_dependencies(hamcore-archive-build vpndrvinst) + # vpnsmgr add_subdirectory(vpnsmgr) diff --git a/src/vpndrvinst/CMakeLists.txt b/src/vpndrvinst/CMakeLists.txt new file mode 100644 index 00000000..05f4c568 --- /dev/null +++ b/src/vpndrvinst/CMakeLists.txt @@ -0,0 +1,33 @@ +if(NOT WIN32) + message(FATAL_ERROR "VPN Driver Installer is available only for Windows.") +endif() + +set(COMPONENT_NAME "Driver Installer") +set(COMPONENT_INTERNAL_NAME "vpndrvinst") + +add_executable(vpndrvinst WIN32 vpndrvinst.c vpndrvinst.h) + +get_filename_component(COMPONENT_FILE_NAME vpndrvinst NAME) +set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe") + +configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc") +target_sources(vpndrvinst PRIVATE "vpndrvinst.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc") + +# Fixes manifest authoring error c1010001 +set_target_properties(vpndrvinst PROPERTIES LINK_FLAGS "/MANIFESTUAC:level='requireAdministrator'") + +if(${COMPILER_ARCHITECTURE} STREQUAL "x64") + target_sources(vpndrvinst PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_admin.manifest") +else() + target_sources(vpndrvinst PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_admin.manifest") +endif() + +set_target_properties(vpndrvinst + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${TOP_DIRECTORY}/src/bin/hamcore" + LIBRARY_OUTPUT_DIRECTORY "${TOP_DIRECTORY}/src/bin/hamcore" + RUNTIME_OUTPUT_DIRECTORY "${TOP_DIRECTORY}/src/bin/hamcore" + PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}" +) + +target_link_libraries(vpndrvinst cedar mayaqua) From 35200a29ea8ed97777f1b879fc07f479e6b54c63 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Thu, 23 Jul 2020 02:00:58 +0200 Subject: [PATCH 03/11] CMake: build vpnsetup --- src/CMakeLists.txt | 3 +++ src/vpnsetup/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/vpnsetup/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fb71a372..aa357290 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -164,6 +164,9 @@ if(WIN32) # vpncmgr add_subdirectory(vpncmgr) + + # vpnsetup + add_subdirectory(vpnsetup) endif() if(UNIX) diff --git a/src/vpnsetup/CMakeLists.txt b/src/vpnsetup/CMakeLists.txt new file mode 100644 index 00000000..2e6b595c --- /dev/null +++ b/src/vpnsetup/CMakeLists.txt @@ -0,0 +1,30 @@ +if(NOT WIN32) + message(FATAL_ERROR "VPN Setup is available only for Windows.") +endif() + +set(COMPONENT_NAME "Setup") +set(COMPONENT_INTERNAL_NAME "vpnsetup") + +add_executable(vpnsetup WIN32 vpnsetup.c vpnsetup.rc) + +get_filename_component(COMPONENT_FILE_NAME vpnsetup NAME) +set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe") + +configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc") +target_sources(vpnsetup PRIVATE "vpnsetup.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc") + +if(${COMPILER_ARCHITECTURE} STREQUAL "x64") + target_sources(vpnsetup PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x64_user.manifest") +else() + target_sources(vpnsetup PRIVATE "${TOP_DIRECTORY}/src/BuildFiles/Manifests/x86_user.manifest") +endif() + +set_target_properties(vpnsetup + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}" + LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}" + RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}" + PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}" +) + +target_link_libraries(vpnsetup cedar mayaqua) From cc61c90372decff35efc1c0319959d6e4dedbe03 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Thu, 23 Jul 2020 03:11:15 +0200 Subject: [PATCH 04/11] Cedar/SW.c: remove "install_src.dat" file check Previously, the file needed to be present in order for the setup to work. This commit removes the requirement so that the setup can be ran from the build directory without the need to copy the file (which is now removed from the repository). --- src/Cedar/SW.c | 9 --------- src/bin/hamcore/install_src.dat | 1 - src/bin/hamcore/strtable_cn.stb | 1 - src/bin/hamcore/strtable_en.stb | 1 - src/bin/hamcore/strtable_ja.stb | 1 - src/bin/hamcore/strtable_ko.stb | 1 - src/bin/hamcore/strtable_pt_br.stb | 2 +- src/bin/hamcore/strtable_ru.stb | 1 - src/bin/hamcore/strtable_tw.stb | 1 - src/bin/install_src.dat | 1 - 10 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 src/bin/hamcore/install_src.dat delete mode 100644 src/bin/install_src.dat diff --git a/src/Cedar/SW.c b/src/Cedar/SW.c index 26c8ebd0..45812a5c 100644 --- a/src/Cedar/SW.c +++ b/src/Cedar/SW.c @@ -289,8 +289,6 @@ bool SwAddBasicFilesToList(LIST *o, char *component_name) return false; } - Add(o, SwNewSfxFile("install_src.dat", L"|install_src.dat")); - return true; } @@ -5633,13 +5631,6 @@ UINT SwWelcomeDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, WIZARD *wiz break; case WM_WIZ_NEXT: - if (IsFileExistsW(L"@install_src.dat") == false) - { - // Vpnsetup.exe is launched from other than the installation source - MsgBoxEx(hWnd, MB_ICONSTOP, _UU("SW_NOT_INSTALL_SRC")); - break; - } - if (MsIsKB3033929RequiredAndMissing()) { // KB3033929 is missing diff --git a/src/bin/hamcore/install_src.dat b/src/bin/hamcore/install_src.dat deleted file mode 100644 index 553c049f..00000000 --- a/src/bin/hamcore/install_src.dat +++ /dev/null @@ -1 +0,0 @@ -TanakaJiro!!! \ No newline at end of file diff --git a/src/bin/hamcore/strtable_cn.stb b/src/bin/hamcore/strtable_cn.stb index 3a00ce62..e5143bee 100644 --- a/src/bin/hamcore/strtable_cn.stb +++ b/src/bin/hamcore/strtable_cn.stb @@ -7178,7 +7178,6 @@ SW_DIR_DST_IS_SYSTEM_MODE 同样的软件已经在指定目录中以系统模 SW_DIR_DST_IS_USER_MODE 同样的软件已经在指定目录中以用户模式安装。\r\n\r\n请指定另外一个目录。 SW_SYSTEM_MODE_ALREADY_INSTALLED 本软件 "%s" 以系统模式被安装在这台电脑上。\r\n\r\n同样的软件以用户模式和系统模式安装在同一台电脑上会发生冲突。\r\n\r\n您确定要以用户模式继续进行安装? -SW_NOT_INSTALL_SRC 安装程序已在一个外部的安装源执行。\r\n\r\n不能再继续安装。 SW_SETUPLOG_CORRUPTED "setuplog.dat" 文件已被破坏。 SW_MSI_UNINSTALL_FAILED 之前的版本 %s (产品号: "%S")已安装。 Windows安装工具卸载旧版本失败。\r\n\r\n请您手动卸载并且重启本安装工具。 SW_MSI_UNINSTALL_REBOOT_REQUIRED Windows 安装工具已经卸载旧版本 %s。请重启电脑。\r\n\r\n点击结束按钮并且手动重启电脑,然后在电脑重启后,重启本安装工具。 diff --git a/src/bin/hamcore/strtable_en.stb b/src/bin/hamcore/strtable_en.stb index 326b8e89..0a800128 100644 --- a/src/bin/hamcore/strtable_en.stb +++ b/src/bin/hamcore/strtable_en.stb @@ -7171,7 +7171,6 @@ SW_DIR_DST_IS_SYSTEM_MODE The same software is already installed on the spec SW_DIR_DST_IS_USER_MODE The same software is already installed on the specified directory as the User Mode.\r\n\r\nPlease specify another directory. SW_SYSTEM_MODE_ALREADY_INSTALLED The software "%s" is already installed on this computer as the System Mode.\r\n\r\nBoth the System Mode and the User Mode installation of the same software on the same computer will conflict.\r\n\r\nDo you really want to continue the installation as the User Mode? -SW_NOT_INSTALL_SRC The setup program has been executed from outside an install source.\r\n\r\nUnable to continue the installation. SW_SETUPLOG_CORRUPTED The "setuplog.dat" file is broken. SW_MSI_UNINSTALL_FAILED The older version of %s (Product Code: "%S") is installed. Windows Installer failed to uninstall this older version.\r\n\r\nPlease uninstall this older version manually and restart this installer again. SW_MSI_UNINSTALL_REBOOT_REQUIRED Windows Installer has uninstalled the older version of %s. The reboot of computer is required.\r\n\r\nPress Finish button and reboot the computer MANUALLY, and restart this installer after the reboot. diff --git a/src/bin/hamcore/strtable_ja.stb b/src/bin/hamcore/strtable_ja.stb index 7e7d6fa3..7016c72e 100644 --- a/src/bin/hamcore/strtable_ja.stb +++ b/src/bin/hamcore/strtable_ja.stb @@ -7173,7 +7173,6 @@ SW_DIR_DST_IS_SYSTEM_MODE 指定されたディレクトリにはすでに SW_DIR_DST_IS_USER_MODE 指定されたディレクトリにはすでに本ソフトウェアがユーザーモードでインストールされています。\r\n\r\n別のディレクトリを指定してください。 SW_SYSTEM_MODE_ALREADY_INSTALLED ソフトウェア 「%s」 はすでにこのコンピュータにシステムモードでインストールされています。\r\n\r\n同一コンピュータに同一コンポーネントをシステムモードとユーザーモードの両方でインストールする場合は競合が発生する場合があります。\r\n\r\n本当にユーザーモードでインストールを実行しますか? -SW_NOT_INSTALL_SRC セットアッププログラムがインストールソース以外から起動されました。\r\n\r\nインストールを続行できません。 SW_SETUPLOG_CORRUPTED setuplog.dat ファイルが破損しています。 SW_MSI_UNINSTALL_FAILED %s の古いバージョン (製品コード: "%S") を Windows Installer でアンインストールしようとしましたが、アンインストールに失敗しました。\r\n\r\nこのバージョンを手動でアンインストールしてから、再度このインストーラを起動してください。 SW_MSI_UNINSTALL_REBOOT_REQUIRED %s の古いバージョンを Windows Installer でアンインストールしました。コンピュータの再起動が必要です。\r\n\r\n「完了」をクリックしてから手動でコンピュータを再起動し、その後もう一度このインストーラを起動してください。 diff --git a/src/bin/hamcore/strtable_ko.stb b/src/bin/hamcore/strtable_ko.stb index 864d8a0b..60cdfba8 100644 --- a/src/bin/hamcore/strtable_ko.stb +++ b/src/bin/hamcore/strtable_ko.stb @@ -7149,7 +7149,6 @@ SW_DIR_DST_IS_SYSTEM_MODE 지정된 디렉토리에 이미 소프트웨어가 SW_DIR_DST_IS_USER_MODE 지정된 디렉토리에 이미 소프트웨어가 사용자 모드로 설치되어 있습니다. \r\n\r\n 다른 디렉토리를 지정하십시오. SW_SYSTEM_MODE_ALREADY_INSTALLED 소프트웨어 '%s'는 이미이 컴퓨터 시스템 모드로 설치되어 있습니다. \r\n\r\n 동일한 컴퓨터에 동일한 구성 요소를 시스템 모드와 사용자 모드에서 설치하는 경우 충돌이 발생할 수 있습니다. \r\n\r\n 정말 사용자 모드에서 설치를 실행 하시겠습니까? -SW_NOT_INSTALL_SRC 설치 프로그램이 설치 소스 이외에서 시작되었습니다. \r\n\r\n 설치를 계속할 수 없습니다. SW_SETUPLOG_CORRUPTED setuplog.dat 파일이 손상되어 있습니다. SW_MSI_UNINSTALL_FAILED %s의 이전 버전 (제품 코드:"%S")을 Windows Installer에서 제거하려고했지만 제거에 실패했습니다. \r\n\r\n이 버전을 수동으로 제거하고 다시 설치 프로그램을 시작하십시오. SW_MSI_UNINSTALL_REBOOT_REQUIRED %s의 이전 버전을 Windows Installer에서 제거했습니다. 컴퓨터를 다시 시작해야합니다. \r\n\r\n "완료"를 클릭하여 수동으로 컴퓨터를 다시 시작한 다음 다시 설치 프로그램을 시작하십시오. diff --git a/src/bin/hamcore/strtable_pt_br.stb b/src/bin/hamcore/strtable_pt_br.stb index c5c6ea90..b5f9c434 100644 --- a/src/bin/hamcore/strtable_pt_br.stb +++ b/src/bin/hamcore/strtable_pt_br.stb @@ -6897,7 +6897,7 @@ SW_DIR_DST_IS_BROKEN Unable to read a file "%s" which is on the specified direct SW_DIR_DST_IS_SYSTEM_MODE The same software is already installed on the specified directory as the System Mode.\r\n\r\nPlease specify another directory. SW_DIR_DST_IS_USER_MODE The same software is already installed on the specified directory as the User Mode.\r\n\r\nPlease specify another directory. SW_SYSTEM_MODE_ALREADY_INSTALLED The software "%s" is already installed on this computer as the System Mode.\r\n\r\nBoth the System Mode and the User Mode installation of the same software on the same computer will conflict.\r\n\r\nDo you really want to continue the installation as the User Mode? -SW_NOT_INSTALL_SRC The setup program has been executed from outside an install source.\r\n\r\nUnable to continue the installation. + SW_SETUPLOG_CORRUPTED The "setuplog.dat" file is broken. SW_MSI_UNINSTALL_FAILED The older version of %s (Product Code: "%S") is installed. Windows Installer failed to uninstall this older version.\r\n\r\nPlease uninstall this older version manually and restart this installer again. SW_MSI_UNINSTALL_REBOOT_REQUIRED Windows Installer has uninstalled the older version of %s. The reboot of computer is required.\r\n\r\nPress Finish button and reboot the computer MANUALLY, and restart this installer after the reboot. diff --git a/src/bin/hamcore/strtable_ru.stb b/src/bin/hamcore/strtable_ru.stb index 55e4a734..255c402e 100644 --- a/src/bin/hamcore/strtable_ru.stb +++ b/src/bin/hamcore/strtable_ru.stb @@ -7158,7 +7158,6 @@ SW_DIR_DST_IS_SYSTEM_MODE The same software is already installed on the spec SW_DIR_DST_IS_USER_MODE The same software is already installed on the specified directory as the User Mode.\r\n\r\nPlease specify another directory. SW_SYSTEM_MODE_ALREADY_INSTALLED The software "%s" is already installed on this computer as the System Mode.\r\n\r\nBoth the System Mode and the User Mode installation of the same software on the same computer will conflict.\r\n\r\nDo you really want to continue the installation as the User Mode? -SW_NOT_INSTALL_SRC The setup program has been executed from outside an install source.\r\n\r\nUnable to continue the installation. SW_SETUPLOG_CORRUPTED The "setuplog.dat" file is broken. SW_MSI_UNINSTALL_FAILED The older version of %s (Product Code: "%S") is installed. Windows Installer failed to uninstall this older version.\r\n\r\nPlease uninstall this older version manually and restart this installer again. SW_MSI_UNINSTALL_REBOOT_REQUIRED Windows Installer has uninstalled the older version of %s. The reboot of computer is required.\r\n\r\nPress Finish button and reboot the computer MANUALLY, and restart this installer after the reboot. diff --git a/src/bin/hamcore/strtable_tw.stb b/src/bin/hamcore/strtable_tw.stb index 9e98bdc8..7cbaa0ba 100644 --- a/src/bin/hamcore/strtable_tw.stb +++ b/src/bin/hamcore/strtable_tw.stb @@ -7180,7 +7180,6 @@ SW_DIR_DST_IS_SYSTEM_MODE 同樣的軟體已經在指定目錄中以系統模 SW_DIR_DST_IS_USER_MODE 同樣的軟體已經在指定目錄中以使用者模式安裝。\r\n\r\n請指定另外一個目錄。 SW_SYSTEM_MODE_ALREADY_INSTALLED 本軟體 "%s" 以系統模式被安裝在這台電腦上。\r\n\r\n同樣的軟體以使用者模式和系統模式安裝在同一台電腦上會發生衝突。\r\n\r\n您確定要以使用者模式繼續進行安裝? -SW_NOT_INSTALL_SRC 安裝程式已在一個外部的安裝源執行。\r\n\r\n不能再繼續安裝。 SW_SETUPLOG_CORRUPTED "setuplog.dat" 檔已被破壞。 SW_MSI_UNINSTALL_FAILED 之前的版本 %s (產品號: "%S")已安裝。 Windows安裝工具移除舊版本失敗。\r\n\r\n請您手動移除並且重啟本安裝工具。 SW_MSI_UNINSTALL_REBOOT_REQUIRED Windows 安裝工具已經移除舊版本 %s。請重啟電腦。\r\n\r\n點擊結束按鈕並且手動重啟電腦,然後在電腦重啟後,重啟本安裝工具。 diff --git a/src/bin/install_src.dat b/src/bin/install_src.dat deleted file mode 100644 index 553c049f..00000000 --- a/src/bin/install_src.dat +++ /dev/null @@ -1 +0,0 @@ -TanakaJiro!!! \ No newline at end of file From 24d64222eab43bd99a2758d4a71ad8e615113e87 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Sun, 26 Jul 2020 00:06:15 +0200 Subject: [PATCH 05/11] Cedar/SW.c: load "vpnsetup.exe" directly instead of expecting it to be in "hamcore.se2" The MSBuild project built the binary into "src/bin/hamcore", causing it to be added to "hamcore.se2". As hinted by the name of the file ("vpnsetup_nosign.exe"), it is not signed by BuildUtil, possibly to save time (the setup package is signed). The CMake project builds the binary in the same directory as the other ones, allowing the setup to install them without the need to build a package. --- src/Cedar/SW.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cedar/SW.c b/src/Cedar/SW.c index 45812a5c..0a1fa8ea 100644 --- a/src/Cedar/SW.c +++ b/src/Cedar/SW.c @@ -141,7 +141,7 @@ bool SwCompileSfx(LIST *o, wchar_t *dst_filename) { // Generate the setup.exe file in the Temp directory ConbinePathW(exe_filename, sizeof(exe_filename), MsGetMyTempDirW(), L"setup.exe"); - if (FileCopyW(L"|vpnsetup_nosign.exe", exe_filename)) + if (FileCopyW(L"vpnsetup.exe", exe_filename)) { // Resource updating start HANDLE h = _BeginUpdateResourceW(exe_filename, false); From a3eb115b0af6933acd7ca710090ee78a40f64d9c Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Mon, 27 Jul 2020 05:46:02 +0200 Subject: [PATCH 06/11] Cedar: remove all references to binaries with "_x64" and "_ia64" suffix BuildUtil compiles the project as 32 bit and 64 bit, before building the installer package. 64 bit binaries have the "_x64" suffix and are added to the package alongside the 32 bit ones (that have no suffix). The CMake project compiles the binaries for a single architecture and they have no suffix. We decided that providing two separate installers is the best solution. As for the binaries with the "_ia64" suffix: they never existed during the this repository's lifespan. --- src/Cedar/CM.c | 2 +- src/Cedar/Client.c | 21 ------- src/Cedar/Client.h | 3 - src/Cedar/Command.c | 37 +++---------- src/Cedar/Command.h | 2 - src/Cedar/SM.c | 15 +---- src/Cedar/SW.c | 131 ++++++++------------------------------------ src/Cedar/WinUi.c | 13 ----- 8 files changed, 34 insertions(+), 190 deletions(-) diff --git a/src/Cedar/CM.c b/src/Cedar/CM.c index 63555550..fda76b33 100644 --- a/src/Cedar/CM.c +++ b/src/Cedar/CM.c @@ -1286,7 +1286,7 @@ void *CmExecUiHelperMain() HANDLE h; wchar_t tmp[MAX_SIZE]; - UniFormat(tmp, sizeof(tmp), L"%s\\%S", MsGetExeDirNameW(), CiGetVpnClientExeFileName()); + UniFormat(tmp, sizeof(tmp), L"%s\\%S", MsGetExeDirNameW(), CLIENT_WIN32_EXE_FILENAME); // Start h = Win32RunExW(tmp, SVC_ARG_UIHELP_W, false); diff --git a/src/Cedar/Client.c b/src/Cedar/Client.c index 26dbfc6e..5e5f4b83 100644 --- a/src/Cedar/Client.c +++ b/src/Cedar/Client.c @@ -411,27 +411,6 @@ typedef struct CNC_CONNECT_ERROR_DLG_THREAD_PARAM EVENT *Event; } CNC_CONNECT_ERROR_DLG_THREAD_PARAM; - -// Get the file name of vpnclient.exe in Win32 -char *CiGetVpnClientExeFileName() -{ - if (Is64() == false) - { - return CLIENT_WIN32_EXE_FILENAME; - } - else - { - if (IsX64()) - { - return CLIENT_WIN32_EXE_FILENAME_X64; - } - else - { - return CLIENT_WIN32_EXE_FILENAME_IA64; - } - } -} - // Thread to stop forcibly the Certificate check dialog client void CncCheckCertHaltThread(THREAD *thread, void *param) { diff --git a/src/Cedar/Client.h b/src/Cedar/Client.h index 14b1de96..afe7c985 100644 --- a/src/Cedar/Client.h +++ b/src/Cedar/Client.h @@ -36,8 +36,6 @@ #define CLIENT_NOTIFY_SERVICE_INSTANCENAME GC_SW_SOFTETHER_PREFIX "vpnclient_uihelper" #define CLIENT_WIN32_EXE_FILENAME "vpnclient.exe" -#define CLIENT_WIN32_EXE_FILENAME_X64 "vpnclient_x64.exe" -#define CLIENT_WIN32_EXE_FILENAME_IA64 "vpnclient_ia64.exe" #define CLIENT_CUSTOM_INI_FILENAME "$custom.ini" @@ -599,7 +597,6 @@ bool CtSetCommonProxySetting(CLIENT *c, INTERNET_SETTING *a); // Internal function prototype void CiSendGlobalPulse(CLIENT *c); void CiPulseRecvThread(THREAD *thread, void *param); -char *CiGetVpnClientExeFileName(); void CiServerThread(THREAD *t, void *param); void CiInitSaver(CLIENT *c); void CiFreeSaver(CLIENT *c); diff --git a/src/Cedar/Command.c b/src/Cedar/Command.c index f51f3e4f..5d6fc140 100644 --- a/src/Cedar/Command.c +++ b/src/Cedar/Command.c @@ -886,7 +886,7 @@ void VpnCmdInitBootPath() char tmp[MAX_PATH]; GetExeName(exe_path, sizeof(exe_path)); - if (SearchStrEx(exe_path, "ham.exe", 0, false) != INFINITE || SearchStrEx(exe_path, "ham_x64.exe", 0, false) != INFINITE || SearchStrEx(exe_path, "ham_ia64.exe", 0, false) != INFINITE) + if (SearchStrEx(exe_path, "ham.exe", 0, false) != INFINITE) { return; } @@ -901,7 +901,6 @@ void VpnCmdInitBootPath() if ((CEDAR_VERSION_BUILD >= current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) { - char *src_filename; bool b = false; // Copy the vpncmdsys.exe to system32 if (MsIsNt()) @@ -913,49 +912,27 @@ void VpnCmdInitBootPath() Format(tmp, sizeof(tmp), "%s\\vpncmd.exe", MsGetWindowsDir()); } - src_filename = VPNCMD_BOOTSTRAP_FILENAME; - - if (IsX64()) - { - src_filename = VPNCMD_BOOTSTRAP_FILENAME_X64; - } - - if (IsIA64()) - { - src_filename = VPNCMD_BOOTSTRAP_FILENAME_IA64; - } - - b = true; - if (MsIs64BitWindows() == false || Is64()) { if (IsFile(tmp) == false || (CEDAR_VERSION_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) { - b = FileCopy(src_filename, tmp); + b = FileCopy(VPNCMD_BOOTSTRAP_FILENAME, tmp); } } else { - void *wow; + void *wow = MsDisableWow64FileSystemRedirection(); - wow = MsDisableWow64FileSystemRedirection(); - - if (true) + if (IsFile(tmp) == false || (CEDAR_VERSION_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) { - if (IsFile(tmp) == false || (CEDAR_VERSION_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) - { - b = FileCopy(src_filename, tmp); - } + b = FileCopy(VPNCMD_BOOTSTRAP_FILENAME, tmp); } MsRestoreWow64FileSystemRedirection(wow); - if (true) + if (IsFile(tmp) == false || (CEDAR_VERSION_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) { - if (IsFile(tmp) == false || (CEDAR_VERSION_BUILD > current_ver) || MsRegIsValue(REG_LOCAL_MACHINE, VPNCMD_BOOTSTRAP_REG_KEYNAME, VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH) == false) - { - b = FileCopy(src_filename, tmp); - } + b = FileCopy(VPNCMD_BOOTSTRAP_FILENAME, tmp); } } diff --git a/src/Cedar/Command.h b/src/Cedar/Command.h index 5323be25..3fd66331 100644 --- a/src/Cedar/Command.h +++ b/src/Cedar/Command.h @@ -25,8 +25,6 @@ #define VPNCMD_BOOTSTRAP_REG_VALUENAME_VER "InstalledVersion" #define VPNCMD_BOOTSTRAP_REG_VALUENAME_PATH "InstalledPath" #define VPNCMD_BOOTSTRAP_FILENAME "|vpncmdsys.exe" -#define VPNCMD_BOOTSTRAP_FILENAME_X64 "|vpncmdsys_x64.exe" -#define VPNCMD_BOOTSTRAP_FILENAME_IA64 "|vpncmdsys_ia64.exe" // Traffic test results diff --git a/src/Cedar/SM.c b/src/Cedar/SM.c index bd649c00..f1b1baef 100644 --- a/src/Cedar/SM.c +++ b/src/Cedar/SM.c @@ -20028,26 +20028,17 @@ void SmInitDefaultSettingList() { MS_PROCESS *p = LIST_DATA(pl, i); - if (UniInStr(p->ExeFilenameW, L"vpnserver.exe") || UniInStr(p->ExeFilenameW, L"vpnserver_x64.exe") || - UniInStr(p->ExeFilenameW, L"vpnserver_ia64.exe") || - UniInStr(p->ExeFilenameW, L"vpnbridge.exe") || UniInStr(p->ExeFilenameW, L"vpnbridge_x64.exe") || - UniInStr(p->ExeFilenameW, L"vpnbridge_ia64.exe")) + if (UniInStr(p->ExeFilenameW, L"vpnserver.exe") || UniInStr(p->ExeFilenameW, L"vpnbridge.exe")) { b = true; } - if (UniInStr(p->ExeFilenameW, L"sevpnserver.exe") || UniInStr(p->ExeFilenameW, L"sevpnserver_x64.exe") || - UniInStr(p->ExeFilenameW, L"sevpnserver_ia64.exe") || - UniInStr(p->ExeFilenameW, L"sevpnbridge.exe") || UniInStr(p->ExeFilenameW, L"sevpnbridge_x64.exe") || - UniInStr(p->ExeFilenameW, L"sevpnbridge_ia64.exe")) + if (UniInStr(p->ExeFilenameW, L"sevpnserver.exe") || UniInStr(p->ExeFilenameW, L"sevpnbridge.exe")) { b = true; } - if (UniInStr(p->ExeFilenameW, L"utvpnserver.exe") || UniInStr(p->ExeFilenameW, L"utvpnserver_x64.exe") || - UniInStr(p->ExeFilenameW, L"utvpnserver_ia64.exe") || - UniInStr(p->ExeFilenameW, L"utvpnbridge.exe") || UniInStr(p->ExeFilenameW, L"utvpnbridge_x64.exe") || - UniInStr(p->ExeFilenameW, L"utvpnbridge_ia64.exe")) + if (UniInStr(p->ExeFilenameW, L"utvpnserver.exe") || UniInStr(p->ExeFilenameW, L"utvpnbridge.exe")) { b = true; } diff --git a/src/Cedar/SW.c b/src/Cedar/SW.c index 0a1fa8ea..e444cd13 100644 --- a/src/Cedar/SW.c +++ b/src/Cedar/SW.c @@ -60,27 +60,18 @@ static SW_OLD_MSI old_msi_vpnbridge[] = static char *sfx_vpn_server_bridge_files[] = { "vpnsetup.exe", - "vpnsetup_x64.exe", "vpnserver.exe", - "vpnserver_x64.exe", "vpnbridge.exe", - "vpnbridge_x64.exe", "vpnsmgr.exe", - "vpnsmgr_x64.exe", "vpncmd.exe", - "vpncmd_x64.exe", "hamcore.se2", }; static char *sfx_vpn_client_files[] = { "vpnsetup.exe", - "vpnsetup_x64.exe", "vpnclient.exe", - "vpnclient_x64.exe", "vpncmgr.exe", - "vpncmgr_x64.exe", "vpncmd.exe", - "vpncmd_x64.exe", "vpninstall.exe", "vpnweb.cab", "hamcore.se2", @@ -1971,7 +1962,6 @@ void SwDeleteShortcuts(SW_LOGFILE *logfile) // Uninstall main bool SwUninstallMain(SW *sw, WIZARD_PAGE *wp, SW_COMPONENT *c) { - bool x64 = MsIs64BitWindows(); bool ok; wchar_t tmp[MAX_SIZE]; UINT i; @@ -2347,7 +2337,6 @@ LABEL_CLEANUP: void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) { wchar_t tmp[MAX_SIZE]; - bool x64 = MsIs64BitWindows(); wchar_t src_setup_exe_fullpath[MAX_PATH]; wchar_t src_setup_exe_dir[MAX_PATH]; wchar_t src_setup_exe_filename[MAX_PATH]; @@ -2361,7 +2350,6 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) wchar_t dir_startup[MAX_PATH]; wchar_t tmp1[MAX_SIZE], tmp2[MAX_SIZE]; SW_TASK_COPY *setup_exe; - SW_TASK_COPY *setup_exe_x64; // Validate arguments if (sw == NULL || t == NULL || c == NULL) { @@ -2400,10 +2388,6 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) Add(t->CopyTasks, (setup_exe = SwNewCopyTask(src_setup_exe_filename, L"vpnsetup.exe", src_setup_exe_dir, sw->InstallDir, true, true))); - // Add vpnsetup_x64.exe to the copy list - Add(t->CopyTasks, (setup_exe_x64 = SwNewCopyTask(L"vpnsetup_x64.exe", - L"vpnsetup_x64.exe", src_setup_exe_dir, sw->InstallDir, true, true))); - // Generate the file processing list for each component if (c->Id == SW_CMP_VPN_SERVER) { @@ -2414,18 +2398,9 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) CombinePathW(tmp, sizeof(tmp), sw->InstallDir, L"backup.vpn_server.config"); Add(t->SetSecurityPaths, CopyUniStr(tmp)); - if (x64 == false) - { - vpnserver = SwNewCopyTask(L"vpnserver.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpnsmgr = SwNewCopyTask(L"vpnsmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } - else - { - vpnserver = SwNewCopyTask(L"vpnserver_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmd = SwNewCopyTask(L"vpncmd_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpnsmgr = SwNewCopyTask(L"vpnsmgr_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } + vpnserver = SwNewCopyTask(L"vpnserver.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); + vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); + vpnsmgr = SwNewCopyTask(L"vpnsmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); Add(t->CopyTasks, vpnserver); Add(t->CopyTasks, vpncmd); @@ -2494,18 +2469,9 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) CombinePathW(tmp, sizeof(tmp), sw->InstallDir, L"backup.vpn_bridge.config"); Add(t->SetSecurityPaths, CopyUniStr(tmp)); - if (x64 == false) - { - vpnbridge = SwNewCopyTask(L"vpnbridge.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpnsmgr = SwNewCopyTask(L"vpnsmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } - else - { - vpnbridge = SwNewCopyTask(L"vpnbridge_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmd = SwNewCopyTask(L"vpncmd_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpnsmgr = SwNewCopyTask(L"vpnsmgr_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } + vpnbridge = SwNewCopyTask(L"vpnbridge.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); + vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); + vpnsmgr = SwNewCopyTask(L"vpnsmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); Add(t->CopyTasks, vpnbridge); Add(t->CopyTasks, vpncmd); @@ -2570,7 +2536,6 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) // VPN Client SW_TASK_COPY *ct; SW_TASK_COPY *vpnclient, *vpncmd, *vpncmgr; - SW_TASK_COPY *vpnclient_gomi, *vpncmd_gomi, *vpncmgr_gomi; SW_TASK_COPY *sfx_cache = NULL; SW_TASK_COPY *vpnweb; SW_TASK_COPY *vpninstall; @@ -2579,24 +2544,9 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) CombinePathW(tmp, sizeof(tmp), sw->InstallDir, L"backup.vpn_client.config"); Add(t->SetSecurityPaths, CopyUniStr(tmp)); - if (x64 == false) - { - vpnclient = SwNewCopyTask(L"vpnclient.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmgr = SwNewCopyTask(L"vpncmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpnclient_gomi = SwNewCopyTask(L"vpnclient_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmd_gomi = SwNewCopyTask(L"vpncmd_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmgr_gomi = SwNewCopyTask(L"vpncmgr_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } - else - { - vpnclient = SwNewCopyTask(L"vpnclient_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmd = SwNewCopyTask(L"vpncmd_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmgr = SwNewCopyTask(L"vpncmgr_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpnclient_gomi = SwNewCopyTask(L"vpnclient.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmd_gomi = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmgr_gomi = SwNewCopyTask(L"vpncmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } + vpnclient = SwNewCopyTask(L"vpnclient.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); + vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); + vpncmgr = SwNewCopyTask(L"vpncmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); if (vpncmgr != NULL) { @@ -2625,9 +2575,6 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) Add(t->CopyTasks, vpnclient); Add(t->CopyTasks, vpncmd); Add(t->CopyTasks, vpncmgr); - Add(t->CopyTasks, vpnclient_gomi); - Add(t->CopyTasks, vpncmd_gomi); - Add(t->CopyTasks, vpncmgr_gomi); Add(t->CopyTasks, vpnweb); Add(t->CopyTasks, vpninstall); @@ -2711,16 +2658,8 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) // VPN Server Manager (Tools Only) SW_TASK_COPY *vpncmd, *vpnsmgr; - if (x64 == false) - { - vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpnsmgr = SwNewCopyTask(L"vpnsmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } - else - { - vpncmd = SwNewCopyTask(L"vpncmd_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpnsmgr = SwNewCopyTask(L"vpnsmgr_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } + vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); + vpnsmgr = SwNewCopyTask(L"vpnsmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); Add(t->CopyTasks, vpncmd); Add(t->CopyTasks, vpnsmgr); @@ -2747,16 +2686,8 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) // VPN Client Manager (Tools Only) SW_TASK_COPY *vpncmd, *vpncmgr; - if (x64 == false) - { - vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmgr = SwNewCopyTask(L"vpncmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } - else - { - vpncmd = SwNewCopyTask(L"vpncmd_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpncmgr = SwNewCopyTask(L"vpncmgr_x64.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); - } + vpncmd = SwNewCopyTask(L"vpncmd.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); + vpncmgr = SwNewCopyTask(L"vpncmgr.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); Add(t->CopyTasks, vpncmd); Add(t->CopyTasks, vpncmgr); @@ -3042,7 +2973,6 @@ bool SwInstallMain(SW *sw, WIZARD_PAGE *wp, SW_COMPONENT *c) UINT i; wchar_t tmp[MAX_SIZE * 2]; bool ok; - bool x64 = MsIs64BitWindows(); // Validate arguments if (sw == NULL || wp == NULL || c == NULL) { @@ -3098,7 +3028,7 @@ bool SwInstallMain(SW *sw, WIZARD_PAGE *wp, SW_COMPONENT *c) void *proc_handle = NULL; wchar_t exe[MAX_PATH]; - CombinePathW(exe, sizeof(exe), MsGetExeDirNameW(), L"vpnsetup_x64.exe"); + CombinePathW(exe, sizeof(exe), MsGetExeDirNameW(), L"vpnsetup.exe"); if (MsExecuteEx2W(exe, L"/SUINSTMODE:yes", &proc_handle, true)) { @@ -3669,7 +3599,7 @@ LABEL_CREATE_SHORTCUT: // Run the vpncmd and exit immediately wchar_t fullpath[MAX_PATH]; - ConbinePathW(fullpath, sizeof(fullpath), sw->InstallDir, (MsIsX64() ? L"vpncmd_x64.exe" : L"vpncmd.exe")); + ConbinePathW(fullpath, sizeof(fullpath), sw->InstallDir, (L"vpncmd.exe")); RunW(fullpath, L"/?", true, false); } @@ -6103,49 +6033,34 @@ void SwDefineComponents(SW *sw) char *vpn_server_files[] = { "vpnserver.exe", - "vpnserver_x64.exe", "vpnsmgr.exe", - "vpnsmgr_x64.exe", "vpncmd.exe", - "vpncmd_x64.exe", "hamcore.se2", }; char *vpn_client_files[] = { "vpnclient.exe", - "vpnclient_x64.exe", "vpncmgr.exe", - "vpncmgr_x64.exe", "vpncmd.exe", - "vpncmd_x64.exe", "hamcore.se2", - "vpninstall.exe", - "vpnweb.cab", }; char *vpn_bridge_files[] = { "vpnbridge.exe", - "vpnbridge_x64.exe", "vpnsmgr.exe", - "vpnsmgr_x64.exe", "vpncmd.exe", - "vpncmd_x64.exe", "hamcore.se2", }; char *vpn_smgr_files[] = { "vpnsmgr.exe", - "vpnsmgr_x64.exe", "vpncmd.exe", - "vpncmd_x64.exe", "hamcore.se2", }; char *vpn_cmgr_files[] = { "vpncmgr.exe", - "vpncmgr_x64.exe", "vpncmd.exe", - "vpncmd_x64.exe", "hamcore.se2", }; // Validate arguments @@ -6155,16 +6070,16 @@ void SwDefineComponents(SW *sw) } // VPN Server - c = SwNewComponent(SW_NAME_VPNSERVER, GC_SVC_NAME_VPNSERVER, SW_CMP_VPN_SERVER, ICO_VPNSERVER, 5, (MsIsX64() ? L"vpnserver_x64.exe" : L"vpnserver.exe"), + c = SwNewComponent(SW_NAME_VPNSERVER, GC_SVC_NAME_VPNSERVER, SW_CMP_VPN_SERVER, ICO_VPNSERVER, 5, L"vpnserver.exe", SW_LONG_VPNSERVER, false, sizeof(vpn_server_files) / sizeof(char *), vpn_server_files, - (MsIsX64() ? L"vpnsmgr_x64.exe" : L"vpnsmgr.exe"), _UU("SW_RUN_TEXT_VPNSMGR"), + L"vpnsmgr.exe", _UU("SW_RUN_TEXT_VPNSMGR"), old_msi_vpnserver, sizeof(old_msi_vpnserver) / sizeof(SW_OLD_MSI)); Add(sw->ComponentList, c); // VPN Client - c = SwNewComponent(SW_NAME_VPNCLIENT, GC_SVC_NAME_VPNCLIENT, SW_CMP_VPN_CLIENT, ICO_VPN, 6, (MsIsX64() ? L"vpnclient_x64.exe" : L"vpnclient.exe"), + c = SwNewComponent(SW_NAME_VPNCLIENT, GC_SVC_NAME_VPNCLIENT, SW_CMP_VPN_CLIENT, ICO_VPN, 6, L"vpnclient.exe", SW_LONG_VPNCLIENT, true, sizeof(vpn_client_files) / sizeof(char *), vpn_client_files, - (MsIsX64() ? L"vpncmgr_x64.exe" : L"vpncmgr.exe"), _UU("SW_RUN_TEXT_VPNCMGR"), + L"vpncmgr.exe", _UU("SW_RUN_TEXT_VPNCMGR"), old_msi_vpnclient, sizeof(old_msi_vpnclient) / sizeof(SW_OLD_MSI)); #ifdef GC_ENABLE_VPNGATE @@ -6173,23 +6088,23 @@ void SwDefineComponents(SW *sw) Add(sw->ComponentList, c); // VPN Bridge - c = SwNewComponent(SW_NAME_VPNBRIDGE, GC_SVC_NAME_VPNBRIDGE, SW_CMP_VPN_BRIDGE, ICO_CASCADE, 7, (MsIsX64() ? L"vpnbridge_x64.exe" : L"vpnbridge.exe"), + c = SwNewComponent(SW_NAME_VPNBRIDGE, GC_SVC_NAME_VPNBRIDGE, SW_CMP_VPN_BRIDGE, ICO_CASCADE, 7, L"vpnbridge.exe", SW_LONG_VPNBRIDGE, false, sizeof(vpn_bridge_files) / sizeof(char *), vpn_bridge_files, - (MsIsX64() ? L"vpnsmgr_x64.exe" : L"vpnsmgr.exe"), _UU("SW_RUN_TEXT_VPNSMGR"), + L"vpnsmgr.exe", _UU("SW_RUN_TEXT_VPNSMGR"), old_msi_vpnbridge, sizeof(old_msi_vpnbridge) / sizeof(SW_OLD_MSI)); Add(sw->ComponentList, c); // VPN Server Manager (Tools Only) c = SwNewComponent(SW_NAME_VPNSMGR, NULL, SW_CMP_VPN_SMGR, ICO_USER_ADMIN, 8, NULL, SW_LONG_VPNSMGR, false, sizeof(vpn_smgr_files) / sizeof(char *), vpn_smgr_files, - (MsIsX64() ? L"vpnsmgr_x64.exe" : L"vpnsmgr.exe"), _UU("SW_RUN_TEXT_VPNSMGR"), + L"vpnsmgr.exe", _UU("SW_RUN_TEXT_VPNSMGR"), NULL, 0); Add(sw->ComponentList, c); // VPN Client Manager (Tools Only) c = SwNewComponent(SW_NAME_VPNCMGR, NULL, SW_CMP_VPN_CMGR, ICO_INTERNET, 9, NULL, SW_LONG_VPNCMGR, false, sizeof(vpn_cmgr_files) / sizeof(char *), vpn_cmgr_files, - (MsIsX64() ? L"vpncmgr_x64.exe /remote" : L"vpncmgr.exe /remote"), _UU("SW_RUN_TEXT_VPNCMGR"), + L"vpncmgr.exe /remote", _UU("SW_RUN_TEXT_VPNCMGR"), NULL, 0); Add(sw->ComponentList, c); } diff --git a/src/Cedar/WinUi.c b/src/Cedar/WinUi.c index 3d2c0044..3adc04e6 100644 --- a/src/Cedar/WinUi.c +++ b/src/Cedar/WinUi.c @@ -1842,25 +1842,12 @@ void RegistWindowsFirewallAll() void RegistWindowsFirewallAllEx(char *dir) { MsRegistWindowsFirewallEx2(CEDAR_CLIENT_STR, "vpnclient.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_CLIENT_STR, "vpnclient_x64.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_CLIENT_MANAGER_STR, "vpncmgr.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_CLIENT_MANAGER_STR, "vpncmgr_x64.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_MANAGER_STR, "vpnsmgr.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_MANAGER_STR, "vpnsmgr_x64.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_SERVER_STR, "vpnserver.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_SERVER_STR, "vpnserver_x64.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_BRIDGE_STR, "vpnbridge.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_BRIDGE_STR, "vpnbridge_x64.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_CUI_STR, "vpncmd.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_CUI_STR, "vpncmd_x64.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_PRODUCT_STR, "vpntest.exe", dir); - MsRegistWindowsFirewallEx2(CEDAR_PRODUCT_STR, "vpntest_x64.exe", dir); } // Check whether the notification service is already running From 6a472d827a33e15568586c1eefa3457265ff70ca Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Mon, 27 Jul 2020 07:25:00 +0200 Subject: [PATCH 07/11] Mayaqua: remove all references to binaries with "_x64" and "_ia64" suffix See the previous commit's message for details. --- src/Cedar/WinUi.c | 4 ++-- src/Mayaqua/Mayaqua.h | 4 ---- src/Mayaqua/Microsoft.c | 48 ++++------------------------------------- src/Mayaqua/Microsoft.h | 7 ++---- 4 files changed, 8 insertions(+), 55 deletions(-) diff --git a/src/Cedar/WinUi.c b/src/Cedar/WinUi.c index 3adc04e6..a32287f7 100644 --- a/src/Cedar/WinUi.c +++ b/src/Cedar/WinUi.c @@ -10112,11 +10112,11 @@ void InitWinUi(wchar_t *software_name, char *font, UINT fontsize) { if (Is64()) { - hDll = MsLoadLibraryAsDataFile(MsGetPenCoreDllFileName()); + hDll = MsLoadLibraryAsDataFile(PENCORE_DLL_NAME); } else { - hDll = MsLoadLibrary(MsGetPenCoreDllFileName()); + hDll = MsLoadLibrary(PENCORE_DLL_NAME); } if (hDll == NULL) diff --git a/src/Mayaqua/Mayaqua.h b/src/Mayaqua/Mayaqua.h index 2eb50599..509b151e 100644 --- a/src/Mayaqua/Mayaqua.h +++ b/src/Mayaqua/Mayaqua.h @@ -12,11 +12,7 @@ #include #include -// PenCore.dll related #define PENCORE_DLL_NAME "|PenCore.dll" -// #define PENCORE_DLL_NAME_X64 "|PenCore_x64.dll" // commonized to x86 -// #define PENCORE_DLL_NAME_IA64 "|PenCore_ia64.dll" // commonized to x86 - //#define USE_PROBE // Use Probe diff --git a/src/Mayaqua/Microsoft.c b/src/Mayaqua/Microsoft.c index 0dbfc24e..3dc3550e 100644 --- a/src/Mayaqua/Microsoft.c +++ b/src/Mayaqua/Microsoft.c @@ -2098,7 +2098,6 @@ bool MsExecDriverInstaller(char *arg) HANDLE h; UINT retcode; SHELLEXECUTEINFOW info; - wchar_t *src_exe; wchar_t *arg_w; // Validate arguments if (arg == NULL) @@ -2110,20 +2109,9 @@ bool MsExecDriverInstaller(char *arg) UniFormat(hamcore_src, sizeof(hamcore_src), L"%s\\hamcore.se2", MsGetExeDirNameW()); // Extract the File - src_exe = VISTA_DRIVER_INSTALLER_SRC; - - if (MsIsX64()) - { - src_exe = VISTA_DRIVER_INSTALLER_SRC_X64; - } - if (MsIsIA64()) - { - src_exe = VISTA_DRIVER_INSTALLER_SRC_IA64; - } - UniFormat(tmp, sizeof(tmp), VISTA_DRIVER_INSTALLER_DST, MsGetMyTempDirW()); - if (FileCopyW(src_exe, tmp) == false) + if (FileCopyW(VISTA_DRIVER_INSTALLER_SRC, tmp) == false) { return false; } @@ -3938,26 +3926,6 @@ LRESULT CALLBACK MsUserModeWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM return DefWindowProc(hWnd, msg, wParam, lParam); } -// Get the name of PenCore.dll -char *MsGetPenCoreDllFileName() -{ - /*if (Is64()) - { - if (IsX64()) - { - return PENCORE_DLL_NAME_X64; - } - else - { - return PENCORE_DLL_NAME_IA64; - } - } - else*/ - { - return PENCORE_DLL_NAME; - } -} - // Get whether this instance is in user mode bool MsIsUserMode() { @@ -4304,11 +4272,11 @@ void MsUserModeW(wchar_t *title, SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop if (Is64()) { - hDll = MsLoadLibraryAsDataFile(MsGetPenCoreDllFileName()); + hDll = MsLoadLibraryAsDataFile(PENCORE_DLL_NAME); } else { - hDll = MsLoadLibrary(MsGetPenCoreDllFileName()); + hDll = MsLoadLibrary(PENCORE_DLL_NAME); } // Read icon @@ -4877,15 +4845,7 @@ UINT MsService(char *name, SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop, UINT wchar_t filename[MAX_PATH]; UniFormat(filename, sizeof(filename), L"\"%s\"", arg_w); - - if (Is64() == false) - { - UniFormat(vpncmgr, sizeof(vpncmgr), L"%s\\vpncmgr.exe", MsGetExeDirNameW()); - } - else - { - UniFormat(vpncmgr, sizeof(vpncmgr), L"%s\\vpncmgr_x64.exe", MsGetExeDirNameW()); - } + UniFormat(vpncmgr, sizeof(vpncmgr), L"%s\\vpncmgr.exe", MsGetExeDirNameW()); RunW(vpncmgr, filename, false, false); } diff --git a/src/Mayaqua/Microsoft.h b/src/Mayaqua/Microsoft.h index 405a8802..6c99a640 100644 --- a/src/Mayaqua/Microsoft.h +++ b/src/Mayaqua/Microsoft.h @@ -133,10 +133,8 @@ typedef void *HWND; // Vista driver installer related -#define VISTA_DRIVER_INSTALLER_SRC L"|driver_installer.exe" -#define VISTA_DRIVER_INSTALLER_SRC_X64 L"|driver_installer_x64.exe" -#define VISTA_DRIVER_INSTALLER_SRC_IA64 L"|driver_installer_ia64.exe" -#define VISTA_DRIVER_INSTALLER_DST L"%s\\driver_installer.exe" +#define VISTA_DRIVER_INSTALLER_SRC L"|driver_installer.exe" +#define VISTA_DRIVER_INSTALLER_DST L"%s\\driver_installer.exe" #define DRIVER_DEVICE_ID_TAG "NeoAdapter_%s" @@ -741,7 +739,6 @@ void MsServiceMode(SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop); void MsUserModeW(wchar_t *title, SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop, UINT icon); bool MsIsUserMode(); void MsTestOnly(); -char *MsGetPenCoreDllFileName(); void MsPlaySound(char *name); void MsSetThreadSingleCpu(); void MsWin9xTest(); From 78dad1d5689651e4ca3fa8cf169c02eba24d35b3 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Mon, 27 Jul 2020 06:42:38 +0200 Subject: [PATCH 08/11] Mayaqua/Microsoft.h: rename "driver_installer.exe" to "vpndrvinst.exe" vpndrvinst is the name of the target and thus the default output name, let's use it. `vpndrvinst.exe" also sounds less fishy than "driver_installer.exe"... --- src/Mayaqua/Microsoft.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mayaqua/Microsoft.h b/src/Mayaqua/Microsoft.h index 6c99a640..31477085 100644 --- a/src/Mayaqua/Microsoft.h +++ b/src/Mayaqua/Microsoft.h @@ -133,8 +133,8 @@ typedef void *HWND; // Vista driver installer related -#define VISTA_DRIVER_INSTALLER_SRC L"|driver_installer.exe" -#define VISTA_DRIVER_INSTALLER_DST L"%s\\driver_installer.exe" +#define VISTA_DRIVER_INSTALLER_SRC L"|vpndrvinst.exe" +#define VISTA_DRIVER_INSTALLER_DST L"%s\\vpndrvinst.exe" #define DRIVER_DEVICE_ID_TAG "NeoAdapter_%s" From 4b9c33cd30cc990c91f60e068d85de20659590c7 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Mon, 27 Jul 2020 06:45:34 +0200 Subject: [PATCH 09/11] Cedar/SW.c: disable "vpninstall" and "vpnweb" tasks The reason why we don't build these two targets is that they're not used. More specifically: they require proper configuration to work correctly, which is currently missing. While vpninstall may be worth salvaging, vpnweb is definitely a relict of the past because it relies on ActiveX. --- src/Cedar/SW.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Cedar/SW.c b/src/Cedar/SW.c index e444cd13..ae3ebae7 100644 --- a/src/Cedar/SW.c +++ b/src/Cedar/SW.c @@ -72,8 +72,8 @@ static char *sfx_vpn_client_files[] = "vpnclient.exe", "vpncmgr.exe", "vpncmd.exe", - "vpninstall.exe", - "vpnweb.cab", + //"vpninstall.exe", + //"vpnweb.cab", "hamcore.se2", }; @@ -2537,8 +2537,8 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) SW_TASK_COPY *ct; SW_TASK_COPY *vpnclient, *vpncmd, *vpncmgr; SW_TASK_COPY *sfx_cache = NULL; - SW_TASK_COPY *vpnweb; - SW_TASK_COPY *vpninstall; + //SW_TASK_COPY *vpnweb; + //SW_TASK_COPY *vpninstall; wchar_t *src_config_filename; CombinePathW(tmp, sizeof(tmp), sw->InstallDir, L"backup.vpn_client.config"); @@ -2569,14 +2569,14 @@ void SwDefineTasks(SW *sw, SW_TASK *t, SW_COMPONENT *c) } } - vpnweb = SwNewCopyTask(L"vpnweb.cab", NULL, sw->InstallSrc, sw->InstallDir, true, false); - vpninstall = SwNewCopyTask(L"vpninstall.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); + //vpnweb = SwNewCopyTask(L"vpnweb.cab", NULL, sw->InstallSrc, sw->InstallDir, true, false); + //vpninstall = SwNewCopyTask(L"vpninstall.exe", NULL, sw->InstallSrc, sw->InstallDir, true, false); Add(t->CopyTasks, vpnclient); Add(t->CopyTasks, vpncmd); Add(t->CopyTasks, vpncmgr); - Add(t->CopyTasks, vpnweb); - Add(t->CopyTasks, vpninstall); + //Add(t->CopyTasks, vpnweb); + //Add(t->CopyTasks, vpninstall); if (sfx_cache != NULL) From 5bf08e63bbf798dbbf76ee01a6914da778ebeb7c Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Mon, 27 Jul 2020 08:10:20 +0200 Subject: [PATCH 10/11] Azure Pipelines: build Windows installers and provide them as artifacts --- .ci/azure-pipelines-win-steps.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.ci/azure-pipelines-win-steps.yml b/.ci/azure-pipelines-win-steps.yml index d332a1c5..d237fd83 100644 --- a/.ci/azure-pipelines-win-steps.yml +++ b/.ci/azure-pipelines-win-steps.yml @@ -4,11 +4,17 @@ parameters: steps: - script: | - cd /d $(Build.BinariesDirectory) call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars${{parameters.bits}}.bat" cmake -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl $(Build.SourcesDirectory) cmake --build . + workingDirectory: $(Build.BinariesDirectory) displayName: 'Build' +- script: | + mkdir "$(Build.StagingDirectory)/installers" + vpnsetup /SFXMODE:vpnclient /SFXOUT:"$(Build.StagingDirectory)/installers/softether-vpnclient-$(Build.SourceVersion).exe" + vpnsetup /SFXMODE:vpnserver_vpnbridge /SFXOUT:"$(Build.StagingDirectory)/installers/softether-vpnserver_vpnbridge-$(Build.SourceVersion).exe" + workingDirectory: $(Build.BinariesDirectory) + displayName: 'Build installers' - powershell: | . .ci\appveyor-vpntest.ps1 displayName: 'Test' @@ -16,9 +22,13 @@ steps: inputs: sourceFolder: '$(Build.BinariesDirectory)' contents: '?(*.exe|*.se2|*.pdb)' - TargetFolder: '$(Build.StagingDirectory)' + TargetFolder: '$(Build.StagingDirectory)/binaries' flattenFolders: true - task: PublishBuildArtifacts@1 inputs: - pathtoPublish: '$(Build.StagingDirectory)' + pathtoPublish: '$(Build.StagingDirectory)/binaries' artifactName: 'Binaries' +- task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: '$(Build.StagingDirectory)/installers' + artifactName: 'Installers' From 6c665f889f68c0786f9494710855bfc034f3d328 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Mon, 27 Jul 2020 08:13:20 +0200 Subject: [PATCH 11/11] AppVeyor: remove MSVC 2008 build The purpose of the configuration was to build installers and continually verify that MSVC 2008 could still build the project. MSVC 2008 was a requirement because we wanted to maintain support for very old versions of Windows (9x). During the past few years we encountered many annoying limitations due to that requirement, such as the lack of support for designated initializers. We ended up deciding to only keep support for operating systems older than 7 in the stable repository. As for the installers, we now build them on Azure Pipelines (currently with MSVC 2019). --- .appveyor.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 55dd6f29..4a7a1d2c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,7 +1,6 @@ version: '{build}' image: - - Visual Studio 2015 - Visual Studio 2017 - Ubuntu1604 - Ubuntu1804 @@ -24,23 +23,6 @@ init: install: git submodule update --init --recursive for: -- - matrix: - only: - - image: Visual Studio 2015 - build_script: - - src\BuildAll.cmd - - exit %errorlevel% - after_build: - - 7z a "%APPVEYOR_BUILD_FOLDER%\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x86_%CONFIGURATION%_PDBs-vs2015.zip" "%APPVEYOR_BUILD_FOLDER%\src\DebugFiles\pdb\Win32_Release\*.pdb" - - 7z a "%APPVEYOR_BUILD_FOLDER%\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%_PDBs-vs2015.zip" "%APPVEYOR_BUILD_FOLDER%\src\DebugFiles\pdb\x64_Release\*.pdb" - artifacts: - - path: output\pkg\*\* - name: Release - - path: "%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x86_%CONFIGURATION%_PDBs-vs2015.zip" - name: PDBs (x86) - - path: "%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%_PDBs-vs2015.zip" - name: PDBs (x64) - matrix: only: