打包命令:
pyinstaller -F -w --version-file my.txt your.py
如新建my.txt放下面内容 注意txt编码ansi
# UTF-8
#
# For more details about fixed file info 'ffi' see:
# VS_FIXEDFILEINFO (verrsrc.h) - Win32 apps | Microsoft Learn
VSVersionInfo(
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(1, 0, 2023, 119),
prodvers=(1, 0, 2023, 119),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
flags=0x0,
# The operating system for which this file was designed.
# 0x4 - NT and there is no need to change it.
OS=0x4,
# The general type of file.
# 0x1 - the file is an application.
fileType=0x1,
# The function of the file.
# 0x0 - the function is not defined for this fileType
subtype=0x0,
# Creation date and time stamp.
date=(0, 0)
),
kids=[
StringFileInfo(
[
StringTable(
u'000004b0',
[StringStruct(u'Comments', u''),
StringStruct(u'CompanyName', u'...'),
StringStruct(u'FileDescription', u'window app sample'),
StringStruct(u'FileVersion', u'1.0 2023-01-19'),
StringStruct(u'InternalName', u'window app sampe'),
StringStruct(u'LegalCopyright', u'© ... All rights reserved.'),
StringStruct(u'LegalTrademarks', u''),
StringStruct(u'OriginalFilename', u'win-sample.exe'),
StringStruct(u'ProductName', u'win-sample'),
StringStruct(u'ProductVersion', u'1.0 2023-01-19'),
StringStruct(u'Assembly Version', u'1.0 2023-01-19')])
]),
VarFileInfo([VarStruct(u'Translation', [0, 1200])])
]
)
根据自己需要更改下面描述信息再打包
kids=[
StringFileInfo(
[
StringTable(
u'040904B0',
[StringStruct(u'CompanyName', u'公司'), # 鼠标悬浮exe会显示
StringStruct(u'FileDescription', u'文件描述'), # 文件说明,鼠标悬浮exe会显示,也会显示在 详细信息-文件说明
StringStruct(u'FileVersion', u'1.1.0'), # 没见哪里显示
StringStruct(u'InternalName', u'SVN'),
StringStruct(u'LegalCopyright', u'公司版权所有'), #版权,会显示在 详细信息-版权
StringStruct(u'OriginalFilename', u'原始文件名'), #原始文件名,会显示在 详细信息-原始文件名
StringStruct(u'ProductName', u'产品名'), #产品名称,会显示在 详细信息-产品名称
StringStruct(u'ProductVersion', u'21.10.26')]) #产品版本,会显示在 详细信息-产品版本
]),
VarFileInfo([VarStruct(u'Translation', [2052, 1200])]) # 语言,中文简体
]