pyinstaller打包软件为exe,添加版本及厂商信息
version.txt 示例
# UTF-8
VSVersionInfo(
ffi=FixedFileInfo(
filevers=(1, 0, 0, 0),
prodvers=(1, 0, 0, 0),
mask=0x3f,
flags=0x0,
OS=0x4,
fileType=0x1,
subtype=0x0,
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
'040904B0',
[StringStruct('CompanyName', '厂商名称'),
StringStruct('FileDescription', '我的程序描述'),
StringStruct('FileVersion', '1.0.0.0'),
StringStruct('InternalName', 'myprogram'),
StringStruct('LegalCopyright', '© 2025 版权名称'),
StringStruct('OriginalFilename', 'myprogram.exe'),
StringStruct('ProductName', 'MyProduct'),
StringStruct('ProductVersion', '1.0.0.0')])
]),
VarFileInfo([VarStruct('Translation', [1033, 1200])])
]
)
打包命令
pyinstaller --onefile --windowed --version-file=version.txt main.py
浙公网安备 33010602011771号