Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/10se1ucgo/DisableWinTracking.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuined1 <ruined1@gmail.com>2019-01-30 00:14:42 +0300
committerRuined1 <ruined1@gmail.com>2019-01-30 00:14:42 +0300
commit64ada018771a301e9d9d4eb0dc9f3d6890e74feb (patch)
treef3f0e3460746607eb2e99fc228cae14b3fd0a905 /dwt_util.py
parent5f13d302c0f9d33999b891c1b76c8e0e12cf9576 (diff)
v3.2.23.2.2
A few minor patches, mostly to stop people from reporting invalid issues and to acknowledge success appropriately upon completions. -Implemented a check for OneDrive binary so people stop reporting invalid issues #405 -Modified DiagTrack disable/remove to reflect success when it's Marked for Deletion #406
Diffstat (limited to 'dwt_util.py')
-rw-r--r--dwt_util.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/dwt_util.py b/dwt_util.py
index 33f64f8..4ad1c6f 100644
--- a/dwt_util.py
+++ b/dwt_util.py
@@ -168,7 +168,9 @@ def delete_service(service):
win32serviceutil.RemoveService(service)
logger.info("Services: Succesfully removed service '{service}'".format(service=service))
except pywintypes.error as e:
- errors = (winerror.ERROR_SERVICE_DOES_NOT_EXIST, winerror.ERROR_SERVICE_NOT_ACTIVE)
+ errors = (winerror.ERROR_SERVICE_DOES_NOT_EXIST, \
+ winerror.ERROR_SERVICE_NOT_ACTIVE, \
+ winerror.ERROR_SERVICE_MARKED_FOR_DELETE)
if not any(error == e.winerror for error in errors):
logger.exception("Services: Failed to remove service '{service}'".format(service=service))
@@ -262,14 +264,19 @@ def onedrive(undo):
system = "SysWOW64" if is_64bit() else "System32"
onedrive_setup = os.path.join(os.environ['SYSTEMROOT'], "{system}\\OneDriveSetup.exe".format(system=system))
- cmd = "{bin} /{action}".format(bin=onedrive_setup, action=action)
- output = subprocess_handler(cmd)
- if output[0] == -2147219823:
- logger.info("OneDrive: successfully {action}ed".format(action=action))
+ #Adding check if exe is there to help weed out issue submissions
+ #from users who have somehow previously removed the binary
+ if os.path.isfile(onedrive_setup):
+ cmd = "{bin} /{action}".format(bin=onedrive_setup, action=action)
+
+ output = subprocess_handler(cmd)
+ if output[0] == -2147219813:
+ logger.info("OneDrive: successfully {action}ed".format(action=action))
+ else:
+ logger.info("OneDrive: unable to {action}. Exited with code: {code} - {message}".format(action=action, code=output[0], message=output[1]))
else:
- logger.info("OneDrive: unable to {action}. Exited with code: {code} - {message}".format(action=action, code=output[0], message=output[1]))
-
+ logger.info("OneDrive: Binary doesn't exist. Unable to {action}. Do not send a report for this.".format(action=action))
def set_registry(keys):
mask = winreg.KEY_WOW64_64KEY | winreg.KEY_ALL_ACCESS if is_64bit() else winreg.KEY_ALL_ACCESS