예제 #1
0
    def run(self, version=version_file):
        """Run pyinstaller"""
        if on_windows():
            path_sep = ";"
        else:
            path_sep = ":"

        spawn([
            "pyinstaller",
            "-w",
            "-F",
            "--icon=" + __packagename__ + "/data/pixmaps/youtube-dl-gui.ico",
            "--add-data=" + __packagename__ + "/data" + path_sep +
            __packagename__ + "/data",
            "--add-data=" + __packagename__ + "/locale" + path_sep +
            __packagename__ + "/locale",
            "--exclude-module=tests",
            "--name=youtube-dlg",
            "" + __packagename__ + "/__main__.py",
        ],
              dry_run=self.dry_run)

        if version:
            time.sleep(3)
            SetVersion("./dist/youtube-dlg.exe", version)
예제 #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
 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)
예제 #4
0
    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)
예제 #5
0
파일: pyinst.py 프로젝트: llacb47/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']

PyInstaller.__main__.run([
    '--name=yt-dlp%s' % _x86,
    '--onefile',
    '--icon=devscripts/cloud.ico',
    *[f'--exclude-module={module}' for module in excluded_modules],
    *[f'--hidden-import={module}' for module in dependancies],
    '--upx-exclude=vcruntime140.dll',
    'yt_dlp/__main__.py',
])
SetVersion('dist/yt-dlp%s.exe' % _x86, VERSION_FILE)
예제 #6
0
            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',
    '--onefile',
    '--icon=win/icon/cloud.ico',
    'youtube_dlc/__main__.py',
])
SetVersion('dist/youtube-dlc_x86.exe', version_file)
예제 #7
0

def pycryptodome_module():
    try:
        import Cryptodome  # noqa: F401
    except ImportError:
        try:
            import Crypto  # noqa: F401
            print('WARNING: Using Crypto since Cryptodome is not available. '
                  'Install with: pip install pycryptodomex', file=sys.stderr)
            return 'Crypto'
        except ImportError:
            pass
    return 'Cryptodome'


dependancies = [pycryptodome_module(), 'mutagen'] + collect_submodules('websockets')
excluded_modules = ['test', 'ytdlp_plugins', 'youtube-dl', 'youtube-dlc']

PyInstaller.__main__.run([
    '--name=yt-dlp%s' % _x86,
    '--icon=devscripts/logo.ico',
    *[f'--exclude-module={module}' for module in excluded_modules],
    *[f'--hidden-import={module}' for module in dependancies],
    '--upx-exclude=vcruntime140.dll',
    '--noconfirm',
    *opts,
    'yt_dlp/__main__.py',
])
SetVersion('dist/%syt-dlp%s.exe' % ('yt-dlp/' if '--onedir' in opts else '', _x86), VERSION_FILE)
예제 #8
0
            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',
    '--exclude-module=youtube_dl',
    '--exclude-module=test',
    '--exclude-module=ytdlp_plugins',
    '--hidden-import=mutagen',
    'youtube_dlc/__main__.py',
])
SetVersion('dist/youtube-dlc%s.exe' % _x86, VERSION_FILE)
예제 #9
0
"""Set Version Info Structure."""
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)