diff --git a/electron/config/bin.js b/electron/config/bin.js index 74b2d5e..ac18ccc 100644 --- a/electron/config/bin.js +++ b/electron/config/bin.js @@ -52,8 +52,8 @@ module.exports = { }, python_w: { directory: './python', - cmd: 'pyinstaller', - args: ['-n=pyapp', '-F', './main.py'], + cmd: 'python', + args: ['./setup.py', 'build'], }, python_m: { directory: './python', diff --git a/python/setup.py b/python/setup.py new file mode 100644 index 0000000..cde3333 --- /dev/null +++ b/python/setup.py @@ -0,0 +1,24 @@ +from cx_Freeze import setup, Executable + +# 创建可执行文件的配置 +executableApp = Executable( + script="main.py", + target_name="pyapp", +) + +# 打包的参数配置 +options = { + "build_exe": { + "build_exe":"./dist/", + "excludes": ["*.txt"], + "optimize": 2, + } +} + +setup( + name="pyapp", + version="1.0", + description="python app", + options=options, + executables=[executableApp] +) \ No newline at end of file