From 385177c61ee1e1356f435b037088b914a52b6a88 Mon Sep 17 00:00:00 2001 From: Heuze Florent Date: Tue, 9 Feb 2021 15:04:13 +0100 Subject: [PATCH] Add function for audit --- setup.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index ca41ec7..2b7baa5 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ import subprocess uninstallkey = [] + def on_dist_backup(operation,src,dst): # When we backup the distribution dir, we have to exclude # lightning as a new version will be installed, bundled with TB itself. @@ -151,7 +152,11 @@ def uninstall(): def audit(): for reg in ['DisableAppUpdate','DisableTelemetry']: - if reg_key_exists(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Mozilla\Thunderbird\DisableAppUpdate'): - print(r'Key HKLM\SOFTWARE\Policies\Mozilla\Thunderbird\%s exists' % reg) - else: - print('ERROR : Keys is missing for disable update !') \ No newline at end of file + if not registry_readstring(HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Mozilla\Thunderbird\%s' % reg): + print(r'Warning : SOFTWARE\Policies\Mozilla\Thunderbird\%s is missing !' % reg) + return "WARNING" + + value = registry_readstring(HKEY_LOCAL_MACHINE, r'SOFTWARE\Policies\Mozilla\Thunderbird\%s' % reg) + if value != "1" : + print("Warning : Thunderbird update is not disable !") + return "WARNING" \ No newline at end of file