]>
jfr.im git - yt-dlp.git/blob - pyinst.py
4 from __future__
import unicode_literals
9 from PyInstaller
.utils
.win32
.versioninfo
import (
10 VarStruct
, VarFileInfo
, StringStruct
, StringTable
,
11 StringFileInfo
, FixedFileInfo
, VSVersionInfo
, SetVersion
,
13 import PyInstaller
.__main
__
15 arch
= sys
.argv
[1] if len(sys
.argv
) > 1 else platform
.architecture()[0][:2]
16 assert arch
in ('32', '64')
17 print('Building %sbit version' % arch
)
18 _x86
= '_x86' if arch
== '32' else ''
20 FILE_DESCRIPTION
= 'Media Downloader%s' % (' (32 Bit)' if _x86
else '')
22 # root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
23 # print('Changing working directory to %s' % root_dir)
26 exec(compile(open('youtube_dlc/version.py').read(), 'youtube_dlc/version.py', 'exec'))
27 VERSION
= locals()['__version__']
29 VERSION_LIST
= VERSION
.split('.')
30 VERSION_LIST
= list(map(int, VERSION_LIST
)) + [0] * (4 - len(VERSION_LIST
))
32 print('Version: %s%s' % (VERSION
, _x86
))
33 print('Remember to update the version using devscipts\\update-version.py')
35 VERSION_FILE
= VSVersionInfo(
37 filevers
=VERSION_LIST
,
38 prodvers
=VERSION_LIST
,
50 StringStruct('Comments', 'Youtube-dlc%s Command Line Interface.' % _x86
),
51 StringStruct('CompanyName', 'https://github.com/pukkandan/yt-dlp'),
52 StringStruct('FileDescription', FILE_DESCRIPTION
),
53 StringStruct('FileVersion', VERSION
),
54 StringStruct('InternalName', 'youtube-dlc%s' % _x86
),
57 'pukkandan@gmail.com | UNLICENSE',
59 StringStruct('OriginalFilename', 'youtube-dlc%s.exe' % _x86
),
60 StringStruct('ProductName', 'Youtube-dlc%s' % _x86
),
61 StringStruct('ProductVersion', '%s%s' % (VERSION
, _x86
)),
63 VarFileInfo([VarStruct('Translation', [0, 1200])])
67 PyInstaller
.__main
__.run([
68 '--name=youtube-dlc%s' % _x86
,
70 '--icon=devscripts/cloud.ico',
71 '--exclude-module=youtube_dl',
72 '--exclude-module=test',
73 '--exclude-module=ytdlp_plugins',
74 '--hidden-import=mutagen',
75 '--hidden-import=pycryptodome',
76 'youtube_dlc/__main__.py',
78 SetVersion('dist/youtube-dlc%s.exe' % _x86
, VERSION_FILE
)