Skip to content

Commit

Permalink
made a uninstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-cool08 committed Jan 2, 2023
1 parent aef2dbc commit 72dfa5f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
Binary file removed hembrev v50.docx
Binary file not shown.
Binary file removed requirements.txt
Binary file not shown.
Binary file removed test.exe
Binary file not shown.
13 changes: 0 additions & 13 deletions test.py

This file was deleted.

16 changes: 14 additions & 2 deletions uninstall.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


import winshell
import os, shutil
user = os.getlogin()
folder = fr'C:\Users\{user}\AppData\Roaming\hembrev'
Expand All @@ -11,4 +11,16 @@
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exception as e:
print('Failed to delete %s. Reason: %s' % (file_path, e))
print('Failed to delete %s. Reason: %s' % (file_path, e))
folder = fr'C:/Users/{user}/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/hembrev'
for filename in os.listdir(folder):
file_path = os.path.join(folder, filename)
try:
if os.path.isfile(file_path) or os.path.islink(file_path):
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exception as e:
print('Failed to delete %s. Reason: %s' % (file_path, e))
desktop = winshell.desktop()
os.remove(f"{desktop}\hembrev.ink")

0 comments on commit 72dfa5f

Please sign in to comment.