]>
jfr.im git - yt-dlp.git/blob - pyinst.py
1 from PyInstaller
.utils
.win32
.versioninfo
import (
2 VarStruct
, VarFileInfo
, StringStruct
, StringTable
,
3 StringFileInfo
, FixedFileInfo
, VSVersionInfo
, SetVersion
,
5 import PyInstaller
.__main
__
7 from datetime
import datetime
9 FILE_DESCRIPTION
= 'Media Downloader'
11 exec(compile(open('youtube_dlc/version.py').read(), 'youtube_dlc/version.py', 'exec'))
13 _LATEST_VERSION
= locals()['__version__']
15 _OLD_VERSION
= _LATEST_VERSION
.rsplit("-", 1)
17 if len(_OLD_VERSION
) > 0:
18 old_ver
= _OLD_VERSION
[0]
21 if len(_OLD_VERSION
) > 1:
22 old_rev
= _OLD_VERSION
[1]
24 ver
= f
'{datetime.today():%Y.%m.%d}'
29 rev
= int(old_rev
) + 1
35 version
= _SEPARATOR
.join(filter(None, [ver
, str(rev
)]))
39 version_list
= ver
.split(".")
40 _year
, _month
, _day
= [int(value
) for value
in version_list
]
44 _ver_tuple
= _year
, _month
, _day
, _rev
46 version_file
= VSVersionInfo(
63 StringStruct("Comments", "Youtube-dlc Command Line Interface."),
64 StringStruct("CompanyName", "theidel@uni-bremen.de"),
65 StringStruct("FileDescription", FILE_DESCRIPTION
),
66 StringStruct("FileVersion", version
),
67 StringStruct("InternalName", "youtube-dlc"),
70 "theidel@uni-bremen.de | UNLICENSE",
72 StringStruct("OriginalFilename", "youtube-dlc.exe"),
73 StringStruct("ProductName", "Youtube-dlc"),
74 StringStruct("ProductVersion", version
+ " | git.io/JUGsM"),
79 VarFileInfo([VarStruct("Translation", [0, 1200])])
83 PyInstaller
.__main
__.run([
86 '--icon=win/icon/cloud.ico',
87 'youtube_dlc/__main__.py',
89 SetVersion('dist/youtube-dlc.exe', version_file
)