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

打包命令:

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])]) # 语言,中文简体

 ]

  • 21
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值