Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/348.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何更新PyInstaller生成的exe详细信息?_Python_Installation_Pyinstaller - Fatal编程技术网

Python 如何更新PyInstaller生成的exe详细信息?

Python 如何更新PyInstaller生成的exe详细信息?,python,installation,pyinstaller,Python,Installation,Pyinstaller,我已使用PyInstaller创建可执行文件,并希望更新可执行文件的详细信息,如文件说明,文件版本 下面是我使用的命令 PyInstaller --onefile --icon=favicon.ico main.spec 我指的是如下详细信息选项卡所示的属性: 检查pyinstaller文档。所有这些都列在那里-规范文件否决了cmdline参数。另外,请参阅 I have solved this by myself with the help of python documentation

我已使用PyInstaller创建可执行文件,并希望更新可执行文件的详细信息,如
文件说明
文件版本

下面是我使用的命令

PyInstaller --onefile --icon=favicon.ico main.spec
我指的是如下详细信息选项卡所示的属性:


检查pyinstaller文档。所有这些都列在那里-规范文件否决了cmdline参数。另外,请参阅
I have solved this by myself with the help of python documentation

1. Create version.rc file

    VSVersionInfo(
        ffi=FixedFileInfo(
        filevers=(ProductVersions),
        prodvers=(ProductVersions),
        mask=0x3f,
        flags=0x0,
        OS=0x40004,
        fileType=0x1,
        subtype=0x0,
        date=(0, 0)),
        kids=[StringFileInfo([StringTable(
        u'040904B0',
        [StringStruct(u'FileDescription', u'xyz'),
        StringStruct(u'FileVersion', u'1.0.0.0'),
        StringStruct(u'InternalName', u'xyz'),
        StringStruct(u'LegalCopyright', u'Copyright'),
        StringStruct(u'OriginalFilename', u'xyz'),
        StringStruct(u'ProductName', u'xyz'),
        StringStruct(u'ProductVersion', u'1.0.0.0'),
        StringStruct(u'Language', u'Language Neutral'),
        StringStruct(u'LegalTrademarks', u'xyz')])]), 
        VarFileInfo([VarStruct(u'Translation', [1033, 1200])])]
    )

2. Create main.spec file and call version.rc file in that

  a = Analysis(['main.py'],
             pathex=['.'],
             binaries=[],
             datas=[('data\\*.tsv', 'data')],
             hiddenimports=['sklearn.neighbors.typedefs','sklearn.neighbors.quad_tree','sklearn.tree._utils','boto', 'smart_open'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          [],
          name='xyz',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          runtime_tmpdir=None,
          console=True , icon='favicon.ico', version='version.rc')