Qt升级到5.15.2,调整win助手打包脚本。

feature/assist-websocket
Apex Liu 2022-05-17 22:56:25 +08:00
parent b82ddc7b3f
commit d395a9b133
13 changed files with 29 additions and 36 deletions

View File

@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$/builder"> <content url="file://$MODULE_DIR$/builder">
<sourceFolder url="file://$MODULE_DIR$/builder" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/builder" isTestSource="false" />
</content> </content>
<orderEntry type="jdk" jdkName="py37" jdkType="Python SDK" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="TestRunnerService"> <component name="TestRunnerService">

View File

@ -32,7 +32,7 @@ class BuilderWin(BuilderBase):
def build_assist(self): def build_assist(self):
cc.i('build tp_assist...') cc.i('build tp_assist...')
sln_file = os.path.join(env.root_path, 'client', 'tp_assist_win', 'tp_assist.vs2017.sln') sln_file = os.path.join(env.root_path, 'client', 'tp_assist_win', 'tp_assist.vs2022.sln')
out_file = os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path, 'tp_assist.exe') out_file = os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path, 'tp_assist.exe')
if os.path.exists(out_file): if os.path.exists(out_file):
utils.remove(out_file) utils.remove(out_file)
@ -85,16 +85,8 @@ class BuilderWin(BuilderBase):
utils.makedirs(tmp_cfg_path) utils.makedirs(tmp_cfg_path)
utils.copy_file(os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp_assist.exe') utils.copy_file(os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp_assist.exe')
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist_win', 'runtime'), tmp_app_path, 'msvcp140.dll')
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist_win', 'runtime'), tmp_app_path, 'vcruntime140.dll')
utils.copy_file(os.path.join(env.root_path, 'client', 'cfg'), tmp_cfg_path, ('tp-assist.windows.json', 'tp-assist.json')) utils.copy_file(os.path.join(env.root_path, 'client', 'cfg'), tmp_cfg_path, ('tp-assist.windows.json', 'tp-assist.json'))
utils.copy_file(os.path.join(env.root_path, 'client', 'cfg'), tmp_cfg_path, 'cacert.cer')
utils.copy_file(os.path.join(env.root_path, 'client', 'cfg'), tmp_cfg_path, 'localhost.key')
utils.copy_file(os.path.join(env.root_path, 'client', 'cfg'), tmp_cfg_path, 'localhost.pem')
# assist configuration web page
utils.copy_ex(os.path.join(env.root_path, 'client', 'tp_assist_win'), tmp_app_path, 'site')
utils.makedirs(os.path.join(tmp_app_path, 'tools', 'putty')) utils.makedirs(os.path.join(tmp_app_path, 'tools', 'putty'))
utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe') utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe')
@ -104,11 +96,6 @@ class BuilderWin(BuilderBase):
utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'license.txt') utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'license.txt')
utils.makedirs(os.path.join(tmp_app_path, 'tools', 'tprdp')) utils.makedirs(os.path.join(tmp_app_path, 'tools', 'tprdp'))
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-client.exe')
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-replay.exe')
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'libeay32.dll')
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'ssleay32.dll')
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'msvcr120.dll')
utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'wfreerdp.exe') utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'wfreerdp.exe')
utils.copy_file(os.path.join(env.root_path, 'client', 'tools'), os.path.join(tmp_app_path, 'tools'), 'securecrt-telnet.vbs') utils.copy_file(os.path.join(env.root_path, 'client', 'tools'), os.path.join(tmp_app_path, 'tools'), 'securecrt-telnet.vbs')
@ -137,11 +124,11 @@ class BuilderWin(BuilderBase):
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-string-l1-1-0.dll') utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-string-l1-1-0.dll')
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-time-l1-1-0.dll') utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-time-l1-1-0.dll')
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-utility-l1-1-0.dll') utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-utility-l1-1-0.dll')
utils.copy_file(qt_redist_path, tmp_app_path, 'Qt5Core.dll') utils.copy_file(qt_redist_path, tmp_app_path, 'Qt5Core.dll')
utils.copy_file(qt_redist_path, tmp_app_path, 'Qt5Gui.dll') utils.copy_file(qt_redist_path, tmp_app_path, 'Qt5Gui.dll')
utils.copy_file(qt_redist_path, tmp_app_path, 'Qt5Network.dll') utils.copy_file(qt_redist_path, tmp_app_path, 'Qt5Network.dll')
utils.copy_file(qt_redist_path, tmp_app_path, 'Qt5Widgets.dll') utils.copy_file(qt_redist_path, tmp_app_path, 'Qt5Widgets.dll')
utils.copy_file(qt_redist_path, tmp_app_path, 'msvcp140_1.dll')
utils.copy_ex(os.path.join(qt_redist_path, 'platforms'), os.path.join(tmp_app_path, 'platforms')) utils.copy_ex(os.path.join(qt_redist_path, 'platforms'), os.path.join(tmp_app_path, 'platforms'))
utils.copy_ex(os.path.join(qt_redist_path, 'styles'), os.path.join(tmp_app_path, 'styles')) utils.copy_ex(os.path.join(qt_redist_path, 'styles'), os.path.join(tmp_app_path, 'styles'))
utils.copy_ex(os.path.join(qt_redist_path, 'translations'), os.path.join(tmp_app_path, 'translations')) utils.copy_ex(os.path.join(qt_redist_path, 'translations'), os.path.join(tmp_app_path, 'translations'))

View File

@ -129,12 +129,18 @@ class Env(object):
# if warn_miss_tool: # if warn_miss_tool:
# cc.w(' - can not locate Visual Studio installation, so I can build nothing.') # cc.w(' - can not locate Visual Studio installation, so I can build nothing.')
if 'msbuild' in _tmp: if 'vs_path' in _tmp:
self.msbuild = _tmp['msbuild'] self.visual_studio_path = _tmp['vs_path']
if self.msbuild is None or not os.path.exists(self.msbuild): self.msbuild = os.path.join(self.visual_studio_path, 'MSBuild', 'Current', 'Bin', 'MSBuild.exe')
if not os.path.exists(self.msbuild):
self.msbuild = None
if warn_miss_tool: if warn_miss_tool:
cc.w(' - can not locate `MSBuild`, so I can build nothing.') cc.w(' - can not locate `MSBuild`, so I can build nothing.')
else:
self.visual_studio_path = None
if warn_miss_tool:
cc.w(' - can not locate Visual Studio installation, so I can build nothing.')
if 'nsis' in _tmp: if 'nsis' in _tmp:
self.nsis = _tmp['nsis'] self.nsis = _tmp['nsis']

View File

@ -322,7 +322,7 @@ def qt_build(prj_path, prj_name, bit_path, target_path):
tmp_path = os.path.join(env.root_path, 'out', '_tmp_', prj_name, bit_path) tmp_path = os.path.join(env.root_path, 'out', '_tmp_', prj_name, bit_path)
makedirs(tmp_path) makedirs(tmp_path)
# C:\Windows\System32\cmd.exe /A /Q /K C:\Qt\Qt5.12.0\5.12.0\msvc2017\bin\qtenv2.bat # C:\Windows\System32\cmd.exe /A /Q /K C:\Qt\Qt5.12.0\5.12.0\msvc2017\bin\qtenv2.bat
cmd = 'C:\\Windows\\System32\\cmd.exe /A /Q /C ""{}\\qt-helper.bat" "{}\\bin\\qtenv2.bat" "{}VC\\Auxiliary\\Build\\vcvarsall.bat" {} "{}" "{}" {}"'.format(env.build_path, env.qt, env.visual_studio_path, bit_path, tmp_path, prj_path, target_path) cmd = 'C:\\Windows\\System32\\cmd.exe /A /Q /C ""{}\\qt-helper.bat" "{}\\bin\\qtenv2.bat" "{}\\VC\\Auxiliary\\Build\\vcvarsall.bat" {} "{}" "{}" {}"'.format(env.build_path, env.qt, env.visual_studio_path, bit_path, tmp_path, prj_path, target_path)
ret, _ = sys_exec(cmd) ret, _ = sys_exec(cmd)
if ret != 0: if ret != 0:
raise RuntimeError('build Qt project `{}` failed.'.format(prj_name)) raise RuntimeError('build Qt project `{}` failed.'.format(prj_name))

View File

@ -33,7 +33,7 @@ static BOOL onInitDialog(HWND hwndDlg);
static wchar_t g_wsz_url[1024] = {0}; static wchar_t g_wsz_url[1024] = {0};
INT_PTR CALLBACK eomDlgMainProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) INT_PTR CALLBACK tpDlgMainProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{ {
if (0 != message && g_dwTaskbarRecreateMessage == message) if (0 != message && g_dwTaskbarRecreateMessage == message)
{ {

View File

@ -1,5 +1,5 @@
#ifndef __EOMASSIST_DLG_MAIN_H__ #ifndef __TP_ASSIST_DLG_MAIN_H__
#define __EOMASSIST_DLG_MAIN_H__ #define __TP_ASSIST_DLG_MAIN_H__
#include <windows.h> #include <windows.h>
@ -7,6 +7,6 @@
#define WMU_DLG_MAIN_EXIT (WM_USER + 2) #define WMU_DLG_MAIN_EXIT (WM_USER + 2)
extern HWND g_hDlgMain; extern HWND g_hDlgMain;
INT_PTR CALLBACK eomDlgMainProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK tpDlgMainProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam);
#endif // __EOMASSIST_DLG_MAIN_H__ #endif // __TP_ASSIST_DLG_MAIN_H__

View File

@ -75,7 +75,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmd
#ifdef EX_DEBUG #ifdef EX_DEBUG
EXLOG_LEVEL(EX_LOG_LEVEL_DEBUG); EXLOG_LEVEL(EX_LOG_LEVEL_DEBUG);
#else #else
EXLOG_LEVEL(EX_LOG_LEVEL_INFO); EXLOG_LEVEL(EX_LOG_LEVEL_VERBOSE);
#endif #endif
EXLOG_FILE(L"tp_assist.log", g_env.m_log_path.c_str(), EX_LOG_FILE_MAX_SIZE, EX_LOG_FILE_MAX_COUNT); EXLOG_FILE(L"tp_assist.log", g_env.m_log_path.c_str(), EX_LOG_FILE_MAX_SIZE, EX_LOG_FILE_MAX_COUNT);
@ -250,7 +250,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
break; break;
case WM_COMMAND: case WM_COMMAND:
if (IDM_MAIN == LOWORD(wParam)) { if (IDM_MAIN == LOWORD(wParam)) {
CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_DLG_MAIN), hWnd, eomDlgMainProc); CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_DLG_MAIN), hWnd, tpDlgMainProc);
ShowWindow(g_hDlgMain, SW_HIDE); ShowWindow(g_hDlgMain, SW_HIDE);
} }
break; break;

View File

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.2.32505.173 VisualStudioVersion = 17.2.32505.173
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tp_assist", "tp_assist.vs2020.vcxproj", "{63B7A8F2-9722-487C-A92A-3DB5D8CA1473}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tp_assist", "tp_assist.vs2022.vcxproj", "{63B7A8F2-9722-487C-A92A-3DB5D8CA1473}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -78,7 +78,7 @@
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;MG_ENABLE_SSL;NDEBUG;_WINDOWS;_WINSOCK_DEPRECATED_NO_WARNINGS;MG_ENABLE_THREADS;MG_DISABLE_HTTP_DIGEST_AUTH;MG_DISABLE_MQTT;MG_DISABLE_SSI;MG_DISABLE_FILESYSTEM;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_WINSOCK_DEPRECATED_NO_WARNINGS;MG_ENABLE_SSL;MG_ENABLE_THREADS;MG_DISABLE_HTTP_DIGEST_AUTH;MG_DISABLE_MQTT;MG_DISABLE_SSI;MG_DISABLE_FILESYSTEM;MG_ENABLE_SYNC_RESOLVER;MG_ENABLE_GETADDRINFO;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>..\..\common\teleport;..\..\common\libex\include;..\..\external\jsoncpp\include;..\..\external\openssl\include</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\common\teleport;..\..\common\libex\include;..\..\external\jsoncpp\include;..\..\external\openssl\include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

View File

@ -15,9 +15,9 @@
"cmake": "/opt/cmake/bin/cmake" "cmake": "/opt/cmake/bin/cmake"
}, },
"#.toolchain.example.windows": { "#.toolchain.example.windows": {
"qt_path": "C:\\Qt\\Qt5.15.2\\5.15.2\\msvc2017", "qt_path": "C:\\Qt\\5.15.2\\msvc2019",
"cmake": "C:\\Program Files(x86)\\CMake\\bin\\cmake.exe", "cmake": "C:\\Program Files(x86)\\CMake\\bin\\cmake.exe",
"msbuild": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe", "vs_path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community",
"wget": "", "wget": "",
"7z": "", "7z": "",
"nsis": "" "nsis": ""

Binary file not shown.

View File

@ -54,10 +54,10 @@ function build_win
on_error "Sorry, need x86 version of Python 3.7 or above." on_error "Sorry, need x86 version of Python 3.7 or above."
fi fi
# and must be x86 version. # and must be x86 version.
$("${pyexec}" -c "import platform;import sys;ret=0 if platform.architecture()[0]=='32bit' else 1;sys.exit(ret)") # ret=$("${pyexec}" -c "import platform;import sys;ret=0 if platform.architecture()[0]=='32bit' else 1;print(ret)")
if [ $? -ne 0 ]; then # if [ $ret -ne 0 ]; then
on_error "Sorry, need x86 version of Python 3.7 or above." # on_error "Sorry, need x86 version of Python 3.7 or above."
fi # fi
${pyexec} -B "${PATH_ROOT}/build/build.py" $@ ${pyexec} -B "${PATH_ROOT}/build/build.py" $@
} }