Launcher: fix shortcuts on the AppImage (#5726)

* fix appimage executable reference

* adjust working dir

* use argv0 instead of appimage directly

* set noexe on frozen
This commit is contained in:
Silvris
2025-12-14 20:30:07 -06:00
committed by GitHub
parent 577b958c4d
commit 51d5e1afae

View File

@@ -218,12 +218,17 @@ def launch(exe, in_terminal=False):
def create_shortcut(button: Any, component: Component) -> None:
from pyshortcuts import make_shortcut
script = sys.argv[0]
wkdir = Utils.local_path()
env = os.environ
if "APPIMAGE" in env:
script = env["ARGV0"]
wkdir = None # defaults to ~ on Linux
else:
script = sys.argv[0]
wkdir = Utils.local_path()
script = f"{script} \"{component.display_name}\""
make_shortcut(script, name=f"Archipelago {component.display_name}", icon=local_path("data", "icon.ico"),
startmenu=False, terminal=False, working_dir=wkdir)
startmenu=False, terminal=False, working_dir=wkdir, noexe=Utils.is_frozen())
button.menu.dismiss()