2017-01-11 12:04:11 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from core import colorconsole as cc
|
|
|
|
from core import utils
|
|
|
|
from core.ver import *
|
2017-11-24 15:28:38 +00:00
|
|
|
from core.context import *
|
2017-03-09 19:28:43 +00:00
|
|
|
from core.env import env
|
2017-01-11 12:04:11 +00:00
|
|
|
|
|
|
|
ctx = BuildContext()
|
|
|
|
|
|
|
|
|
|
|
|
class BuilderBase:
|
|
|
|
def __init__(self):
|
|
|
|
self.out_dir = ''
|
|
|
|
|
2019-11-16 19:32:05 +00:00
|
|
|
def build_assist(self):
|
|
|
|
cc.e("this is a pure-virtual function.")
|
|
|
|
|
|
|
|
def build_player(self):
|
|
|
|
cc.e("this is a pure-virtual function.")
|
2017-01-11 12:04:11 +00:00
|
|
|
|
|
|
|
def build_rdp(self):
|
2019-11-16 19:32:05 +00:00
|
|
|
cc.e("this is a pure-virtual function.")
|
2017-01-11 12:04:11 +00:00
|
|
|
|
|
|
|
def build_installer(self):
|
2019-11-16 19:32:05 +00:00
|
|
|
cc.e("this is a pure-virtual function.")
|
2017-01-11 12:04:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
class BuilderWin(BuilderBase):
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
|
2019-11-16 19:32:05 +00:00
|
|
|
def build_assist(self):
|
2017-01-19 13:10:32 +00:00
|
|
|
cc.i('build tp_assist...')
|
2018-12-27 18:58:59 +00:00
|
|
|
sln_file = os.path.join(env.root_path, 'client', 'tp_assist_win', 'tp_assist.vs2017.sln')
|
2017-03-09 19:28:43 +00:00
|
|
|
out_file = os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path, 'tp_assist.exe')
|
2017-01-11 12:04:11 +00:00
|
|
|
if os.path.exists(out_file):
|
|
|
|
utils.remove(out_file)
|
|
|
|
utils.msvc_build(sln_file, 'tp_assist', ctx.target_path, ctx.bits_path, False)
|
|
|
|
utils.ensure_file_exists(out_file)
|
|
|
|
|
2019-11-16 19:32:05 +00:00
|
|
|
def build_player(self):
|
|
|
|
cc.i('build tp-player...')
|
|
|
|
prj_path = os.path.join(env.root_path, 'client', 'tp-player')
|
|
|
|
out_file = os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path, 'tp-player.exe')
|
|
|
|
if os.path.exists(out_file):
|
|
|
|
utils.remove(out_file)
|
2020-06-06 13:36:00 +00:00
|
|
|
utils.qt_build(prj_path, 'tp-player', ctx.bits_path, ctx.target_path)
|
2019-11-16 19:32:05 +00:00
|
|
|
utils.ensure_file_exists(out_file)
|
|
|
|
|
2017-01-11 12:04:11 +00:00
|
|
|
# def build_rdp(self):
|
|
|
|
# cc.n('build tp_rdp...')
|
2017-02-06 18:07:42 +00:00
|
|
|
# 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')
|
2017-01-11 12:04:11 +00:00
|
|
|
# if os.path.exists(out_file):
|
|
|
|
# utils.remove(out_file)
|
|
|
|
# utils.msvc_build(sln_file, 'tp_rdp', ctx.target_path, ctx.bits_path, False)
|
|
|
|
# utils.ensure_file_exists(out_file)
|
|
|
|
|
|
|
|
def build_installer(self):
|
2017-11-24 15:28:38 +00:00
|
|
|
cc.i('build assist installer...')
|
2017-01-11 12:04:11 +00:00
|
|
|
|
2017-11-26 11:40:17 +00:00
|
|
|
name = 'teleport-assist-{}-{}'.format(ctx.dist, VER_TP_ASSIST)
|
2017-02-07 06:50:52 +00:00
|
|
|
|
2017-03-09 19:28:43 +00:00
|
|
|
out_path = os.path.join(env.root_path, 'out', 'installer')
|
2017-02-07 06:50:52 +00:00
|
|
|
utils.makedirs(out_path)
|
|
|
|
|
|
|
|
out_file = os.path.join(out_path, '{}.exe'.format(name))
|
2017-02-06 18:07:42 +00:00
|
|
|
utils.remove(out_file)
|
2017-02-07 06:50:52 +00:00
|
|
|
|
2017-02-06 18:07:42 +00:00
|
|
|
self._build_installer()
|
2017-01-11 12:04:11 +00:00
|
|
|
|
2017-02-06 18:07:42 +00:00
|
|
|
utils.ensure_file_exists(out_file)
|
|
|
|
|
2017-01-11 12:04:11 +00:00
|
|
|
@staticmethod
|
2017-02-06 18:07:42 +00:00
|
|
|
def _build_installer():
|
2017-03-26 17:30:07 +00:00
|
|
|
tmp_path = os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist')
|
2017-02-06 18:07:42 +00:00
|
|
|
tmp_app_path = os.path.join(tmp_path, 'apps')
|
2017-04-16 15:22:14 +00:00
|
|
|
tmp_cfg_path = os.path.join(tmp_app_path, 'cfg')
|
2017-02-06 18:07:42 +00:00
|
|
|
|
|
|
|
if os.path.exists(tmp_app_path):
|
|
|
|
utils.remove(tmp_app_path)
|
|
|
|
|
|
|
|
utils.makedirs(tmp_app_path)
|
|
|
|
utils.makedirs(tmp_cfg_path)
|
|
|
|
|
2017-03-09 19:28:43 +00:00
|
|
|
utils.copy_file(os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp_assist.exe')
|
2020-06-14 18:58:01 +00:00
|
|
|
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist_win', 'runtime'), tmp_app_path, 'msvcp140.dll')
|
2020-04-26 06:53:04 +00:00
|
|
|
utils.copy_file(os.path.join(env.root_path, 'client', 'tp_assist_win', 'runtime'), tmp_app_path, 'vcruntime140.dll')
|
2017-11-24 15:28:38 +00:00
|
|
|
|
2019-11-16 19:32:05 +00:00
|
|
|
utils.copy_file(os.path.join(env.root_path, 'client', 'cfg'), tmp_cfg_path, ('tp-assist.windows.json', 'tp-assist.json'))
|
2018-12-25 08:47:32 +00:00
|
|
|
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')
|
2018-11-10 06:09:29 +00:00
|
|
|
|
2019-11-16 19:32:05 +00:00
|
|
|
# assist configuration web page
|
2017-11-24 15:28:38 +00:00
|
|
|
utils.copy_ex(os.path.join(env.root_path, 'client', 'tp_assist_win'), tmp_app_path, 'site')
|
2017-02-06 18:07:42 +00:00
|
|
|
|
|
|
|
utils.makedirs(os.path.join(tmp_app_path, 'tools', 'putty'))
|
2017-03-09 19:28:43 +00:00
|
|
|
utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe')
|
2017-04-16 03:24:31 +00:00
|
|
|
|
|
|
|
utils.makedirs(os.path.join(tmp_app_path, 'tools', 'winscp'))
|
2017-03-09 19:28:43 +00:00
|
|
|
utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'WinSCP.exe')
|
|
|
|
utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'license.txt')
|
2017-04-16 03:24:31 +00:00
|
|
|
|
|
|
|
utils.makedirs(os.path.join(tmp_app_path, 'tools', 'tprdp'))
|
2020-04-26 06:53:04 +00:00
|
|
|
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-client.exe')
|
2019-11-16 19:32:05 +00:00
|
|
|
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'tprdp'), os.path.join(tmp_app_path, 'tools', 'tprdp'), 'tprdp-replay.exe')
|
2020-04-26 06:53:04 +00:00
|
|
|
# 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')
|
2017-04-16 03:24:31 +00:00
|
|
|
|
2017-03-09 19:28:43 +00:00
|
|
|
utils.copy_file(os.path.join(env.root_path, 'client', 'tools'), os.path.join(tmp_app_path, 'tools'), 'securecrt-telnet.vbs')
|
2017-01-11 12:04:11 +00:00
|
|
|
|
2019-11-16 19:32:05 +00:00
|
|
|
# tp-player
|
|
|
|
utils.copy_file(os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path), tmp_app_path, 'tp-player.exe')
|
|
|
|
|
|
|
|
# qt-redist
|
|
|
|
qt_redist_path = os.path.join(env.root_path, 'client', 'tools', 'qt-redist')
|
2020-06-14 18:58:01 +00:00
|
|
|
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-core-file-l1-2-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-core-file-l2-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-core-localization-l1-2-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-core-processthreads-l1-1-1.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-core-synch-l1-2-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-core-timezone-l1-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-convert-l1-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-environment-l1-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-filesystem-l1-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-heap-l1-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-locale-l1-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-math-l1-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-multibyte-l1-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-runtime-l1-1-0.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'api-ms-win-crt-stdio-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-utility-l1-1-0.dll')
|
|
|
|
|
2019-11-16 19:32:05 +00:00
|
|
|
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, 'Qt5Network.dll')
|
|
|
|
utils.copy_file(qt_redist_path, tmp_app_path, 'Qt5Widgets.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, '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'))
|
|
|
|
|
|
|
|
# zlib
|
|
|
|
suffix = 'd' if ctx.target_path == 'debug' else ''
|
|
|
|
utils.copy_file(os.path.join(env.root_path, 'external', 'zlib', 'build', ctx.target_path), tmp_app_path, 'zlib{}.dll'.format(suffix))
|
|
|
|
|
|
|
|
# openssl
|
|
|
|
utils.copy_file(os.path.join(env.root_path, 'external', 'openssl', 'bin'), tmp_app_path, 'libcrypto-1_1.dll')
|
|
|
|
utils.copy_file(os.path.join(env.root_path, 'external', 'openssl', 'bin'), tmp_app_path, 'libssl-1_1.dll')
|
|
|
|
|
|
|
|
# final build
|
2017-03-26 17:30:07 +00:00
|
|
|
utils.nsis_build(os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist', 'installer.nsi'))
|
2017-01-11 12:04:11 +00:00
|
|
|
|
|
|
|
|
2018-02-16 07:40:02 +00:00
|
|
|
class BuilderMacOS(BuilderBase):
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
|
2019-11-16 19:32:05 +00:00
|
|
|
def build_assist(self):
|
2018-02-16 07:40:02 +00:00
|
|
|
cc.i('build tp_assist...')
|
|
|
|
|
|
|
|
configuration = ctx.target_path.capitalize()
|
|
|
|
|
2018-11-19 18:02:21 +00:00
|
|
|
proj_file = os.path.join(env.root_path, 'client', 'tp_assist_macos', 'TP-Assist.xcodeproj')
|
|
|
|
out_file = os.path.join(env.root_path, 'client', 'tp_assist_macos', 'build', configuration, 'TP-Assist.app')
|
2018-02-16 07:40:02 +00:00
|
|
|
if os.path.exists(out_file):
|
|
|
|
utils.remove(out_file)
|
2018-11-19 18:02:21 +00:00
|
|
|
utils.xcode_build(proj_file, 'TP-Assist', configuration, False)
|
2018-02-16 07:40:02 +00:00
|
|
|
utils.ensure_file_exists(os.path.join(out_file, 'Contents', 'Info.plist'))
|
|
|
|
|
2020-02-06 15:19:06 +00:00
|
|
|
def build_player(self):
|
2020-06-06 13:36:00 +00:00
|
|
|
cc.i('build tp-player...')
|
|
|
|
prj_path = os.path.join(env.root_path, 'client', 'tp-player')
|
|
|
|
out_file = os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path, 'tp-player.app')
|
|
|
|
if os.path.exists(out_file):
|
|
|
|
utils.remove(out_file)
|
|
|
|
utils.qt_build(prj_path, 'tp-player', ctx.bits_path, ctx.target_path)
|
|
|
|
utils.ensure_file_exists(os.path.join(out_file, 'Contents', 'Info.plist'))
|
|
|
|
|
|
|
|
# for deployment
|
|
|
|
utils.qt_deploy(out_file)
|
2020-02-06 15:19:06 +00:00
|
|
|
|
2018-02-16 07:40:02 +00:00
|
|
|
def build_installer(self):
|
2018-11-19 18:02:21 +00:00
|
|
|
cc.i('make tp_assist dmg file...')
|
2018-02-16 07:40:02 +00:00
|
|
|
|
2020-06-06 13:36:00 +00:00
|
|
|
# copy all files of tp-player.
|
|
|
|
configuration = ctx.target_path.capitalize()
|
|
|
|
player_path = os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path)
|
|
|
|
assist_path = os.path.join(env.root_path, 'client', 'tp_assist_macos', 'build', configuration, 'TP-Assist.app')
|
|
|
|
utils.copy_ex(player_path, assist_path, 'tp-player.app')
|
|
|
|
|
2018-11-19 18:02:21 +00:00
|
|
|
json_file = os.path.join(env.root_path, 'dist', 'client', 'macos', 'dmg.json')
|
2020-06-06 13:36:00 +00:00
|
|
|
dmg_file = os.path.join(env.root_path, 'out', 'installer', 'teleport-assist-macos-{}.dmg'.format(VER_TP_ASSIST))
|
2018-11-19 18:02:21 +00:00
|
|
|
if os.path.exists(dmg_file):
|
|
|
|
utils.remove(dmg_file)
|
2018-02-16 07:40:02 +00:00
|
|
|
|
2018-11-19 18:02:21 +00:00
|
|
|
utils.make_dmg(json_file, dmg_file)
|
|
|
|
utils.ensure_file_exists(dmg_file)
|
2018-02-16 07:40:02 +00:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def _build_installer():
|
|
|
|
return
|
|
|
|
# tmp_path = os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist')
|
|
|
|
# tmp_app_path = os.path.join(tmp_path, 'apps')
|
|
|
|
# tmp_cfg_path = os.path.join(tmp_app_path, 'cfg')
|
|
|
|
#
|
|
|
|
# if os.path.exists(tmp_app_path):
|
|
|
|
# utils.remove(tmp_app_path)
|
|
|
|
#
|
|
|
|
# utils.makedirs(tmp_app_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, 'client', 'tp_assist_win', 'cfg'), tmp_cfg_path, ('tp-assist.default.json', 'tp-assist.json'))
|
|
|
|
#
|
|
|
|
# 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.copy_file(os.path.join(env.root_path, 'client', 'tools', 'putty'), os.path.join(tmp_app_path, 'tools', 'putty'), 'putty.exe')
|
|
|
|
#
|
|
|
|
# utils.makedirs(os.path.join(tmp_app_path, 'tools', 'winscp'))
|
|
|
|
# utils.copy_file(os.path.join(env.root_path, 'client', 'tools', 'winscp'), os.path.join(tmp_app_path, 'tools', 'winscp'), 'WinSCP.exe')
|
|
|
|
# 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.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'), os.path.join(tmp_app_path, 'tools'), 'securecrt-telnet.vbs')
|
|
|
|
#
|
|
|
|
# utils.nsis_build(os.path.join(env.root_path, 'dist', 'client', 'windows', 'assist', 'installer.nsi'))
|
|
|
|
|
|
|
|
|
2017-01-11 12:04:11 +00:00
|
|
|
class BuilderLinux(BuilderBase):
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
|
2019-11-16 19:32:05 +00:00
|
|
|
def build_assist(self):
|
2017-01-11 12:04:11 +00:00
|
|
|
cc.e('not support linux.')
|
|
|
|
|
|
|
|
# def build_rdp(self):
|
|
|
|
# cc.e('not support linux.')
|
|
|
|
|
|
|
|
def build_installer(self):
|
|
|
|
cc.e('not support linux.')
|
|
|
|
|
|
|
|
|
|
|
|
def gen_builder(dist):
|
|
|
|
if dist == 'windows':
|
|
|
|
builder = BuilderWin()
|
2018-02-16 07:40:02 +00:00
|
|
|
elif dist == 'macos':
|
|
|
|
builder = BuilderMacOS()
|
2017-01-11 12:04:11 +00:00
|
|
|
elif dist == 'linux':
|
|
|
|
builder = BuilderLinux()
|
|
|
|
else:
|
|
|
|
raise RuntimeError('unsupported platform.')
|
|
|
|
|
|
|
|
ctx.set_dist(dist)
|
|
|
|
return builder
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2017-03-09 19:28:43 +00:00
|
|
|
if not env.init():
|
|
|
|
return
|
|
|
|
|
2017-01-11 12:04:11 +00:00
|
|
|
builder = None
|
|
|
|
|
|
|
|
argv = sys.argv[1:]
|
|
|
|
|
|
|
|
for i in range(len(argv)):
|
|
|
|
if 'debug' == argv[i]:
|
|
|
|
ctx.set_target(TARGET_DEBUG)
|
|
|
|
elif 'x86' == argv[i]:
|
|
|
|
ctx.set_bits(BITS_32)
|
|
|
|
elif 'x64' == argv[i]:
|
|
|
|
ctx.set_bits(BITS_64)
|
|
|
|
elif argv[i] in ctx.dist_all:
|
|
|
|
builder = gen_builder(argv[i])
|
|
|
|
|
|
|
|
if builder is None:
|
|
|
|
builder = gen_builder(ctx.host_os)
|
|
|
|
|
|
|
|
if 'exe' in argv:
|
2019-11-16 19:32:05 +00:00
|
|
|
builder.build_assist()
|
|
|
|
builder.build_player()
|
2017-01-11 12:04:11 +00:00
|
|
|
# elif 'rdp' in argv:
|
|
|
|
# builder.build_rdp()
|
|
|
|
elif 'installer' in argv:
|
|
|
|
builder.build_installer()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
try:
|
|
|
|
main()
|
|
|
|
except KeyboardInterrupt:
|
|
|
|
pass
|
|
|
|
except RuntimeError as e:
|
|
|
|
cc.e(e.__str__())
|
|
|
|
except:
|
|
|
|
cc.f('got exception.')
|