From 01264d8fa047f3771d7c8512b8a9118e7da94389 Mon Sep 17 00:00:00 2001 From: Dee Jayh Date: Tue, 23 Jan 2018 14:54:44 -0500 Subject: -Fixed unhandled return code in DiagTrack service removal -Fixed DWT to automatically call for elevation instead of bailing out --- README.md | 5 +++++ dwt.py | 11 +---------- dwt_about.py | 2 +- dwt_util.py | 4 +++- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 76eafee..da08a33 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,11 @@ A tool that I created to use some of the known methods of disabling tracking in ![screenshot](http://i.imgur.com/WINUxAj.png) +## CYRILLIC LANGUAGES WARNING +**Slavic languages: Belarusian, Bulgarian, Macedonian, Russian, Rusyn, Serbo-Croatian (for Standard Serbian, Bosnian, and Montenegrin), Ukrainian.** + +This program cannot run correctly from a file path that contains Cyrillic characters. Make sure to run it from your root folder (usually C:) so that you don't get runtime errors. + ## DOWNLOAD [DOWNLOAD EXE HERE](https://github.com/10se1ucgo/DisableWinTracking/releases/) diff --git a/dwt.py b/dwt.py index 048e23f..87ab79d 100644 --- a/dwt.py +++ b/dwt.py @@ -460,16 +460,7 @@ def exception_hook(error, value, trace): def check_elevated(silent=False): if not bool(windll.advpack.IsNTAdmin(0, None)): - if not silent: - warn = wx.MessageDialog(parent=None, - message="Program requires elevation, please run it as an administrator.", - caption="ERROR!", style=wx.OK | wx.ICON_WARNING) - warn.ShowModal() - warn.Destroy() - else: - logger.info("You didn't run DWT as administrator. Don't bother posting an issue.") - logger.info("Please re-run as administrator.") - sys.exit(1) + windll.shell32.ShellExecuteW(None, u"runas", unicode(sys.executable), unicode(__file__), None, 1) def silent(): diff --git a/dwt_about.py b/dwt_about.py index 4e8337d..fe1dd45 100644 --- a/dwt_about.py +++ b/dwt_about.py @@ -26,7 +26,7 @@ import wx import wx.adv import wx.lib.scrolledpanel as sp -__version__ = "3.2.0" +__version__ = "3.2.1" def about_dialog(parent): diff --git a/dwt_util.py b/dwt_util.py index 656f80b..9ff098e 100644 --- a/dwt_util.py +++ b/dwt_util.py @@ -105,7 +105,7 @@ def clear_diagtrack(): output = subprocess_handler(cmd) - if output[0] in [0, 1060]: + if output[0] in [0, 1060, 1072]: if output[0] == 0: if len(service) > 1: logger.info("DiagTrack: Successfully deleted service '{0}'".format(service[1])) @@ -113,6 +113,8 @@ def clear_diagtrack(): logger.info("DiagTrack: Successfully erased tracking log.") if output[0] == 1060: logger.info("DiagTrack: {0} service doesn't exist. This is OK, you likely removed it already.".format(service[1])) + if output[0] == 1072: + logger.info("DiagTrack: {0} service marked for deletion. This is OK, make sure you reboot your machine!".format(service[1])) logger.info("DiagTrack: Completed Part {0}/{1}".format(i, len(cmds))) else: -- cgit v1.2.3