Remove Windows Desktop files on uninstall
This commit is contained in:
parent
97704851ac
commit
5a6a8fc1e7
1 changed files with 6 additions and 0 deletions
|
@ -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")):
|
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"))
|
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:
|
try:
|
||||||
# Remove DLC first so directory is empty when game uninstall runs
|
# Remove DLC first so directory is empty when game uninstall runs
|
||||||
dlcs = core.get_dlc_for_game(app_name)
|
dlcs = core.get_dlc_for_game(app_name)
|
||||||
|
|
Loading…
Reference in a new issue