pyinstaller打包exe加入版本和版权信息

网友投稿 1567 2022-09-12

pyinstaller打包exe加入版本和版权信息

pyinstaller打包exe加入版本和版权信息

使用pyi-grab_version.exe  生成 标准Windows电脑软件(例如WeChat.exe)的版本信息文件 file_version_info.txt

F:\python_code>c:\Python27\Scripts\pyi-grab_version.exe "C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"Version info written to: file_version_info.txt

2.file_version_info.txt内容说明

(其中注意因为这个版本信息是严格的数据结构,所以最好不要随意修改,有可能导致版本信息文件失效,推荐使用是notepad++更改。)

# UTF-8## For more details about fixed file info 'ffi' see:# 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和prodvers应该始终是包含四个项的元组:(1、2、3、4),将不需要的项设置为0 filevers=(3, 6, 0, 0), # 文件版本******,鼠标悬浮exe会显示,也显示在 详细信息-文件版本,这个是检测版本的依据 prodvers=(3, 6, 0, 0), # 生产商,未见显示在哪里 # 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=0x40004, # 为其设计此文件的操作系统,0x4-NT,无需更改它 # The general type of file. # 0x1 - the file is an application. fileType=0x1, # 文件的常规类型,0x1-该文件是一个应用程序 # The function of the file. # 0x0 - the function is not defined for this fileType subtype=0x0, # 文件的功能,0x0表示该文件类型未定义 # Creation date and time stamp. date=(0, 0) # 创建日期和时间戳 ), kids=[ StringFileInfo( [ StringTable( u'080404b0', [StringStruct(u'CompanyName', u'Tencent'), # 公司,鼠标悬浮exe会显示 StringStruct(u'FileDescription', u'WeChat'), # 文件说明,鼠标悬浮exe会显示,也会显示在 详细信息-文件说明 StringStruct(u'FileVersion', u'3.6.0.0'), # 没见哪里显示 StringStruct(u'LegalCopyright', u'Copyright (C) 2021 Tencent'), # 版权,会显示在 详细信息-版权 StringStruct(u'ProductName', u'WeChat'), # 原始文件名,会显示在 详细信息-原始文件名 StringStruct(u'ProductVersion', u'3.6.0.0')]) # 产品版本,会显示在 详细信息-产品版本 ]), VarFileInfo([VarStruct(u'Translation', [2052, 1200])]) # 语言,中文简体 ])

打包.py生成exe文件(直接稍加修改file_version_info.txt,保存信息)

c:\Python27\Scripts\pyinstaller.exe --version-file file_version_info.txt -F test.py

选取一个喜欢.ico文件,作为自己软件的图标,打包进exe中

c:\Python27\Scripts\pyinstaller.exe -i setup.ico --version-file file_version_info.txt -F test.py

生成的exe文件

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:《惢客创业日记》2020.08.07-09(周五)超级共享客服与自由职业者
下一篇:学了python能干什么(学了python可以干什么)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~