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

Remove Windows Desktop files on uninstall

This commit is contained in:
Dummerle 2021-05-12 11:45:10 +02:00
parent 97704851ac
commit 5a6a8fc1e7

View file

@ -61,6 +61,12 @@ def uninstall(app_name: str, core: LegendaryCore, options=None):
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"))
elif os.name == "nt":
if os.path.exists(os.path.expanduser(f"~/Desktop/{igame.title.split(':')[0]}.lnk")):
os.remove(os.path.expanduser(f"~/Desktop/{igame.title.split(':')[0]}.lnk"))
elif os.path.exists(os.path.expandvars(f"%appdata%/Microsoft/Windows/Start Menu/{igame.title.split(':')[0]}.lnk")):
os.remove(os.path.expandvars(f"%appdata%/Microsoft/Windows/Start Menu/{igame.title.split(':')[0]}.lnk"))
try:
# Remove DLC first so directory is empty when game uninstall runs
dlcs = core.get_dlc_for_game(app_name)