diff --git a/build/builder/build-assist.py b/build/builder/build-assist.py index 2017c4d..da84c60 100644 --- a/build/builder/build-assist.py +++ b/build/builder/build-assist.py @@ -29,7 +29,7 @@ class BuilderWin(BuilderBase): def build_exe(self): cc.i('build tp_assist...') - sln_file = os.path.join(env.root_path, 'client', 'tp_assist_win', 'tp_assist.vs2015.sln') + sln_file = os.path.join(env.root_path, 'client', 'tp_assist_win', 'tp_assist.vs2017.sln') 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): utils.remove(out_file) diff --git a/build/builder/build-external.py b/build/builder/build-external.py index c018dcd..e8d2622 100644 --- a/build/builder/build-external.py +++ b/build/builder/build-external.py @@ -188,7 +188,7 @@ class BuilderWin(BuilderBase): cc.v('') cc.w('On Windows, when build libssh, need you use cmake-gui.exe to generate solution file') - cc.w('for Visual Studio 2015. Visit https://docs.tp4a.com for more details.') + cc.w('for Visual Studio 2017. Visit https://docs.tp4a.com for more details.') cc.w('\nOnce the libssh.sln generated, press Enter to continue or Q to quit...', end='') try: x = env.input() diff --git a/build/builder/build-server.py b/build/builder/build-server.py index ffe5050..85fd0ce 100644 --- a/build/builder/build-server.py +++ b/build/builder/build-server.py @@ -27,7 +27,7 @@ class BuilderWin(BuilderBase): if ctx.target_path == 'debug': cc.w('cannot build debug version of tp_web, skip.') else: - sln_file = os.path.join(env.root_path, 'server', 'tp_web', 'src', 'tp_web.vs2015.sln') + sln_file = os.path.join(env.root_path, 'server', 'tp_web', 'src', 'tp_web.vs2017.sln') out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tp_web.exe') if os.path.exists(out_file): utils.remove(out_file) @@ -35,7 +35,7 @@ class BuilderWin(BuilderBase): utils.ensure_file_exists(out_file) cc.n('build core server ...') - sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'core', 'tp_core.vs2015.sln') + sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'core', 'tp_core.vs2017.sln') out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tp_core.exe') if os.path.exists(out_file): utils.remove(out_file) @@ -43,7 +43,7 @@ class BuilderWin(BuilderBase): utils.ensure_file_exists(out_file) cc.n('build SSH protocol ...') - sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'ssh', 'tpssh.vs2015.sln') + sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'ssh', 'tpssh.vs2017.sln') out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tpssh.dll') if os.path.exists(out_file): utils.remove(out_file) @@ -52,7 +52,7 @@ class BuilderWin(BuilderBase): utils.copy_file(os.path.join(env.root_path, 'external', 'libssh', 'lib', ctx.target_path), os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path), 'ssh.dll') cc.n('build TELNET protocol ...') - sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'telnet', 'tptelnet.vs2015.sln') + sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'telnet', 'tptelnet.vs2017.sln') out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tptelnet.dll') if os.path.exists(out_file): utils.remove(out_file) @@ -61,7 +61,7 @@ class BuilderWin(BuilderBase): if with_rdp: cc.n('build RDP protocol ...') - sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp', 'tprdp.vs2015.sln') + sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp', 'tprdp.vs2017.sln') out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tprdp.dll') if os.path.exists(out_file): utils.remove(out_file) diff --git a/build/builder/core/env.py b/build/builder/core/env.py index 4739f82..bc5f40c 100644 --- a/build/builder/core/env.py +++ b/build/builder/core/env.py @@ -190,30 +190,41 @@ class Env(object): return True - def _get_msbuild(self): - # 14.0 = VS2015 - # 12.0 = VS2012 - # 4.0 = VS2008 - chk = ['14.0', '12.0', '4.0'] + # def _get_msbuild(self): + # # 14.0 = VS2015 + # # 12.0 = VS2012 + # # 4.0 = VS2008 + # chk = ['14.0', '12.0', '4.0'] - p = None - for c in chk: - p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MSBuild\ToolsVersions\{}'.format(c), r'MSBuildToolsPath') - if p is not None: - break + # p = None + # for c in chk: + # p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MSBuild\ToolsVersions\{}'.format(c), r'MSBuildToolsPath') + # if p is not None: + # break - return os.path.join(p[0], 'MSBuild.exe') if p is not None else None + # return os.path.join(p[0], 'MSBuild.exe') if p is not None else None + + # def _get_visual_studio_path(self): + # chk = ['14.0', '12.0', '4.0'] + # p = None + # for c in chk: + # p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\VisualStudio\{}'.format(c), r'ShellFolder') + # if p is not None: + # break + + # return p[0] if p is not None else None def _get_visual_studio_path(self): - chk = ['14.0', '12.0', '4.0'] p = None - for c in chk: - p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\VisualStudio\{}'.format(c), r'ShellFolder') - if p is not None: - break - + p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7', r'15.0') return p[0] if p is not None else None + def _get_msbuild(self): + vs2017 = self._get_visual_studio_path() + if vs2017 is None: + return None + return os.path.join(vs2017, 'MSBuild', '15.0', 'Bin', 'MSBuild.exe') + def _get_perl(self): p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\perl', 'BinDir') return p[0] if p is not None else None diff --git a/server/tp_core/core/tp_core.vs2017.vcxproj b/server/tp_core/core/tp_core.vs2017.vcxproj index 4d800a1..8f3236a 100644 --- a/server/tp_core/core/tp_core.vs2017.vcxproj +++ b/server/tp_core/core/tp_core.vs2017.vcxproj @@ -23,6 +23,7 @@ Win32Proj tp_core tp_core + 8.1 @@ -34,9 +35,9 @@ Application false - v141_xp true Unicode + v141 Application