From 48a2487b9513b461e574385a7c2a4164bad2de9e Mon Sep 17 00:00:00 2001 From: fxliang Date: Fri, 22 Sep 2023 16:56:13 +0800 Subject: [PATCH] Update WeaselSetup.cpp: automatically select WeaselDeployer.exe or x64/WeaselDeployer.exe for deployment, when change user dir. --- WeaselSetup/WeaselSetup.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/WeaselSetup/WeaselSetup.cpp b/WeaselSetup/WeaselSetup.cpp index 705ec0b8f..4ebbdd591 100644 --- a/WeaselSetup/WeaselSetup.cpp +++ b/WeaselSetup/WeaselSetup.cpp @@ -5,6 +5,7 @@ #include "resource.h" #include +#include #include "InstallOptionsDlg.h" @@ -136,11 +137,19 @@ static int CustomInstall(bool installing) { std::wstring dir(install_dir()); std::thread th([dir]() { + if (is_wow64() && IfFileExistW(dir + L"\\x64\\WeaselDeployer.exe") && IfFileExistW(dir + L"\\x64\\rime.dll")) { + ShellExecuteW(NULL, NULL, (dir + L"\\WeaselServer.exe").c_str(), L"/q", NULL, SW_SHOWNORMAL); + Sleep(500); + ShellExecuteW(NULL, NULL, (dir + L"\\WeaselServer.exe").c_str(), L"", NULL, SW_SHOWNORMAL); + Sleep(500); + ShellExecuteW(NULL, NULL, (dir + L"\\x64\\WeaselDeployer.exe").c_str(), L"/deploy", NULL, SW_SHOWNORMAL); + } else { ShellExecuteW(NULL, NULL, (dir + L"\\WeaselServer.exe").c_str(), L"/q", NULL, SW_SHOWNORMAL); Sleep(500); ShellExecuteW(NULL, NULL, (dir + L"\\WeaselServer.exe").c_str(), L"", NULL, SW_SHOWNORMAL); Sleep(500); ShellExecuteW(NULL, NULL, (dir + L"\\WeaselDeployer.exe").c_str(), L"/deploy", NULL, SW_SHOWNORMAL); + } }); th.detach(); MSG_BY_IDS(IDS_STR_MODIFY_SUCCESS_INFO, IDS_STR_MODIFY_SUCCESS_CAP, MB_ICONINFORMATION | MB_OK);