Skip to content

Commit

Permalink
Added additional exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Molanda committed Sep 27, 2022
1 parent 5d4a4b5 commit 89f9e15
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions SetupThereEdge/SetupThereEdge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 89f9e15

Please sign in to comment.