From 6c1c7f6b1a18d3bdf65570f09be98da786a3657f Mon Sep 17 00:00:00 2001 From: Heuze Florent Date: Tue, 9 Feb 2021 14:07:12 +0100 Subject: [PATCH] Add functions to disable Thunderbird Update (purge reg key when uninstall) --- setup.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index c7386b8..6240315 100644 --- a/setup.py +++ b/setup.py @@ -138,15 +138,21 @@ if __name__ == '__main__': def uninstall(): + print('uninstalling %s' % control.asrequirement()) + + for thunderbird in installed_softwares('Mozilla Thunderbird'): + print('Uninstalling %s' % thunderbird['version']) + run(uninstall_cmd(thunderbird['key'])) + print('Removing registry entries') - for reg in ['DisableAppUpdate','DisableTelemetry']: - if reg_key_exists(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Mozilla\Thunderbird\%s' % reg): - run(r'reg delete "HKLM\SOFTWARE\Policies\Mozilla\Thunderbird\%s" /va /f' % reg) - return "ERROR : Can't remove registry entries" + run(r'reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Thunderbird" /v "DisableAppUpdate" /f') + run(r'reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Thunderbird" /v "DisableTelemetry" /f') + def audit(): for reg in ['DisableAppUpdate','DisableTelemetry']: - if reg_key_exists(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Mozilla\%s' % reg): - print(r'Key HKLM\%s exists' % reg_key) - return "ERROR : Keys is missing, for disable Thunderbird update" \ No newline at end of file + 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