tis-removebloat 6

  • package : tis-removebloat
  • version : 6
  • architecture : all
  • locale :
  • description : Retire les bloatwares
  • maintainer : Tranquil-IT-Systems
  • date : 2018-02-27 19:07:24
  • min_wapt_version :
  • min_os_version :
  • max_os_version :
  • impacted_process :

setup.py

# -*- coding: utf-8 -*-
from setuphelpers import *
import re

uninstallkey = []

# re: regular match for soft name
# key:  exact match for uninstallkey
# run: provide direct command for uninstall
# metro: remove a metro app with powershell
# str or list : keywords in key and/or name

# tuple : (search,process_to_kill,title)

# look to http://www.shouldiremoveit.com/oems-bloatware.aspx for information about bloatwares

crapwares = [
    're:ask toolbar',
    'key:TFTPUtil',
    'key:CCleaner',
    ('key:{7DB9F1E5-9ACB-410D-A7DC-7A3D023CE045}','welcome.exe','Dell Getting Started Guide'),
    ('key:{2290A680-4083-410A-ADCC-7092C67FC052}','topi.exe','Toshiba Online Product Information'),
    'Intel Security True Key',
    'Amazon Cloud Player',
    'Fire.fm',
    'StumbleUpon',
    'VTzilla',
    'Complitly',
 ]

def find_soft_re(softs,pattern):
    return [s for s in softs if pattern.findall(s['name'])]

def find_soft_keywords(softs,keywords):
    def check_words(target,words):
        mywords = target.lower()
        result = not words or mywords
        for w in words:
            result = result and w in mywords
        return result

    return [s for s in softs if check_words(s['key'] + ' '+ s['name'],keywords)]

def install():
    ########## Paquet qui ne peut pas être utilisé tel que !
    error(u"""Ce paquet doit être personnalisé.
            Retirer cette ligne quand vous avez rempli la liste 'crapwares' ci-dessus
            avec les critères de recherche appropriés (clé, mots clé, expression régulière...)
            """)

    all_softs = installed_softwares()

    for crapware in crapwares:
        # split if processes to kill is supplied too
        if  isinstance(crapware,tuple):
            if len(crapware) == 3:
                (crapware,to_kill,title) = crapware
            elif len(crapware) == 2:
                (crapware,to_kill) = crapware
                title = crapware
        else:
            to_kill = None
            title = crapware

        run = None
        if isinstance(crapware,re._pattern_type):
            uninstall_entries = find_soft_re(all_softs,crapware)
        elif isinstance(crapware,(unicode,str)) and crapware.startswith('re:'):
            uninstall_entries = find_soft_re(all_softs,re.compile(crapware[3:],re.IGNORECASE))
        elif isinstance(crapware,(unicode,str)) and crapware.startswith('key:'):
            uninstall_entries = [s for s in all_softs if s['key'] == crapware[4:]]
        elif isinstance(crapware,(unicode,str)) and crapware.startswith('run:'):
            uninstall_entries = []
            run = crapware[4:]
            # check if command exists


        else:
            if isinstance(crapware,(str,unicode)):
                mykeywords = crapware.lower().split()
            else:
                mykeywords = [ ensure_unicode(k).lower() for k in crapware ]
            uninstall_entries = find_soft_keywords(all_softs,mykeywords)

        if uninstall_entries or run:
            print('Processing removal of %s '%(title,))
            if to_kill:
                print('  Killing processes %s' % (to_kill,))
                killalltasks(to_kill)

            for uninstall in uninstall_entries:
                cmd = WAPT.uninstall_cmd(uninstall['key'])
                print(u'  Uninstalling %s' % (uninstall['name'],))
                print run_notfatal(cmd)

            if run:
                print(u'  Launching %s' % (run,))
                print run_notfatal(run)


    

Changelog

No changelog
    

manifest.sha256

setup.py a42707a9c4a0cebd66a998ed47d6ba7670e0fb31d3256c9af4cf58ef91f39bdd
WAPT/certificate.crt 79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4
WAPT/wapt.psproj b1ce3b4267b131b7829ec336eb3e9847d5f1942db81473f4c37d83f390d9ff37
WAPT/control 74d11dd182eae70923590dd7bef1516740c4d2edcc7de23e5bdc948af0c83e4d