mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Launcher: fix loading of mcicon (#1779)
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
13
setup.py
13
setup.py
@@ -157,11 +157,22 @@ build_arch = build_platform.split('-')[-1] if '-' in build_platform else platfor
|
||||
|
||||
|
||||
# see Launcher.py on how to add scripts to setup.py
|
||||
def resolve_icon(icon_name: str):
|
||||
base_path = icon_paths[icon_name]
|
||||
if is_windows:
|
||||
path, extension = os.path.splitext(base_path)
|
||||
ico_file = path + ".ico"
|
||||
assert os.path.exists(ico_file), f"ico counterpart of {base_path} should exist."
|
||||
return ico_file
|
||||
else:
|
||||
return base_path
|
||||
|
||||
|
||||
exes = [
|
||||
cx_Freeze.Executable(
|
||||
script=f'{c.script_name}.py',
|
||||
target_name=c.frozen_name + (".exe" if is_windows else ""),
|
||||
icon=icon_paths[c.icon],
|
||||
icon=resolve_icon(c.icon),
|
||||
base="Win32GUI" if is_windows and not c.cli else None
|
||||
) for c in components if c.script_name and c.frozen_name
|
||||
]
|
||||
|
Reference in New Issue
Block a user