2022-04-10 23:57:13 -04:00
|
|
|
# Windows-only cx_freeze setup file, macOS may work but I've not tested it.
|
2011-06-26 18:14:19 -04:00
|
|
|
import sys
|
2021-03-24 17:34:55 -04:00
|
|
|
|
2022-04-10 23:57:13 -04:00
|
|
|
from cx_Freeze import setup, Executable
|
2022-04-28 18:29:44 -04:00
|
|
|
import pygame
|
2022-04-10 23:57:13 -04:00
|
|
|
|
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
|
|
|
|
|
2022-03-23 21:04:55 -04:00
|
|
|
path = ""
|
2021-03-26 11:54:07 -04:00
|
|
|
base = None
|
|
|
|
if sys.platform == "win32":
|
|
|
|
base = "Win32GUI"
|
2011-06-26 18:14:19 -04:00
|
|
|
|
2021-12-01 10:03:45 -05:00
|
|
|
path = sys.path
|
|
|
|
if is_64bit() == True:
|
|
|
|
path.append(r"C:\Program Files (x86)\Windows Kits\10\Redist\10.0.22000.0\ucrt\DLLs\x64")
|
|
|
|
elif is_64bit() == False:
|
|
|
|
path.append(r"C:\Program Files (x86)\Windows Kits\10\Redist\10.0.22000.0\ucrt\DLLs\x86")
|
|
|
|
|
|
|
|
print("Path = " + str(path))
|
|
|
|
|
2021-03-24 17:34:55 -04:00
|
|
|
includefiles = ["quirks",
|
|
|
|
"smilies",
|
|
|
|
"themes",
|
2021-03-25 09:09:43 -04:00
|
|
|
"docs",
|
2021-03-24 17:34:55 -04:00
|
|
|
"README.md",
|
2021-03-25 09:09:43 -04:00
|
|
|
"LICENSE",
|
|
|
|
"CHANGELOG.md",
|
2021-03-24 17:34:55 -04:00
|
|
|
"PCskins.png",
|
2022-05-04 16:36:42 -04:00
|
|
|
"Pesterchum.png"]
|
2020-10-04 09:25:19 -04:00
|
|
|
build_exe_options = {
|
2022-04-28 18:29:44 -04:00
|
|
|
"includes": ['PyQt5.QtCore',
|
|
|
|
'PyQt5.QtGui',
|
|
|
|
'PyQt5.QtWidgets'],
|
2022-04-13 13:42:42 -04:00
|
|
|
"excludes": ['tkinter',
|
|
|
|
'collections.sys',
|
2021-07-15 17:54:48 -04:00
|
|
|
'collections._sre',
|
|
|
|
'collections._json',
|
|
|
|
'collections._locale',
|
|
|
|
'collections._struct',
|
|
|
|
'collections.array',
|
|
|
|
'collections._weakref',
|
|
|
|
'PyQt5.QtMultimedia',
|
|
|
|
'PyQt5.QtDBus',
|
|
|
|
'PyQt5.QtDeclarative',
|
|
|
|
'PyQt5.QtHelp',
|
|
|
|
'PyQt5.QtNetwork',
|
|
|
|
'PyQt5.QtSql',
|
|
|
|
'PyQt5.QtSvg',
|
|
|
|
'PyQt5.QtTest',
|
|
|
|
'PyQt5.QtWebKit',
|
2022-04-28 18:29:44 -04:00
|
|
|
'PyQt5.QtXml',
|
|
|
|
'PyQt5.QtXmlPatterns',
|
2021-07-15 17:54:48 -04:00
|
|
|
'PyQt5.phonon',
|
|
|
|
'PyQt5.QtAssistant',
|
|
|
|
'PyQt5.QtDesigner',
|
2022-04-28 18:29:44 -04:00
|
|
|
'PyQt5.QAxContainer',
|
|
|
|
'asyncio', # for now . . .
|
|
|
|
'email', # ?? :?
|
|
|
|
'xml',
|
|
|
|
'pygame.docs' # Hopefully we can just not have pygame at all at some point =3
|
|
|
|
# (when QtMultimedia stops relying on local codecs </3)
|
|
|
|
'pygame.examples',
|
|
|
|
'pygame.tests',
|
|
|
|
'pydoc_data'],
|
2021-03-26 17:54:03 -04:00
|
|
|
"include_files": includefiles,
|
2021-12-01 10:03:45 -05:00
|
|
|
"include_msvcr": True, # cx_freeze copies 64-bit binaries always?
|
|
|
|
"path": path # Improved in 6.6, path to be safe
|
|
|
|
# VCRUNTIME140.dll <3
|
2020-10-04 09:25:19 -04:00
|
|
|
}
|
2021-03-26 10:24:19 -04:00
|
|
|
|
2021-03-26 10:43:00 -04:00
|
|
|
bdist_mac_options = {
|
|
|
|
'iconfile': 'trayicon32.icns',
|
2021-03-26 11:54:07 -04:00
|
|
|
'bundle_name': "Pesterchum"
|
2021-03-26 10:43:00 -04:00
|
|
|
}
|
|
|
|
|
2021-04-16 09:37:38 -04:00
|
|
|
description = "Pesterchum"
|
2021-03-26 10:24:19 -04:00
|
|
|
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, # !!!
|
2021-07-15 17:54:48 -04:00
|
|
|
'all_users': False,
|
2021-03-26 10:24:19 -04:00
|
|
|
'install_icon': "pesterchum.ico"}
|
|
|
|
|
|
|
|
setup(
|
|
|
|
name = "Pesterchum",
|
2021-03-24 17:34:55 -04:00
|
|
|
version = buildVersion,
|
|
|
|
url = "https://github.com/Dpeta/pesterchum-alt-servers",
|
2021-03-26 10:24:19 -04:00
|
|
|
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},
|
2022-04-28 18:29:44 -04:00
|
|
|
packages="",
|
2021-03-24 12:27:09 -04:00
|
|
|
executables = [Executable("pesterchum.py",
|
|
|
|
base=base,
|
2021-03-26 11:54:07 -04:00
|
|
|
icon=icon
|
2021-03-24 12:27:09 -04:00
|
|
|
)])
|