コード例 #1
0
def test_versioninfo(tmp_path):
    from PyInstaller.utils.win32.versioninfo import VSVersionInfo, \
        FixedFileInfo, StringFileInfo, StringTable, StringStruct, \
        VarFileInfo, VarStruct

    vsinfo = VSVersionInfo(
        ffi=FixedFileInfo(filevers=(1, 2, 3, 4),
                          prodvers=(5, 6, 7, 8),
                          mask=0x3f,
                          flags=0x1,
                          OS=0x40004,
                          fileType=0x42,
                          subtype=0x42,
                          date=(0, 0)),
        kids=[
            StringFileInfo([
                StringTable(
                    '040904b0',
                    [StringStruct('FileDescription', 'versioninfo test')])
            ]),
            VarFileInfo([VarStruct('Translation', [1033, 1200])])
        ])

    file = str(tmp_path / 'versioninfo')
    save_py_data_struct(file, vsinfo)

    assert vsinfo == load_py_data_struct(file)
コード例 #2
0
ファイル: pyinst.py プロジェクト: yt-dlp/yt-dlp
def windows_set_version(exe, version):
    version_list = version_to_list(version)
    suffix = '_x86' if ARCH == '32' else ''
    SetVersion(exe, VSVersionInfo(
        ffi=FixedFileInfo(
            filevers=version_list,
            prodvers=version_list,
            mask=0x3F,
            flags=0x0,
            OS=0x4,
            fileType=0x1,
            subtype=0x0,
            date=(0, 0),
        ),
        kids=[
            StringFileInfo([StringTable('040904B0', [
                StringStruct('Comments', 'yt-dlp%s Command Line Interface.' % suffix),
                StringStruct('CompanyName', 'https://github.com/yt-dlp'),
                StringStruct('FileDescription', 'yt-dlp%s' % (' (32 Bit)' if ARCH == '32' else '')),
                StringStruct('FileVersion', version),
                StringStruct('InternalName', f'yt-dlp{suffix}'),
                StringStruct('LegalCopyright', '[email protected] | UNLICENSE'),
                StringStruct('OriginalFilename', f'yt-dlp{suffix}.exe'),
                StringStruct('ProductName', f'yt-dlp{suffix}'),
                StringStruct(
                    'ProductVersion', f'{version}{suffix} on Python {platform.python_version()}'),
            ])]), VarFileInfo([VarStruct('Translation', [0, 1200])])
        ]
    ))
コード例 #3
0
ファイル: pyinst.py プロジェクト: llacb47/yt-dlp
        OS=0x4,
        fileType=0x1,
        subtype=0x0,
        date=(0, 0),
    ),
    kids=[
        StringFileInfo([
            StringTable('040904B0', [
                StringStruct('Comments',
                             'yt-dlp%s Command Line Interface.' % _x86),
                StringStruct('CompanyName', 'https://github.com/yt-dlp'),
                StringStruct('FileDescription', FILE_DESCRIPTION),
                StringStruct('FileVersion', VERSION),
                StringStruct('InternalName', 'yt-dlp%s' % _x86),
                StringStruct(
                    'LegalCopyright',
                    '[email protected] | UNLICENSE',
                ),
                StringStruct('OriginalFilename', 'yt-dlp%s.exe' % _x86),
                StringStruct('ProductName', 'yt-dlp%s' % _x86),
                StringStruct(
                    'ProductVersion', '%s%s on Python %s' %
                    (VERSION, _x86, platform.python_version())),
            ])
        ]),
        VarFileInfo([VarStruct('Translation', [0, 1200])])
    ])

dependancies = ['Crypto', 'mutagen'] + collect_submodules('websockets')
excluded_modules = ['test', 'ytdlp_plugins', 'youtube-dl', 'youtube-dlc']
コード例 #4
0
        fileType=0x1,
        subtype=0x0,
        date=(0, 0),
    ),
    kids=[
        StringFileInfo([
            StringTable(
                "040904B0",
                [
                    StringStruct("Comments",
                                 "Youtube-dlc_x86 Command Line Interface."),
                    StringStruct("CompanyName", "*****@*****.**"),
                    StringStruct("FileDescription", FILE_DESCRIPTION),
                    StringStruct("FileVersion", version),
                    StringStruct("InternalName", "youtube-dlc_x86"),
                    StringStruct(
                        "LegalCopyright",
                        "[email protected] | UNLICENSE",
                    ),
                    StringStruct("OriginalFilename", "youtube-dlc_x86.exe"),
                    StringStruct("ProductName", "Youtube-dlc_x86"),
                    StringStruct("ProductVersion",
                                 version + "_x86 | git.io/JUGsM"),
                ],
            )
        ]),
        VarFileInfo([VarStruct("Translation", [0, 1200])])
    ])

PyInstaller.__main__.run([
    '--name=youtube-dlc_x86',
コード例 #5
0
ファイル: setup.py プロジェクト: sri1112/youtube-dl-GUI
class BuildPyinstallerBin(Command):
    description = "Build the executable"
    user_options = []
    version_file = None
    if pyi_compat and pyi_compat.is_win:
        version_file = VSVersionInfo(
            ffi=FixedFileInfo(
                filevers=version2tuple(),
                prodvers=version2tuple(),
                mask=0x3F,
                flags=0x0,
                OS=0x4,
                fileType=0x1,
                subtype=0x0,
                date=(0, 0),
            ),
            kids=[
                VarFileInfo([VarStruct("Translation", [0, 1200])]),
                StringFileInfo(
                    [
                        StringTable(
                            "000004b0",
                            [
                                StringStruct("CompanyName", __maintainer_contact__),
                                StringStruct("FileDescription", DESCRIPTION),
                                StringStruct("FileVersion", version2str()),
                                StringStruct("InternalName", "youtube-dl-gui.exe"),
                                StringStruct(
                                    "LegalCopyright",
                                    __projecturl__ + "LICENSE",
                                ),
                                StringStruct("OriginalFilename", "youtube-dl-gui.exe"),
                                StringStruct("ProductName", __appname__),
                                StringStruct("ProductVersion", version2str()),
                            ],
                        )
                    ]
                ),
            ],
        )

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self, version=version_file):
        """Run pyinstaller"""
        if on_windows():
            path_sep = ";"
        else:
            path_sep = ":"
        
        spawn(
            [
                "pyinstaller",
                "-w",
                "-F",
                "--icon=UI/images/icon.ico",
                "--add-data=UI/images"+path_sep+"UI/images",
                "--name=youtube-dl-gui",
                "main.py",
            ],
            dry_run=self.dry_run)

        if version:
            time.sleep(3)
            SetVersion("./dist/youtube-dl-gui.exe", version)
コード例 #6
0
        flags=0x0,
        OS=0x4,
        fileType=0x1,
        subtype=0x0,
        date=(0, 0),
    ),
    kids=[
        StringFileInfo([
            StringTable(
                "040904B0", [
                    StringStruct("Comments", "Youtube-dlc%s Command Line Interface." % _x86),
                    StringStruct("CompanyName", "*****@*****.**"),
                    StringStruct("FileDescription", FILE_DESCRIPTION),
                    StringStruct("FileVersion", VERSION),
                    StringStruct("InternalName", "youtube-dlc%s" % _x86),
                    StringStruct(
                        "LegalCopyright",
                        "[email protected] | UNLICENSE",
                    ),
                    StringStruct("OriginalFilename", "youtube-dlc%s.exe" % _x86),
                    StringStruct("ProductName", "Youtube-dlc%s" % _x86),
                    StringStruct("ProductVersion", "%s%s | %s" % (VERSION, _x86, SHORT_URLS[sys.argv[1]])),
                ])]),
        VarFileInfo([VarStruct("Translation", [0, 1200])])
    ]
)

PyInstaller.__main__.run([
    '--name=youtube-dlc%s' % _x86,
    '--onefile',
    '--icon=devscripts/cloud.ico',
コード例 #7
0
class BuildPyinstallerBin(Command):

    description = "Build the executable"
    user_options = []
    version_file = None
    if pyi_compat and pyi_compat.is_win:
        version_file = VSVersionInfo(
            ffi=FixedFileInfo(
                filevers=version2tuple(),
                prodvers=version2tuple(),
                mask=0x3F,
                flags=0x0,
                OS=0x4,
                fileType=0x1,
                subtype=0x0,
                date=(0, 0),
            ),
            kids=[
                VarFileInfo([VarStruct("Translation", [0, 1200])]),
                StringFileInfo([
                    StringTable(
                        "000004b0",
                        [
                            StringStruct("CompanyName",
                                         "*****@*****.**"),
                            StringStruct("FileDescription", DESCRIPTION),
                            StringStruct("FileVersion", version2str()),
                            StringStruct("InternalName", "picta-dl.exe"),
                            StringStruct(
                                "LegalCopyright",
                                "https://github.com/oleksis/picta-dl/LICENSE",
                            ),
                            StringStruct("OriginalFilename", "picta-dl.exe"),
                            StringStruct("ProductName", "Picta-DL"),
                            StringStruct("ProductVersion", version2str()),
                        ],
                    )
                ]),
            ],
        )

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self, version=version_file):
        spawn(
            [
                "pyinstaller",
                "-c",
                "-F",
                "--icon=assets/picta-dl.ico",
                "--exclude-module=test",
                "--name=picta-dl",
                "picta_dl/__main__.py",
            ],
            dry_run=self.dry_run,
        )
        if version:
            time.sleep(3)
            SetVersion("./dist/picta-dl.exe", version)
コード例 #8
0
ファイル: pyinstaller.py プロジェクト: rlaphoenix/Slipstream
VERSION_4_TUP = tuple(map(int, ("%s.0" % VERSION).split(".")))
VERSION_4_STR = ".".join(map(str, VERSION_4_TUP))
SetVersion(
    "dist/{0}/{0}.exe".format(NAME),
    VSVersionInfo(
        ffi=FixedFileInfo(filevers=VERSION_4_TUP, prodvers=VERSION_4_TUP),
        kids=[
            StringFileInfo([
                StringTable(
                    "040904B0",  # ?
                    [
                        StringStruct("Comments", NAME),
                        StringStruct("CompanyName", AUTHOR),
                        StringStruct(
                            "FileDescription",
                            "The most informative Home-media backup solution"),
                        StringStruct("FileVersion", VERSION_4_STR),
                        StringStruct("InternalName", NAME),
                        StringStruct("LegalCopyright",
                                     "Copyright (C) 2021 %s" % AUTHOR),
                        StringStruct("OriginalFilename", ""),
                        StringStruct("ProductName", NAME),
                        StringStruct("ProductVersion", VERSION_4_STR)
                    ])
            ]),
            VarFileInfo([VarStruct("Translation", [0, 1200])])  # ?
        ]))

if not DEBUG:
    shutil.rmtree("build", ignore_errors=True)
    Path("Slipstream.spec").unlink(missing_ok=True)
コード例 #9
0
ファイル: pyinst.py プロジェクト: CorentinB/yt-dlp
        flags=0x0,
        OS=0x4,
        fileType=0x1,
        subtype=0x0,
        date=(0, 0),
    ),
    kids=[
        StringFileInfo([
            StringTable('040904B0', [
                StringStruct('Comments',
                             'Youtube-dlc%s Command Line Interface.' % _x86),
                StringStruct('CompanyName', '*****@*****.**'),
                StringStruct('FileDescription', FILE_DESCRIPTION),
                StringStruct('FileVersion', VERSION),
                StringStruct('InternalName', 'youtube-dlc%s' % _x86),
                StringStruct(
                    'LegalCopyright',
                    '[email protected] | UNLICENSE',
                ),
                StringStruct('OriginalFilename', 'youtube-dlc%s.exe' % _x86),
                StringStruct('ProductName', 'Youtube-dlc%s' % _x86),
                StringStruct('ProductVersion', '%s%s | %s' %
                             (VERSION, _x86, SHORT_URLS[arch])),
            ])
        ]),
        VarFileInfo([VarStruct('Translation', [0, 1200])])
    ])

PyInstaller.__main__.run([
    '--name=youtube-dlc%s' % _x86,
    '--onefile',
    '--icon=devscripts/cloud.ico',