Properly launch games on Windows

This commit is contained in:
kramo
2023-03-20 19:29:55 +01:00
parent 149c417901
commit 921968bec3
3 changed files with 22 additions and 4 deletions

View File

@@ -129,7 +129,11 @@ def heroic_parser(parent_widget, action):
values["name"] = game["title"]
values["developer"] = game["developer"]
values["executable"] = "xdg-open heroic://launch/" + app_name
values["executable"] = (
"start heroic://launch/" + app_name
if os.name == "nt"
else "xdg-open heroic://launch/" + app_name
)
values["hidden"] = False
values["source"] = "heroic_epic"
values["added"] = current_time
@@ -189,7 +193,11 @@ def heroic_parser(parent_widget, action):
save_cover(values, parent_widget, image_path)
break
values["executable"] = "xdg-open heroic://launch/" + app_name
values["executable"] = (
"start heroic://launch/" + app_name
if os.name == "nt"
else "xdg-open heroic://launch/" + app_name
)
values["hidden"] = False
values["source"] = "heroic_gog"
values["added"] = current_time
@@ -220,7 +228,11 @@ def heroic_parser(parent_widget, action):
continue
values["name"] = item["title"]
values["executable"] = "xdg-open heroic://launch/" + app_name
values["executable"] = (
"start heroic://launch/" + app_name
if os.name == "nt"
else "xdg-open heroic://launch/" + app_name
)
values["hidden"] = False
values["source"] = "heroic_sideload"
values["added"] = current_time

View File

@@ -28,6 +28,8 @@ def run_command(executable):
subprocess.Popen(
["flatpak-spawn --host " + executable]
if os.getenv("FLATPAK_ID") == "hu.kramo.Cartridges"
else executable.split()
if os.name == "nt"
else [executable],
shell=True,
start_new_session=True,

View File

@@ -63,7 +63,11 @@ def get_game(task, datatypes, current_time, parent_widget, appmanifest, steam_di
task.return_value(None)
return
values["executable"] = "xdg-open steam://rungameid/" + values["appid"]
values["executable"] = (
"start steam://rungameid/" + values["appid"]
if os.name == "nt"
else "xdg-open steam://rungameid/" + values["appid"]
)
values["hidden"] = False
values["source"] = "steam"
values["added"] = current_time