-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreeze_builds.py
33 lines (26 loc) · 1.18 KB
/
freeze_builds.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
33
import sys, os
from cx_Freeze import setup, Executable
import subprocess
subprocess.call("set TCL_LIBRARY=C:\Program Files (x86)\Python35-32\tcl\tcl8.6", shell=True)
subprocess.call("set TK_LIBRARY=C:\Program Files (x86)\Python35-32\tcl\tk8.6", shell=True)
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"build_exe":"build",
"packages": ["os"],
"include_files":[("config/potm", "config/potm"),
("config/main_config.toml", "config/main_config.toml"),
("winmtr", "winmtr")]}
#("windows_manifest.xml", "NWN Launcher.xml.manifest")
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup( name = "guifoo",
version = "0.1",
description = "My GUI application!",
options = {"build_exe": build_exe_options},
executables = [Executable("main.py", base=base, targetName="NWN Launcher.exe", icon="ICO/nwn_composite_RA8_icon.ico")])
subprocess.call('mt -manifest windows_manifest.xml -outputresource:"build/NWN Launcher.exe"', shell=True)
os.remove("build/tk/images")
os.remove("build/tk/demos")
os.remove("build/tcl/tzdata")