-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_exe.py
32 lines (28 loc) · 1011 Bytes
/
create_exe.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Run as "python setup.py py2exe"
from distutils.core import setup
from sys import argv
import os
import py2exe
if __name__ == '__main__' and len(argv) < 2:
argv.append('py2exe')
if os.path.exists('Editor.exe'):
os.remove('Editor.exe')
setup(windows=[{"script": "main.pyw",
#"icon_resources": [(1, "editor.ico"), (2, "editor.ico")],
"dest_base": "Editor",
}],
name="Structured Editor",
options={"py2exe": {"includes": ["sip",
"PyQt4.QtNetwork",
"dbhash"],
"dll_excludes": ["MSVCP90.dll", "w9xpopen.exe"],
"optimize": 2,
"bundle_files": 1,
"compressed": True,
}},
zipfile = None,
)
import shutil
os.rename('dist/Editor.exe', 'Editor.exe')
shutil.rmtree('dist', ignore_errors=True)
shutil.rmtree('build', ignore_errors=True)