pesterchum/setup.py

109 lines
3.8 KiB
Python
Raw Normal View History

2011-06-26 18:14:19 -04:00
# Windows-only cx_freeze setup file
from cx_Freeze import *
2011-06-26 18:14:19 -04:00
import sys
2021-03-24 17:34:55 -04:00
from version import buildVersion
2011-06-26 18:14:19 -04:00
2021-03-24 12:27:09 -04:00
if sys.version_info < (3, 0, 0):
2021-03-24 17:34:55 -04:00
sys.exit("Python versions lower than 3 are not supported.")
2021-03-24 12:27:09 -04:00
def is_64bit() -> bool:
return sys.maxsize > 2**32
2011-06-26 18:14:19 -04:00
if sys.platform == "win32":
base = "Win32GUI"
else:
2021-03-24 17:34:55 -04:00
sys.exit("This script won't work on this platform </3")
2011-06-26 18:14:19 -04:00
2021-03-24 17:34:55 -04:00
includefiles = ["quirks",
"smilies",
"themes",
"docs",
2021-03-24 17:34:55 -04:00
"README.md",
"LICENSE",
"CHANGELOG.md",
2021-03-24 17:34:55 -04:00
"server.json",
"PCskins.png",
"Pesterchum.png"]
build_exe_options = {
2021-03-24 17:34:55 -04:00
"includes": ["requests","urllib","pytwmn"],
"excludes": ["collections.sys",
"collections._sre",
"collections._json",
"collections._locale",
"collections._struct",
"collections.array",
"collections._weakref"],
"include_files": includefiles
}
2021-03-26 10:43:00 -04:00
bdist_mac_options = {
'iconfile': 'trayicon32.icns',
'bundle_name': "Pesterchum",
'plist': {
'NSHumanReadableCopyright': 'GPL v3',
}
}
description = "Instant messaging client copying the look and feel of clients from Andrew Hussie's webcomic Homestuck."
icon = "pesterchum.ico"
# See https://stackoverflow.com/questions/15734703/use-cx-freeze-to-create-an-msi-that-adds-a-shortcut-to-the-desktop
shortcut_table = [
("DesktopShortcut", # Shortcut
"DesktopFolder", # Directory_
"Pesterchum", # Name
"TARGETDIR", # Component_
"[TARGETDIR]pesterchum.exe",# Target
None, # Arguments
description, # Description
None, # Hotkey
None, # Icon (Is inherited from pesterchum.exe)
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
),
("StartMenuShortcut", # Shortcut
"StartMenuFolder", # Directory_
"Pesterchum", # Name
"TARGETDIR", # Component_
"[TARGETDIR]pesterchum.exe",# Target
None, # Arguments
description, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR' # WkDir
)
]
msi_data = {"Shortcut": shortcut_table}
bdist_msi_options = {'data': msi_data,
'summary_data': {
'comments': "FL1P",
'keywords': "Pesterchum"},
'upgrade_code': "{86740d75-f1f2-48e8-8266-f36395a2d77f}",
'add_to_path': False, # !!!
'all_users': True,
'install_icon': "pesterchum.ico"}
2021-03-24 17:34:55 -04:00
#print("type(includefiles) = " + str(type(includefiles)))
#print("type(build_exe_options) = " + str(type(build_exe_options))
setup(
name = "Pesterchum",
2021-03-24 17:34:55 -04:00
version = buildVersion,
url = "https://github.com/Dpeta/pesterchum-alt-servers",
description = description,#"P3ST3RCHUM",
options = {"build_exe": build_exe_options,
2021-03-26 10:43:00 -04:00
"bdist_msi": bdist_msi_options,
"bdist_mac": bdist_mac_options},
2021-03-24 12:27:09 -04:00
executables = [Executable("pesterchum.py",
base=base,
icon=icon#,
#shortcut_name="Pesterchum",
#shortcut_dir="DesktopFolder"
2021-03-24 12:27:09 -04:00
)])