From 30adc04461f4869310ec284d08cb7a69eaa7d5f1 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 17 Dec 2018 10:27:37 +0100 Subject: [PATCH] Remove some leftovers and simplify setup.py --- WAPT/control | 8 ++++---- setup.py | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/WAPT/control b/WAPT/control index 7ecc147..de3b6aa 100644 --- a/WAPT/control +++ b/WAPT/control @@ -1,5 +1,5 @@ package : fws-remove-fwsupdates -version : 3 +version : 7 architecture : all section : base priority : optional @@ -7,7 +7,7 @@ maintainer : Daniel Berteaud description : Remove FWSUpdates depends : conflicts : -maturity : DEV +maturity : PROD locale : all target_os : windows min_os_version : 5.0 @@ -16,11 +16,11 @@ min_wapt_version : 1.5 sources : installed_size : impacted_process : -description_fr : +description_fr : Suppression de FWSUpdates description_pl : description_de : description_es : -audit_schedule : 4w +audit_schedule : 2d editor : keywords : licence : diff --git a/setup.py b/setup.py index 0ea3406..ebc9b43 100644 --- a/setup.py +++ b/setup.py @@ -5,15 +5,16 @@ uninstallkey = [] def install(): print('Shutdown scripts') - remove_shutdown_script(r'fwsupdates.vbs','') - remove_shutdown_script(r'wpkg.bat','') + for file in ['fwsupdates.vbs','wpkg.bat']: + remove_shutdown_script(file,'') + remove_file(makepath(system32,'GroupPolicy', 'Machine', 'Scripts', 'Shutdown', file)) print('Removing start menu entries') - if isfile(makepath(os.getenv('ALLUSERSPROFILE'),'Microsoft','Windows','Start Menu','Programs','Startup','chkupd_bgmon.vbs')): - try: - remove_file(makepath(os.getenv('ALLUSERSPROFILE'),'Microsoft','Windows','Start Menu','Programs','Startup','chkupd_bgmon.vbs')) - except: - delete_at_next_reboot(makepath(os.getenv('ALLUSERSPROFILE'),'Microsoft','Windows','Start Menu','Programs','Startup','chkupd_bgmon.vbs')) + remove_file(makepath(start_menu(common=1),'Programs','Startup','chkupd_bgmon.vbs')) + remove_programs_menu_shortcut('FWS Updates') + + print('Removing desktop shortcut') + remove_desktop_shortcut('FWS Updates') print('Removing %s' % makepath(os.getenv('SYSTEMDRIVE','C:'),'FWSUpdates')) if isdir(makepath(os.getenv('SYSTEMDRIVE','C:'),'FWSUpdates')): @@ -22,9 +23,6 @@ def install(): except: delete_at_next_reboot(makepath(os.getenv('SYSTEMDRIVE','C:'),'FWSUpdates')) - print('Removing desktop shortcut') - remove_desktop_shortcut('FWS Updates') - print('Removing registry entries') for reg in ['FWSUpdates','iPasserelle']: if reg_key_exists(HKEY_LOCAL_MACHINE,r'SOFTWARE\%s' % reg): @@ -34,6 +32,10 @@ def install(): if task_exists('sync_wpkg'): delete_task('sync_wpkg') +def session_setup(): + print('Removing FWS UPdates desktop shortcut') + remove_user_desktop_shortcut('FWS Updates') + def audit(): for reg in ['FWSUpdates','iPasserelle']: if reg_key_exists(HKEY_LOCAL_MACHINE,r'SOFTWARE\%s' % reg):