diff --git a/SetupThereEdge/SetupThereEdge.py b/SetupThereEdge/SetupThereEdge.py index 9478f01..cd65129 100644 --- a/SetupThereEdge/SetupThereEdge.py +++ b/SetupThereEdge/SetupThereEdge.py @@ -108,11 +108,15 @@ print('The shortcuts were created successfully.') if args.clean: count = 0 - paths = [ - os.path.join(os.path.abspath(args.path), 'ThereEdge.exe'), - os.path.join(shell.SHGetFolderPath(0, shellcon.CSIDL_PROGRAMS, 0, 0), 'There', 'There (Edge).lnk'), - os.path.join(shell.SHGetFolderPath(0, shellcon.CSIDL_DESKTOP, 0, 0), 'There (Edge).lnk'), - ] + paths = [os.path.join(os.path.abspath(args.path), 'ThereEdge.exe')] + try: + paths.append(os.path.join(shell.SHGetFolderPath(0, shellcon.CSIDL_PROGRAMS, 0, 0), 'There', 'There (Edge).lnk')) + except Exception: + pass + try: + paths.append(os.path.join(shell.SHGetFolderPath(0, shellcon.CSIDL_DESKTOP, 0, 0), 'There (Edge).lnk')) + except Exception: + pass for path in paths: if os.path.isfile(path): os.remove(path)