1
0
Fork 0
mirror of synced 2024-06-02 10:44:40 +12:00

Fixed bug at launch game

This commit is contained in:
Dummerle 2021-04-14 14:30:36 +02:00
parent b13cbe24de
commit 933c7c7c58
3 changed files with 11 additions and 10 deletions

View file

@ -99,7 +99,7 @@ jobs:
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: rare.deb
file: Rare.deb
asset_name: Rare.deb
tag: ${{ github.ref }}
overwrite: true

View file

@ -36,7 +36,7 @@ class BaseInstalledWidget(QGroupBox):
launch.triggered.connect(self.launch)
self.addAction(launch)
if os.path.exists(os.path.expanduser(f"~/Desktop/{self.igame.title}.desktop"))\
if os.path.exists(os.path.expanduser(f"~/Desktop/{self.igame.title}.desktop")) \
or os.path.exists(os.path.expanduser(f"~/Desktop/{self.igame.title}.lnk")):
self.create_desktop = QAction(self.tr("Remove Desktop link"))
else:
@ -65,7 +65,7 @@ class BaseInstalledWidget(QGroupBox):
path = os.path.expanduser("~/.local/share/applications/")
else:
return
if not (os.path.exists(os.path.expanduser(f"{path}{self.igame.title}.desktop"))\
if not (os.path.exists(os.path.expanduser(f"{path}{self.igame.title}.desktop")) \
or os.path.exists(os.path.expanduser(f"{path}{self.igame.title}.lnk"))):
create_desktop_link(self.igame.app_name, self.core, type_of_link)
if type_of_link == "desktop":
@ -90,8 +90,13 @@ class BaseInstalledWidget(QGroupBox):
logger.info("Cancel Startup")
return 1
logger.info("Launching " + self.igame.title)
self.proc, params = legendary_utils.launch_game(self.core, self.igame.app_name, offline,
skip_version_check=skip_version_check)
try:
self.proc, params = legendary_utils.launch_game(self.core, self.igame.app_name, offline,
skip_version_check=skip_version_check)
except Exception as e:
logger.error(e)
return
if not self.proc:
logger.error("Could not start process")
return 1

View file

@ -36,11 +36,7 @@ def launch_game(core, app_name: str, offline: bool = False, skip_version_check:
if latest.build_version != game.version:
print("Please update game")
return None
try:
params, cwd, env = core.get_launch_parameters(app_name=app_name, offline=offline)
except Exception as e:
logger.error(e)
return 1
params, cwd, env = core.get_launch_parameters(app_name=app_name, offline=offline)
process = QProcess()
process.setWorkingDirectory(cwd)