1、Python程序打包
参考网站:http://www.pyinstaller.org/(pyinstaller下载安装);https://pyinstaller.readthedocs.io/en/v3.3.1/usage.html(使用教程)
方式①:pyinstaller
[options] script [script …] | specfile
e.g:-i表示给软件打包一个图标image.ico;-F表示只打包成一个exe文件;-w表示打包成运行时带窗口,无后台的exe文件(即不可以在后台输命令,如果需要输命令,如密码之类的,就不要带-w)
pyinstaller -i image.ico myscript.py -F -w
方式②:pyinstaller
options name.spec
name.spec文件内容如下(e.g):
block_cipher = None
a = Analysis(['minimal.py'],
pathex=['/Developer/PItests/minimal'],
binaries=None,
datas=None,
hiddenimports=[],
hookspath=None,
runtime_hooks=None,
excludes=None,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,... )
coll = COLLECT(...)
详细请参考网站:https://pyinstaller.readthedocs.io/en/v3.3.1/spec-files.html
2、C++程序打包
参考网站:https://www.cnblogs.com/lizhigang/p/6877590.html?utm_source=itdadao&utm_medium=referral
软件:Inno Setup 编译器
打开Inno Setup 编译器,file->new-next->输入自己的Application name……等信息(可选默认)->next->到Application main executable file时,选择自己C++ project中编译运行产生的exe文件(我选的release下的),如果程序中用到了dll文件,或其他额外的文件,则在other application files中添加(Add files/Add folder)->Application Shortcuts选上Create an Uninstall shortcut in the Start Menu folder->选定输出文件夹(Custom compiler output folder)->其他默认即可