From 772fcf4537bc15b04305e950071e3cee99a9c332 Mon Sep 17 00:00:00 2001 From: Apex Liu Date: Tue, 7 Feb 2017 02:07:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8A=A9=E6=89=8B=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=8F=AA=E6=9C=89=E5=AE=89=E8=A3=85=E5=90=8E=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E8=BF=90=E8=A1=8C=E6=97=B6=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=85=8D=E7=BD=AE=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=88=E5=AE=89=E8=A3=85=E5=88=B0Program=20Files=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E4=B8=8B=EF=BC=8C=E6=99=AE=E9=80=9A=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=86=99=E6=9D=83=E9=99=90=EF=BC=89=EF=BC=8C?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E5=B0=86=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0%APPDATA%/Roaming/eomsoft/teleport/a?= =?UTF-8?q?ssist/cfg=E7=9B=AE=E5=BD=95=E4=B8=8B=E4=BA=86=EF=BC=8C=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=96=87=E4=BB=B6=E5=9C=A8%APPDATA%/Roaming/eomsoft/t?= =?UTF-8?q?eleport/assist/log=E7=9B=AE=E5=BD=95=E4=B8=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + build/.idea/build.iml | 2 +- build/builder/build-assist.py | 113 +++++++++++----- build/builder/build-version.py | 127 ++++++++++++++++-- build/builder/core/utils.py | 12 +- build/builder/core/ver.py | 5 +- .../tp_assist/cfg/{scp_client.ini => scp.ini} | 0 .../tp_assist/cfg/{ssh_client.ini => ssh.ini} | 0 .../cfg/{telnet_client.ini => telnet.ini} | 0 client/tp_assist/tp_assist.rc | Bin 9060 -> 9052 bytes client/tp_assist/ts_env.cpp | 20 +-- client/tp_assist/ts_http_rpc.cpp | 6 +- client/tp_assist/ts_ver.h | 2 +- dist/windows/client/assist/installer.nsi | Bin 2834 -> 2828 bytes dist/windows/client/assist/main.nsh | Bin 2154 -> 2216 bytes dist/windows/client/assist/setup.nsh | Bin 29034 -> 29156 bytes server/tp_core/core/tp_core.rc | Bin 5190 -> 5166 bytes server/tp_core/core/ts_ver.h | 2 +- server/tp_web/src/tp_web.rc | Bin 5192 -> 5168 bytes server/tp_web/src/ts_ver.h | 2 +- server/www/teleport/app/eom_ver.py | 4 +- version.in | 19 +++ 22 files changed, 243 insertions(+), 72 deletions(-) rename client/tp_assist/cfg/{scp_client.ini => scp.ini} (100%) rename client/tp_assist/cfg/{ssh_client.ini => ssh.ini} (100%) rename client/tp_assist/cfg/{telnet_client.ini => telnet.ini} (100%) create mode 100644 version.in diff --git a/.gitignore b/.gitignore index 077cfc9..fb587de 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,4 @@ __pycache__ /config.ini /build.bat /dist/windows/client/assist/apps +/dist/windows/client/assist/cfg diff --git a/build/.idea/build.iml b/build/.idea/build.iml index 4462c8b..8182651 100644 --- a/build/.idea/build.iml +++ b/build/.idea/build.iml @@ -2,7 +2,7 @@ - + diff --git a/build/builder/build-assist.py b/build/builder/build-assist.py index a0a625b..9a69a34 100644 --- a/build/builder/build-assist.py +++ b/build/builder/build-assist.py @@ -40,8 +40,8 @@ class BuilderWin(BuilderBase): # def build_rdp(self): # cc.n('build tp_rdp...') - # sln_file = os.path.join(ROOT_PATH, 'tp_rdp', 'tp_rdp.2015.sln') - # out_file = os.path.join(ROOT_PATH, 'out', 'tp_rdp', ctx.bits_path, ctx.target_path, 'tp_rdp.exe') + # sln_file = os.path.join(ROOT_PATH, 'client', 'tp_rdp', 'tp_rdp.2015.sln') + # out_file = os.path.join(ROOT_PATH, 'out', 'client', ctx.bits_path, ctx.target_path, 'tp_rdp.exe') # if os.path.exists(out_file): # utils.remove(out_file) # utils.msvc_build(sln_file, 'tp_rdp', ctx.target_path, ctx.bits_path, False) @@ -50,15 +50,16 @@ class BuilderWin(BuilderBase): def build_installer(self): cc.i('build assist package for website...') - name = 'teleport-assist-windows-{}-{}'.format(ctx.bits_path, VER_TELEPORT_ASSIST) - utils.remove(os.path.join(ROOT_PATH, 'dist', '{}.zip'.format(name))) - self._build_installer(name) + name = 'tp-assist-{}'.format(VER_TELEPORT_ASSIST) + out_file = os.path.join(ROOT_PATH, 'dist', '{}.exe'.format(name)) + utils.remove(out_file) + self._build_installer() - last_ver = 'teleport-assist-last-win.zip' - if os.path.exists(os.path.join(ROOT_PATH, 'dist', last_ver)): - utils.remove(os.path.join(ROOT_PATH, 'dist', last_ver)) + # last_ver = 'teleport-assist-last-win.zip' + # if os.path.exists(os.path.join(ROOT_PATH, 'dist', last_ver)): + # utils.remove(os.path.join(ROOT_PATH, 'dist', last_ver)) - utils.copy_file(os.path.join(ROOT_PATH, 'dist'), os.path.join(ROOT_PATH, 'dist'), ('{}.zip'.format(name), last_ver)) + # utils.copy_file(os.path.join(ROOT_PATH, 'dist'), os.path.join(ROOT_PATH, 'dist'), ('{}.zip'.format(name), last_ver)) # cc.n('build assist package for backend...') # name = 'teleport-assist-last-win' @@ -67,40 +68,86 @@ class BuilderWin(BuilderBase): # utils.copy_file(os.path.join(ROOT_PATH, 'dist'), os.path.join(ROOT_PATH, 'web', 'site', 'teleport', 'static', 'download'), 'teleport-assist-win.zip') + utils.ensure_file_exists(out_file) + + # @staticmethod + # def _build_installer(name): + # base_path = os.path.join(ROOT_PATH, 'out', 'client') + # base_tmp = os.path.join(base_path, '_tmp_') + # tmp_path = os.path.join(base_tmp, name) + # + # if os.path.exists(base_tmp): + # utils.remove(base_tmp) + # + # utils.makedirs(tmp_path) + # + # utils.copy_file(os.path.join(ROOT_PATH, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_path, 'tp_assist.exe') + # utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tp_assist', 'cfg'), tmp_path, ('ssh_client.ini', 'ssh_client.ini')) + # utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tp_assist', 'cfg'), tmp_path, ('scp_client.ini', 'scp_client.ini')) + # utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tp_assist', 'cfg'), tmp_path, ('telnet_client.ini', 'telnet_client.ini')) + # + # utils.copy_ex(os.path.join(ROOT_PATH, 'client', 'tp_assist'), tmp_path, 'site') + # + # # utils.makedirs(os.path.join(tmp_path, 'tools', 'tprdp')) + # utils.makedirs(os.path.join(tmp_path, 'tools', 'putty')) + # utils.makedirs(os.path.join(tmp_path, 'tools', 'winscp')) + # # utils.copy_file(os.path.join(ROOT_PATH, 'out', 'tp_rdp', ctx.bits_path, ctx.target_path), os.path.join(tmp_path, 'tools', 'tprdp'), 'tp_rdp.exe') + # # utils.copy_file(os.path.join(ROOT_PATH, 'tools', 'tprdp'), os.path.join(tmp_path, 'tools', 'tprdp'), 'tprdp-client.exe') + # # utils.copy_file(os.path.join(ROOT_PATH, 'tools', 'tprdp'), os.path.join(tmp_path, 'tools', 'tprdp'), 'tprdp-replay.exe') + # utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tools', 'putty'), os.path.join(tmp_path, 'tools', 'putty'), 'putty.exe') + # utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tools', 'winscp'), os.path.join(tmp_path, 'tools', 'winscp'), 'WinSCP.exe') + # utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tools', 'winscp'), os.path.join(tmp_path, 'tools', 'winscp'), 'license.txt') + # utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tools'), os.path.join(tmp_path, 'tools'), 'securecrt-telnet.vbs') + # + # # utils.makedirs(os.path.join(tmp_path, 'data')) + # # utils.copy_file(os.path.join(ROOT_PATH, 'tp_assist'), os.path.join(tmp_path, 'data'), 'ssl.cert') + # + # out_file = os.path.join(ROOT_PATH, 'dist', '{}.zip'.format(name)) + # utils.make_zip(base_tmp, out_file) + + @staticmethod - def _build_installer(name): - base_path = os.path.join(ROOT_PATH, 'out', 'tp_assist') - base_tmp = os.path.join(base_path, '_tmp_') - tmp_path = os.path.join(base_tmp, name) + def _build_installer(): + # base_path = os.path.join(ROOT_PATH, 'out', 'client') + # base_tmp = os.path.join(base_path, '_tmp_') + tmp_path = os.path.join(ROOT_PATH, 'dist', 'windows', 'client', 'assist') + tmp_app_path = os.path.join(tmp_path, 'apps') + tmp_cfg_path = os.path.join(tmp_path, 'cfg') + # E:\work\eomsoft\teleport - github\dist\windows\client\assist\apps - if os.path.exists(base_tmp): - utils.remove(base_tmp) + if os.path.exists(tmp_app_path): + utils.remove(tmp_app_path) + if os.path.exists(tmp_cfg_path): + utils.remove(tmp_cfg_path) - utils.makedirs(tmp_path) + utils.makedirs(tmp_app_path) + utils.makedirs(tmp_cfg_path) - utils.copy_file(os.path.join(ROOT_PATH, 'out', 'tp_assist', ctx.bits_path, ctx.target_path), tmp_path, 'tp_assist.exe') - utils.copy_file(os.path.join(ROOT_PATH, 'tp_assist'), tmp_path, ('ssh_client.orig.ini', 'ssh_client.ini')) - utils.copy_file(os.path.join(ROOT_PATH, 'tp_assist'), tmp_path, ('scp_client.orig.ini', 'scp_client.ini')) - utils.copy_file(os.path.join(ROOT_PATH, 'tp_assist'), tmp_path, ('telnet_client.orig.ini', 'telnet_client.ini')) + utils.copy_file(os.path.join(ROOT_PATH, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp_assist.exe') + utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'ssh.ini') + utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'scp.ini') + utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tp_assist', 'cfg'), tmp_cfg_path, 'telnet.ini') - utils.copy_ex(os.path.join(ROOT_PATH, 'tp_assist'), tmp_path, 'site') + utils.copy_ex(os.path.join(ROOT_PATH, 'client', 'tp_assist'), tmp_app_path, 'site') - utils.makedirs(os.path.join(tmp_path, 'tools', 'tprdp')) - utils.makedirs(os.path.join(tmp_path, 'tools', 'putty')) - utils.makedirs(os.path.join(tmp_path, 'tools', 'winscp')) - # utils.copy_file(os.path.join(ROOT_PATH, 'out', 'tp_rdp', ctx.bits_path, ctx.target_path), os.path.join(tmp_path, 'tools', 'tprdp'), 'tp_rdp.exe') - utils.copy_file(os.path.join(ROOT_PATH, 'tools', 'tprdp'), os.path.join(tmp_path, 'tools', 'tprdp'), 'tprdp-client.exe') - utils.copy_file(os.path.join(ROOT_PATH, 'tools', 'tprdp'), os.path.join(tmp_path, 'tools', 'tprdp'), 'tprdp-replay.exe') - utils.copy_file(os.path.join(ROOT_PATH, 'tools', 'putty'), os.path.join(tmp_path, 'tools', 'putty'), 'putty.exe') - utils.copy_file(os.path.join(ROOT_PATH, 'tools', 'winscp'), os.path.join(tmp_path, 'tools', 'winscp'), 'WinSCP.exe') - utils.copy_file(os.path.join(ROOT_PATH, 'tools', 'winscp'), os.path.join(tmp_path, 'tools', 'winscp'), 'license.txt') - utils.copy_file(os.path.join(ROOT_PATH, 'tools'), os.path.join(tmp_path, 'tools'), 'securecrt-telnet.vbs') + # utils.makedirs(os.path.join(tmp_app_path, 'tools', 'tprdp')) + utils.makedirs(os.path.join(tmp_app_path, 'tools', 'putty')) + utils.makedirs(os.path.join(tmp_app_path, 'tools', 'winscp')) + # utils.copy_file(os.path.join(ROOT_PATH, 'out', 'tp_rdp', ctx.bits_path, ctx.target_path), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tp_rdp.exe') + # utils.copy_file(os.path.join(ROOT_PATH, 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-client.exe') + # utils.copy_file(os.path.join(ROOT_PATH, 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-replay.exe') + utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe') + utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'WinSCP.exe') + utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'license.txt') + utils.copy_file(os.path.join(ROOT_PATH, 'client', 'tools'), os.path.join(tmp_app_path, 'tools'), 'securecrt-telnet.vbs') # utils.makedirs(os.path.join(tmp_path, 'data')) # utils.copy_file(os.path.join(ROOT_PATH, 'tp_assist'), os.path.join(tmp_path, 'data'), 'ssl.cert') - out_file = os.path.join(ROOT_PATH, 'dist', '{}.zip'.format(name)) - utils.make_zip(base_tmp, out_file) + # out_file = os.path.join(ROOT_PATH, 'dist', '{}.zip'.format(name)) + # utils.make_zip(base_tmp, out_file) + # E:\work\eomsoft\teleport - github\dist\windows\client\assist + utils.nsis_build(os.path.join(ROOT_PATH, 'dist', 'windows', 'client', 'assist', 'installer.nsi')) class BuilderLinux(BuilderBase): diff --git a/build/builder/build-version.py b/build/builder/build-version.py index fadfac4..ae909a8 100644 --- a/build/builder/build-version.py +++ b/build/builder/build-version.py @@ -19,7 +19,7 @@ class Builder: self.VER_TELEPORT_SERVER = '' self.VER_TELEPORT_ASSIST = '' self.VER_TELEPORT_ASSIST_REQUIRE = '' - self.VER_TELEPORT_MAKECERT = '' + # self.VER_TELEPORT_MAKECERT = '' def build(self): cc.n('update version...') @@ -38,26 +38,28 @@ class Builder: elif l.startswith('TELEPORT_ASSIST_REQUIRE '): x = l.split(' ') self.VER_TELEPORT_ASSIST_REQUIRE = x[1].strip() - elif l.startswith('TELEPORT_MAKECERT '): - x = l.split(' ') - self.VER_TELEPORT_MAKECERT = x[1].strip() + # elif l.startswith('TELEPORT_MAKECERT '): + # x = l.split(' ') + # self.VER_TELEPORT_MAKECERT = x[1].strip() # cc.v('new version:') cc.v(' TELEPORT-Server : ', self.VER_TELEPORT_SERVER) cc.v(' TELEPORT-Assist : ', self.VER_TELEPORT_ASSIST) cc.v(' TELEPORT-Assist-require : ', self.VER_TELEPORT_ASSIST_REQUIRE) - cc.v(' TELEPORT-MakeCert : ', self.VER_TELEPORT_MAKECERT) + # cc.v(' TELEPORT-MakeCert : ', self.VER_TELEPORT_MAKECERT) cc.v('') self.make_build_ver() self.make_assist_ver() - self.make_eom_ts_ver() + self.make_tp_core_ver() + self.make_tp_web_ver() self.make_web_ver() def make_build_ver(self): ver_file = os.path.join(ROOT_PATH, 'build', 'builder', 'core', 'ver.py') - ver_content = '# -*- coding: utf8 -*-\nVER_TELEPORT_SERVER = "{}"\nVER_TELEPORT_ASSIST = "{}"\nVER_TELEPORT_MAKECERT = "{}"\n'.format(self.VER_TELEPORT_SERVER, self.VER_TELEPORT_ASSIST, self.VER_TELEPORT_MAKECERT) + # ver_content = '# -*- coding: utf8 -*-\nVER_TELEPORT_SERVER = "{}"\nVER_TELEPORT_ASSIST = "{}"\nVER_TELEPORT_MAKECERT = "{}"\n'.format(self.VER_TELEPORT_SERVER, self.VER_TELEPORT_ASSIST, self.VER_TELEPORT_MAKECERT) + ver_content = '# -*- coding: utf8 -*-\nVER_TELEPORT_SERVER = "{}"\nVER_TELEPORT_ASSIST = "{}"\n'.format(self.VER_TELEPORT_SERVER, self.VER_TELEPORT_ASSIST) rewrite = False if not os.path.exists(ver_file): @@ -75,7 +77,7 @@ class Builder: f.write(ver_content) def make_web_ver(self): - ver_file = os.path.join(ROOT_PATH, 'web', 'site', 'teleport', 'app', 'eom_ver.py') + ver_file = os.path.join(ROOT_PATH, 'server', 'www', 'teleport', 'app', 'eom_ver.py') # ver_content = '# -*- coding: utf8 -*-\n\nTS_VER = "{}"\n'.format(self.VER_TELEPORT_SERVER) ver_content = '# -*- coding: utf8 -*-\nTS_VER = "{}"\nTP_ASSIST_LAST_VER = "{}"\nTP_ASSIST_REQUIRE = "{}"\n'.format(self.VER_TELEPORT_SERVER, self.VER_TELEPORT_ASSIST, self.VER_TELEPORT_ASSIST_REQUIRE) @@ -95,7 +97,7 @@ class Builder: f.write(ver_content) def make_assist_ver(self): - ver_file = os.path.join(ROOT_PATH, 'tp_assist', 'ts_ver.h') + ver_file = os.path.join(ROOT_PATH, 'client', 'tp_assist', 'ts_ver.h') ver_content = '#ifndef __TS_ASSIST_VER_H__\n#define __TS_ASSIST_VER_H__\n\n#define TP_ASSIST_VER\tL"{}"\n\n#endif // __TS_ASSIST_VER_H__\n'.format(self.VER_TELEPORT_ASSIST) rewrite = False @@ -113,11 +115,14 @@ class Builder: with open(ver_file, 'w') as f: f.write(ver_content) - rc_file = os.path.join(ROOT_PATH, 'tp_assist', 'tp_assist.rc') + rc_file = os.path.join(ROOT_PATH, 'client', 'tp_assist', 'tp_assist.rc') self._update_vs_rc(rc_file, self.VER_TELEPORT_ASSIST) - def make_eom_ts_ver(self): - ver_file = os.path.join(ROOT_PATH, 'teleport-server', 'src', 'ts_ver.h') + nsi_file = os.path.join(ROOT_PATH, 'dist', 'windows', 'client', 'assist', 'installer.nsi') + self._update_nsi_rc(nsi_file, self.VER_TELEPORT_ASSIST) + + def make_tp_core_ver(self): + ver_file = os.path.join(ROOT_PATH, 'server', 'tp_core', 'core', 'ts_ver.h') ver_content = '#ifndef __TS_SERVER_VER_H__\n#define __TS_SERVER_VER_H__\n\n#define TP_SERVER_VER\tL"{}"\n\n#endif // __TS_SERVER_VER_H__\n'.format(self.VER_TELEPORT_SERVER) rewrite = False @@ -135,7 +140,29 @@ class Builder: with open(ver_file, 'w') as f: f.write(ver_content) - rc_file = os.path.join(ROOT_PATH, 'teleport-server', 'src', 'eom_ts.rc') + rc_file = os.path.join(ROOT_PATH, 'server', 'tp_core', 'core', 'tp_core.rc') + self._update_vs_rc(rc_file, self.VER_TELEPORT_SERVER) + + def make_tp_web_ver(self): + ver_file = os.path.join(ROOT_PATH, 'server', 'tp_web', 'src', 'ts_ver.h') + ver_content = '#ifndef __TS_SERVER_VER_H__\n#define __TS_SERVER_VER_H__\n\n#define TP_SERVER_VER\tL"{}"\n\n#endif // __TS_SERVER_VER_H__\n'.format(self.VER_TELEPORT_SERVER) + + rewrite = False + if not os.path.exists(ver_file): + rewrite = True + else: + old_content = '' + with open(ver_file, 'r') as f: + old_content = f.read() + if old_content != ver_content: + rewrite = True + + if rewrite: + cc.v(' update {}...'.format(ver_file)) + with open(ver_file, 'w') as f: + f.write(ver_content) + + rc_file = os.path.join(ROOT_PATH, 'server', 'tp_web', 'src', 'tp_web.rc') self._update_vs_rc(rc_file, self.VER_TELEPORT_SERVER) def _update_vs_rc(self, rcFilePath, ver): @@ -249,6 +276,80 @@ class Builder: except IOError: raise RuntimeError('can not open rc file.') + def _update_nsi_rc(self, nsiFilePath, ver): + """ update nsis file version info """ + # nver = ver.split('.') + t_ver = ver.split('.') + if len(t_ver) != 4: + raise RuntimeError('Invalid version for assist.') + + bOK = False + try: + # open nsis file + nsiFile = open(nsiFilePath, 'r', encoding='utf-16-le') + # read out all lines of nsi file + nsiLines = nsiFile.readlines() + nsiFile.close() + + # for nsiline in nsiLines: + for x in range(len(nsiLines)): + nsiline = nsiLines[x] + if nsiline.find('\n') != -1: + nsiline = nsiline[:-1] + + if nsiline.find(" FILE_VER") != -1 or nsiline.find(" STR_FILE_VER") != -1: + # cc.v('[ver] old ver: %s' % nsiLines[x]) + pos1 = nsiline.find('"') + pos2 = nsiline.rfind('"') + _ver = nsiline[pos1 + 1: pos2] + + nsiSplitList = _ver.split(".") + if (len(nsiSplitList) != 4): + raise RuntimeError('Invalid .nsi file (1).') + if '.'.join(nsiSplitList) == ver: + continue + + # nsiline = '%s\"%d.%d.%d.%d\"\n' % (nsiline[0:pos1], self.major, self.minor, self.revision, self.build) + nsiline = '%s\"%s.%s.%s.%s\"\n' % (nsiline[0:pos1], t_ver[0], t_ver[1], t_ver[2], t_ver[3]) + + nsiLines[x] = "" + nsiLines[x] = nsiline + # cc.v('[ver] new ver: %s' % nsiLines[x]) + bOK = True + + elif nsiline.find(" PRODUCT_VER") != -1: + # cc.v('[ver] old ver: %s' % nsiLines[x]) + pos1 = nsiline.find('"') + pos2 = nsiline.rfind('"') + _ver = nsiline[pos1 + 1: pos2] + + nsiSplitList = _ver.split(".") + if (len(nsiSplitList) != 2): + raise RuntimeError('Invalid .nsi file (2).') + if '.'.join(nsiSplitList) == '%s.%s' % (t_ver[0], t_ver[1]): + continue + + # nsiline = '%s\"%d.%d\"\n' % (nsiline[0:pos1], self.major, self.minor) + nsiline = '%s\"%s.%s\"\n' % (nsiline[0:pos1], t_ver[0], t_ver[1]) + + nsiLines[x] = "" + nsiLines[x] = nsiline + # cc.v('[ver] new ver: %s' % nsiLines[x]) + bOK = True + + else: + continue + + if bOK: + cc.v(' update {}...'.format(nsiFilePath)) + wnsiFile = open(nsiFilePath, 'w', encoding='utf-16-le') + wnsiFile.writelines(nsiLines) + wnsiFile.close() + return bOK + + except IOError: + raise RuntimeError('can not open nsi file.') + def main(): builder = Builder() diff --git a/build/builder/core/utils.py b/build/builder/core/utils.py index efe8399..554c84d 100644 --- a/build/builder/core/utils.py +++ b/build/builder/core/utils.py @@ -220,8 +220,8 @@ def python_exec(): def msbuild_path(): - if cfg.msbuild is not None: - return cfg.msbuild + if cfg.toolchain.msbuild is not None: + return cfg.toolchain.msbuild # 14.0 = VS2015 # 12.0 = VS2012 @@ -241,13 +241,13 @@ def msbuild_path(): if not os.path.exists(msb): raise RuntimeError('Can not locate MSBuild at {}'.format(msp)) - cfg.msbuild = msb + cfg.toolchain.msbuild = msb return msb def nsis_path(): - if cfg.nsis is not None: - return cfg.nsis + if cfg.toolchain.nsis is not None: + return cfg.toolchain.nsis p = winreg_read_wow64_32(r'SOFTWARE\NSIS\Unicode', '') if p is None: @@ -257,7 +257,7 @@ def nsis_path(): if not os.path.exists(p): raise RuntimeError('Can not locate NSIS at {}'.format(p)) - cfg.nsis = p + cfg.toolchain.nsis = p return p diff --git a/build/builder/core/ver.py b/build/builder/core/ver.py index b7ed8dd..f5ff2ee 100644 --- a/build/builder/core/ver.py +++ b/build/builder/core/ver.py @@ -1,4 +1,3 @@ # -*- coding: utf8 -*- -VER_TELEPORT_SERVER = "1.6.225.1" -VER_TELEPORT_ASSIST = "1.5.46.5" -VER_TELEPORT_MAKECERT = "1.0.1" +VER_TELEPORT_SERVER = "2.0.0.1" +VER_TELEPORT_ASSIST = "2.0.0.1" diff --git a/client/tp_assist/cfg/scp_client.ini b/client/tp_assist/cfg/scp.ini similarity index 100% rename from client/tp_assist/cfg/scp_client.ini rename to client/tp_assist/cfg/scp.ini diff --git a/client/tp_assist/cfg/ssh_client.ini b/client/tp_assist/cfg/ssh.ini similarity index 100% rename from client/tp_assist/cfg/ssh_client.ini rename to client/tp_assist/cfg/ssh.ini diff --git a/client/tp_assist/cfg/telnet_client.ini b/client/tp_assist/cfg/telnet.ini similarity index 100% rename from client/tp_assist/cfg/telnet_client.ini rename to client/tp_assist/cfg/telnet.ini diff --git a/client/tp_assist/tp_assist.rc b/client/tp_assist/tp_assist.rc index 97815e543f1f6b75f2c4edbf33a84f92de1c2bfc..b09b867d0ea74ebfb7d2c5fc999ac99a2a8c0bb7 100644 GIT binary patch delta 90 zcmaFjcE@eQH%VS21|0?iC^nqTDy57j(kLaq*-vT{6Hr(Ws1Sk;H}lJiqX|vsmzCV? ICojeV085$>TL1t6 delta 102 zcmccP_QY+&H%Wd&1|0@dAU0tz1F #ifdef EX_OS_WIN32 # include +# include #endif TsEnv g_env; @@ -27,17 +28,20 @@ bool TsEnv::init(void) if (!ex_dirname(m_exec_path)) return false; - m_ssh_client_conf_file = m_exec_path; - ex_path_join(m_ssh_client_conf_file, false, _T("ssh_client.ini"), NULL); + TCHAR szBuf[PATH_MAX] = { 0 }; + SHGetSpecialFolderPathW(NULL, szBuf, CSIDL_APPDATA, FALSE); - m_scp_client_conf_file = m_exec_path; - ex_path_join(m_scp_client_conf_file, false, _T("scp_client.ini"), NULL); + m_ssh_client_conf_file = szBuf;// m_exec_path; + ex_path_join(m_ssh_client_conf_file, false, _T("eomsoft"), _T("teleport"), _T("assist"), _T("cfg"), _T("ssh.ini"), NULL); + + m_scp_client_conf_file = szBuf;// m_exec_path; + ex_path_join(m_scp_client_conf_file, false, _T("eomsoft"), _T("teleport"), _T("assist"), _T("cfg"), _T("scp.ini"), NULL); - m_telnet_client_conf_file = m_exec_path; - ex_path_join(m_telnet_client_conf_file, false, _T("telnet_client.ini"), NULL); + m_telnet_client_conf_file = szBuf;// m_exec_path; + ex_path_join(m_telnet_client_conf_file, false, _T("eomsoft"), _T("teleport"), _T("assist"), _T("cfg"), _T("telnet.ini"), NULL); - m_log_path = m_exec_path; - ex_path_join(m_log_path, false, _T("log"), NULL); + m_log_path = szBuf;// m_exec_path; + ex_path_join(m_log_path, false, _T("eomsoft"), _T("teleport"), _T("assist"), _T("log"), NULL); m_site_path = m_exec_path; ex_path_join(m_site_path, false, _T("site"), NULL); diff --git a/client/tp_assist/ts_http_rpc.cpp b/client/tp_assist/ts_http_rpc.cpp index afc025b..46be619 100644 --- a/client/tp_assist/ts_http_rpc.cpp +++ b/client/tp_assist/ts_http_rpc.cpp @@ -100,12 +100,12 @@ void http_rpc_main_loop(void) return; } - EXLOGV("======================================================\n"); - EXLOGV("[rpc] TeleportAssist-HTTP-RPC ready on %s:%d\n", TS_HTTP_RPC_HOST, TS_HTTP_RPC_PORT); + EXLOGW("======================================================\n"); + EXLOGW("[rpc] TeleportAssist-HTTP-RPC ready on %s:%d\n", TS_HTTP_RPC_HOST, TS_HTTP_RPC_PORT); g_http_interface.run(); - EXLOGV("[prc] main loop end.\n"); + EXLOGW("[prc] main loop end.\n"); } #define HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W') diff --git a/client/tp_assist/ts_ver.h b/client/tp_assist/ts_ver.h index 168bf58..29068ee 100644 --- a/client/tp_assist/ts_ver.h +++ b/client/tp_assist/ts_ver.h @@ -1,6 +1,6 @@ #ifndef __TS_ASSIST_VER_H__ #define __TS_ASSIST_VER_H__ -#define TP_ASSIST_VER L"1.5.46.5" +#define TP_ASSIST_VER L"2.0.0.1" #endif // __TS_ASSIST_VER_H__ diff --git a/dist/windows/client/assist/installer.nsi b/dist/windows/client/assist/installer.nsi index 5a8c40fb9c9602b3558b876834543690d1f6ee04..28b9f67b33b9a042a21ca3e24b0e7260894fb913 100644 GIT binary patch delta 18 ZcmbOv)+4qdj+NDbL65<3b0+IbRsb)q1i=6R delta 24 fcmeAXnq=GtM!W@I diff --git a/dist/windows/client/assist/main.nsh b/dist/windows/client/assist/main.nsh index 15c10dbcb6e52f50ebbd1aa6988f65db8b3964de..1b4626ab302ec84e02bcd68564169facfe82a778 100644 GIT binary patch delta 48 zcmaDQutIRdESAX;EE4k03~mhW4Dk#B42}#T3?2-eK&Zr^#}LDi%#g;AzIigsb!Gq- CVhWZ3 delta 12 UcmZ1>_)1{IESAkTSS~OF03^2sWB>pF diff --git a/dist/windows/client/assist/setup.nsh b/dist/windows/client/assist/setup.nsh index fcfa0210f0e5007d876cbe2419536e3f30a88839..0d1b465a8c7812b13c574cbbcdd13837d9a928fa 100644 GIT binary patch delta 333 zcmaF$i1Eo|#tk;C+Zh+`O18S)u&8H#~q8bb+?Ujh`#0pbFnND){h5hz>CkO{;k3`&z53v^AD7*v3I zNizqmQ<<<%rOnaFlNl#Bq)54vYDEkKvQuLil7U`IpS(OpmDQQSjlq5M<&;GB$x3+& ilY?@eOt#3?nXG3eGr7fAjhUB$Yx3IM?9Fa@D$D@2ict0d delta 130 zcmaFznDNyk#tk;Co4r^c1#XVfw_=>^5ze>SA>55+b4TMG8F3;w7dEb}-1UoMJ diff --git a/server/tp_core/core/tp_core.rc b/server/tp_core/core/tp_core.rc index 501c647fec82f388672234e01055b008aeadf5dc..7f300dad7a5064af2886ca68c5da5beb94219c54 100644 GIT binary patch delta 112 zcmX@6u})*d3=Uo+1|0?iC^nqDnnM{?Wb;Fg%S^&X40=FC5Nya017s^r*5}dO{Ehnw XqbwFl1}+8#2%OB%C%svMPmc`%&<+!? delta 120 zcmZ3daZF>w3=UyK1|0@7AT|O*Qy^`~z&m*p0AySj)c^nh diff --git a/server/tp_core/core/ts_ver.h b/server/tp_core/core/ts_ver.h index d7f7ba3..36b9170 100644 --- a/server/tp_core/core/ts_ver.h +++ b/server/tp_core/core/ts_ver.h @@ -1,6 +1,6 @@ #ifndef __TS_SERVER_VER_H__ #define __TS_SERVER_VER_H__ -#define TP_SERVER_VER L"1.6.225.1" +#define TP_SERVER_VER L"2.0.0.1" #endif // __TS_SERVER_VER_H__ diff --git a/server/tp_web/src/tp_web.rc b/server/tp_web/src/tp_web.rc index c0e10b29da0d8b4e52a577779c5e594c2f8b7300..4135765ca8f3fb6466add5f17cfcdd279ef9592e 100644 GIT binary patch delta 102 zcmX@1u|Z?Q3=Uo+1|0?iC^nqDnnM{?Wb;Fg+f2en40=FC5Nya017s^rp2(}Y`5*TK NMjVpDo4NSx*Z?ra6bS$T delta 124 zcmdm>aYAFm3=UyK1|0@7AT|O*Qy^`~z&m*