diff --git a/build.bat b/build.bat index db48abb..bd69c96 100644 --- a/build.bat +++ b/build.bat @@ -1,7 +1,7 @@ python -m nuitka "Module/Main.py" ^ --standalone ^ --msvc=latest ^ ---windows-console-mode=force ^ +--windows-console-mode=disable ^ --output-filename=IOSAI ^ --include-package=Module,Utils,Entity,script ^ --include-module=flask ^ diff --git a/resources/iproxy/tidevice.exe b/resources/iproxy/tidevice.exe index c40b70f..28e6fea 100644 Binary files a/resources/iproxy/tidevice.exe and b/resources/iproxy/tidevice.exe differ diff --git a/tidevice_entry.py b/tidevice_entry.py index 402d915..f9f71e5 100644 --- a/tidevice_entry.py +++ b/tidevice_entry.py @@ -1,12 +1,10 @@ -# from tidevice.__main__ import main -# if __name__ == '__main__': -# main() - - -# tidevice_entry.py import sys, traceback, os from tidevice.__main__ import main +if hasattr(sys, 'frozen') and sys.executable.endswith('.exe'): + # 打包后且无控制台时,把标准流扔掉 + sys.stdout = sys.stderr = open(os.devnull, 'w', encoding='utf-8') + if __name__ == "__main__": try: main() @@ -14,5 +12,5 @@ if __name__ == "__main__": # 把 traceback 写到日志文件,但**不输出到控制台** with open(os.path.expanduser("~/tidevice_crash.log"), "a", encoding="utf-8") as f: traceback.print_exc(file=f) - # 静默退出,**返回码 1**(父进程只认 returncode) - sys.exit(1) + # 静默退出,返回码 1 + sys.exit(1) \ No newline at end of file