Füge Unterstützung für benutzerdefinierte Icons in der Build-Konfiguration hinzu.
This commit is contained in:
9
build.py
9
build.py
@@ -125,6 +125,15 @@ def build_exe(onedir=False, console=False):
|
|||||||
cmd.append("--onefile")
|
cmd.append("--onefile")
|
||||||
if not console:
|
if not console:
|
||||||
cmd.append("--windowed")
|
cmd.append("--windowed")
|
||||||
|
|
||||||
|
# Icon-Pfad festlegen und zur Befehlszeile hinzufügen
|
||||||
|
icon_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "icon.ico")
|
||||||
|
if os.path.exists(icon_path):
|
||||||
|
cmd.extend(["--icon", icon_path])
|
||||||
|
print(f"Icon wird verwendet: {icon_path}")
|
||||||
|
else:
|
||||||
|
print("Warnung: icon.ico wurde nicht gefunden.")
|
||||||
|
|
||||||
if os.path.exists(bin_dir) and os.listdir(bin_dir):
|
if os.path.exists(bin_dir) and os.listdir(bin_dir):
|
||||||
cmd.extend(["--add-data", f"{bin_dir}{os.pathsep}bin"])
|
cmd.extend(["--add-data", f"{bin_dir}{os.pathsep}bin"])
|
||||||
if os.path.exists(presets_dir):
|
if os.path.exists(presets_dir):
|
||||||
|
Reference in New Issue
Block a user