1
0
Fork 0
mirror of synced 2024-06-26 10:11:19 +12:00

Remove desktop link on uninstall

This commit is contained in:
Dummerle 2021-05-01 11:17:18 +02:00
parent c98d91c7c0
commit 14c1dbf19c

View file

@ -49,10 +49,18 @@ def launch_game(core, app_name: str, offline: bool = False, skip_version_check:
return process, params
def uninstall(app_name: str, core, options=None):
def uninstall(app_name: str, core: LegendaryCore, options=None):
if not options:
options = {"keep_files": False}
igame = core.get_installed_game(app_name)
# remove shortcuts link
if os.name == "posix":
if os.path.exists(os.path.expanduser(f"~/Desktop/{igame.title}.desktop")):
os.remove(os.path.expanduser(f"~/Desktop/{igame.title}.desktop"))
if os.path.exists(os.path.expanduser(f"~/.local/share/applications/{igame.title}.desktop")):
os.remove(os.path.expanduser(f"~/.local/share/applications/{igame.title}.desktop"))
try:
# Remove DLC first so directory is empty when game uninstall runs
dlcs = core.get_dlc_for_game(app_name)