]> jfr.im git - yt-dlp.git/blame - build_exe.py
wine-py2exe.sh to create the exe under linux (!!)
[yt-dlp.git] / build_exe.py
CommitLineData
770234af
FV
1from distutils.core import setup
2import py2exe
53e89361 3import sys, os
770234af 4
c6306eb7
FVC
5"""This will create an exe that needs Microsoft Visual C++ 2008 Redistributable Package"""
6
770234af
FV
7# If run without args, build executables
8if len(sys.argv) == 1:
9 sys.argv.append("py2exe")
10
c6306eb7 11# os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # conflict with wine-py2exe.sh
770234af
FV
12sys.path.append('./youtube_dl')
13
14options = {
15 "bundle_files": 1,
16 "compressed": 1,
17 "optimize": 2,
18 "dist_dir": '.',
19 "dll_excludes": ['w9xpopen.exe']
20}
21
22console = [{
23 "script":"./youtube_dl/__main__.py",
24 "dest_base": "youtube-dl",
25}]
26
53e89361
FV
27init_file = open('./youtube_dl/__init__.py')
28for line in init_file.readlines():
29 if line.startswith('__version__'):
30 version = line[11:].strip(" ='\n")
31 break
32else:
33 version = ''
34
35setup(name='youtube-dl',
36 version=version,
37 description='Small command-line program to download videos from YouTube.com and other video sites',
38 url='https://github.com/rg3/youtube-dl',
39 packages=['youtube_dl'],
40
41 console = console,
42 options = {"py2exe": options},
43 zipfile = None,
770234af
FV
44)
45
46import shutil
47shutil.rmtree("build")
48