tis-ccleaner

5.85.9170-24
CCleaner is a computer utility program used to clean potentially unwanted files (including temporary internet files, where malicious programs and code tend to reside) and invalid Windows Registry entries from a computer, originally supporting Microsoft Windows only.
75087 downloads
Download
tis-ccleaner icon

  Description 

  • package : tis-ccleaner
  • version : 5.85.9170-24
  • architecture : all
  • categories : Utilities,System and network
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : CCleaner is a computer utility program used to clean potentially unwanted files (including temporary internet files, where malicious programs and code tend to reside) and invalid Windows Registry entries from a computer, originally supporting Microsoft Windows only.
  • locale : all
  • target_os : windows
  • min_wapt_version : 1.7
  • sources : https://www.ccleaner.com/ccleaner/builds
  • installed_size : 53272576
  • impacted_process : CCleaner64,CCleaner,CCUpdate
  • description_fr : CCleaner (abréviation de Crap Cleaner) est un gratuiciel permettant d'optimiser le fonctionnement d'un ordinateur muni du système d'exploitation Windows. Il supprime les fichiers et les enregistrements inutiles, ce qui permet à l'ordinateur de fonctionner plus rapidement et libère de l'espace sur les périphériques de stockage (disques durs ou SSD).
  • description_pl : CCleaner (dawniej Crap Cleaner) – opracowany przez firmę Piriform program narzędziowy na licencji freemium służący między innymi do oczyszczania komputera z niepotrzebnych plików i nieprawidłowych wpisów rejestru systemu Windows.
  • description_de : CCleaner (früherer Name Crap Cleaner) ist ein kostenloses Programm zur Optimierung für die Betriebssysteme Windows, macOS und Android. Windows wird ab Windows XP auf 32- und 64-Bit-Systemen unterstützt.
  • description_es : CCleaner (anteriormente Crap Cleaner)​ es una aplicación gratuita, de código cerrado, que tiene como propósito mejorar el rendimiento de cualquier equipo que ejecute Microsoft Windows mediante la eliminación de los archivos innecesarios y las entradas inválidas del registro de Windows.
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Piriform
  • licence : Freemium
  • signature_date : 2021-09-23T11:19:13.809153
  • Homepage : https://www.ccleaner.com

  Setup.py 

# -*- coding: utf-8 -*-
from setuphelpers import *
import platform
import bs4 as BeautifulSoup

"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
sub_bin_name = 'ccsetup_%s_slim.exe'
silent_inst_arg = '/S'
uninstall_key = 'CCleaner'
app_path = makepath(programfiles,'CCleaner')
conf_file_path = makepath(programfiles,'CCleaner','ccleaner.ini')
schtasks_to_disable = [r'\CCleaner Update',r'\CCleanerSkipUAC']
list_recycle_bin_context_menu = ['Exécuter CCleaner','Ouvrir CCleaner...','Run CCleaner','Open CCleaner...']


def install():
    # Initializing variables
    package_version = control.version.split('-')[0]
    bin_name = sub_bin_name % package_version
    package_version_split = package_version.split('.')
    short_package_version = '%s.%s' % (package_version_split[0],package_version_split[1])
    app_name = control.name

    # Installing the package
    print('Installing: %s' % bin_name)
    install_exe_if_needed(bin_name,
        silentflags=silent_inst_arg,
        key=uninstall_key,
        min_version=short_package_version)

    # Removing Shortcut
    remove_desktop_shortcut(app_name)

    # Disabling CCleaner Scheduled Tasks
    for task in schtasks_to_disable:
        if task_exists(task):
            try:
                disable_task(task)
            except:
                print('Unable to disable the task: %s' % task)

    # Removing global configuration file
    if isfile(conf_file_path):
        remove_file(conf_file_path)

    # Disable CCleaner Telemetry
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)QuickClean','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)QuickCleanIpm','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)SoftwareUpdater','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)SoftwareUpdaterIpm','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)GetIpmForTrial','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)HealthCheck','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)HealthCheckCommentsConfused','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)HealthCheckCommentsDislike','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)HealthCheckCommentsHate','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)HealthCheckCommentsLike','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)HealthCheckCommentsLove','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)HealthCheckCommentsOkay','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)HealthCheckIpm','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)HealthCheckVersion','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)AlphaIntegration','0')
    registry_set(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)TrialOnboarding','0')

    # Remove CCleaner from Recycle Bin context menu
    for menu in list_recycle_bin_context_menu:
        if reg_key_exists(HKEY_LOCAL_MACHINE,r'SOFTWARE\Classes\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\%s' % menu):
            registry_deletekey(HKEY_LOCAL_MACHINE,r'SOFTWARE\Classes\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\%s\command' % menu, '',force=True)
            registry_deletekey(HKEY_LOCAL_MACHINE,r'SOFTWARE\Classes\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shell\%s' % menu, '',force=True)

    """ # Removing CCleaner Spying values in machine registry # Not recommended
    registry_delete(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)LastUpdate')
    registry_delete(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)TTL')
    registry_delete(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)TTL-Spread')
    registry_delete(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)TTL-Spread')
    registry_delete(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','GD')
    registry_delete(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)ABTestingNames')
    registry_delete(HKEY_LOCAL_MACHINE,r'SOFTWARE\Piriform\CCleaner','(Cfg)ccst-prev-001') """

    """ # No longer using global parameters since it do not work properly with non-admin users
    inifile_writestring(conf_file_path,'Options','RunICS','0')
    inifile_writestring(conf_file_path,'Options','Monitoring','0')
    inifile_writestring(conf_file_path,'Options','SystemMonitoring','0')
    inifile_writestring(conf_file_path,'Options','CheckTrialOffer','0')
    inifile_writestring(conf_file_path,'Options','SystemMonitoringRunningNotification','0')
    inifile_writestring(conf_file_path,'Options','HelpImproveCCleaner','0')
    inifile_writestring(conf_file_path,'Options','PrefsPrivacyShowOffers1stParty','0')
    inifile_writestring(conf_file_path,'Options','DelayTemp','0')
    inifile_writestring(conf_file_path,'Options','HideWarnings','1')
    inifile_writestring(conf_file_path,'Options','UpdateAuto','0')
    inifile_writestring(conf_file_path,'Options','UpdateNotify','0')
    inifile_writestring(conf_file_path,'Options','UpdateCheck','0')
    inifile_writestring(conf_file_path,'Options','DefaultDetailedView','2')
    inifile_writestring(conf_file_path,'Options','ShowCleanWarning','False')
    inifile_writestring(conf_file_path,'Options','JumplistTasks','1')
    inifile_writestring(conf_file_path,'Options','SkipUAC','1')
    inifile_writestring(conf_file_path,'Options','BackupPrompt','0') """


def session_setup():
    print("Configuring: minimum intrusion and base parameters")

    # Language part
    lang_code_string = '%s' % get_language_code()
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','Language',lang_code_string)

    # Telemetry part
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','AutoICS','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','CheckTrialOffer','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','Monitoring','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','HelpImproveCCleaner','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','SystemMonitoring','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','UpdateAuto','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','UpdateCheck','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','UpdateNotify','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','RunICS','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','SystemMonitoring','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','PrefsPrivacyShowOffers1stParty','0')
    if reg_value_exists(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','Brandover'):
        registry_delete(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','Brandover')
    if reg_value_exists(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','CookiesToSave'):
        cookies_saved = registry_readstring(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','CookiesToSave')
        if '*.avast.com|*.ccleaner.com|*.ccleanercloud.com' in cookies_saved:
            cookies_saved = cookies_saved.replace('*.avast.com|*.ccleaner.com|*.ccleanercloud.com','')
            if cookies_saved.startswith('|'):
                cookies_saved = cookies_saved[1:]
            registry_setstring(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','CookiesToSave',cookies_saved)

    # CCleaner part
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','BackupPrompt','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','DefaultDetailedView','2')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','ShowCleanWarning','False')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','ShowCookiesCleanWarning','False')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','ShowGoogleChromeCleanWarning','False')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','ShowSpotifyCleanSuspendedWarning','False')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','DelayTemp','0')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','HideWarnings','1')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','SkipUAC','1')
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','HideWarnings','1')
    #registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','JumplistTasks','1')

    # Applications part, you may add what you need here
    registry_set(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','(App)Game Explorer','True')

    """ # Removing CCleaner Spying values in user registry # Not recommended
    registry_delete(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','UpdateKey')
    registry_delete(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','NewVersion')
    registry_delete(HKEY_CURRENT_USER,r'SOFTWARE\Piriform\CCleaner','LatestICS') """


def update_package():
    # Declaring local variables
    result = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    url = 'https://www.ccleaner.com/fr-fr/ccleaner/builds'

    # Getting latest version from official sources
    print("URL used is: %s" % url)
    for bs_search in bs_find_all(url, 'h3', proxies=proxies):
        version = bs_search.string.split('(Version ')[-1].split(') - Version')[0]
        latest_bin = sub_bin_name % version
        download_url = 'https://bits.avcdn.net/productfamily_CCLEANER/insttype_SLIM/platform_WIN_PIR/installertype_ONLINE/build_RELEASE'
        break

    print("Latest %s version is: %s" % (app_name, version))
    print("Download URL is: %s" % download_url)

    # Downloading latest binaries
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies)

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin)
        if not version.startswith((version_from_file).split('.0')[0]) and version_from_file != '':
            print("Changing version to the version number of the binary (from: %s to: %s)" % (version, version_from_file))
            os.rename(latest_bin, sub_bin_name % version_from_file)
            version = version_from_file
        else:
            print("Binary file version correspond to online version")

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        result = True
    control.version = '%s-%s' % (Version(version), control.version.split('-', 1)[-1])
    #control.set_software_version(version)
    control.save_control_to_wapt()

    # Deleting outdated binaries
    remove_outdated_binaries(version)

    # Validating or not update-package-sources
    return result




def get_proxies():
    r"""Return system proxy with the urllib python library

    >>> get_proxies()
    {'http': 'http://srvproxy.ad.domain.lan:8080',
    'https': 'http://srvproxy.ad.domain.lan:8080'}

    """
    if platform.python_version_tuple()[0] == '3':
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()


def get_proxies_from_wapt_console():
    r"""Return proxy information from the current user WAPT console

    >>> get_proxies_from_wapt_console()
    {'http': 'http://srvproxy.ad.domain.lan:8080',
    'https': 'http://srvproxy.ad.domain.lan:8080'}

    """
    proxies = {}
    if platform.system() == 'Windows':
        waptconsole_ini_path = makepath(user_local_appdata(), 'waptconsole', 'waptconsole.ini')
    else:
        waptconsole_ini_path = makepath(user_home_directory(), '.config', 'waptconsole', 'waptconsole.ini')
    if isfile(waptconsole_ini_path):
        proxy_wapt = inifile_readstring(waptconsole_ini_path, 'global', 'http_proxy')
        if proxy_wapt:
            proxies = {'http': proxy_wapt, 'https': proxy_wapt}
    return proxies


def bs_find(url, element, attribute=None, value=None, user_agent=None, proxies=None, features='html.parser', **kwargs):
    r""""Parse html web page with BeautifulSoup and get the first result

    Args:
        url (str): url of the web page to parse
        element (str): searched element
        attribute (str): selected attribute of the element
        value (str): value of the selected attribute
        user_agent (str): specify a user-agent if needed
        proxies (dict): specify your proxy if needed
        **kwargs (str): joker for requests parameters
        features (str): bs feature to use


    >>> bs_find('https://www.w3.org/', 'a', 'title', 'Open Web Platform testing')['href']
    'https://web-platform-tests.org/'

    >>> bs_find('https://www.w3.org/', 'span', 'class', 'alt-logo').string
    'W3C'

    .. versionadded:: 2.0

    """
    import requests
    if user_agent:
        page = requests.get(url, proxies=proxies, headers={'User-Agent':'%s' % user_agent}, **kwargs).text
    else:
        page = requests.get(url, proxies=proxies, **kwargs).text
    soup = BeautifulSoup.BeautifulSoup(page, features=features)
    if value:
        return soup.find(element, {attribute: value})
    else:
        return soup.find(element)


def bs_find_all(url, element, attribute=None, value=None, user_agent=None, proxies=None, features='html.parser', **kwargs):
    r""""Parse html web page with BeautifulSoup and get a list of the result

    Args:
        url (str): url of the web page to parse
        element (str): searched element
        attribute (str): selected attribute of the element
        value (str): value of the selected attribute
        user_agent (str): specify a user-agent if needed
        proxies (dict): specify your proxy if needed
        **kwargs (str): joker for requests parameters
        features (str): bs feature to use


    >>> bs_find_all('https://www.w3.org/', 'a', 'title', 'Open Web Platform testing')[0]['href']
    'https://web-platform-tests.org/'

    >>> bs_find_all('https://www.w3.org/', 'span', 'class', 'alt-logo')[0].string
    'W3C'

    .. versionadded:: 2.0

    """
    import requests
    if user_agent:
        page = requests.get(url, proxies=proxies, headers={'User-Agent':'%s' % user_agent}, **kwargs).text
    else:
        page = requests.get(url, proxies=proxies, **kwargs).text
    soup = BeautifulSoup.BeautifulSoup(page, features=features)
    if value:
        return soup.find_all(element, {attribute:value})
    else:
        return soup.find_all(element)


def get_version_from_binary(filename, property_name='ProductVersion'):
    r""" Get installer version from file informations, for now, only exe and msi files are compatibles

    Args:
        filename (str): path to the file
        property_name (str): selected property

    Returns:
        str: version number

     """
    if filename.endswith('.msi'):
        return get_msi_properties(filename)[property_name]
    else:
        return get_file_properties(filename)[property_name]


def remove_outdated_binaries(version, filename_contains=None, list_extensions=['exe','msi','deb','rpm','dmg','pkg']):
    r"""Remove files based on the version contained in his filename

    Args:
        version (str): version number of keeped files
        filename_contains (str or list of str): Part of the filename that must be contained (useful for distinguishing architecture and os)
        list_extensions (str or list of str): file extensions of verified files

    Returns:
        None

    .. versionadded:: 2.0

    """
    if type(list_extensions) != list:
        list_extensions = [list_extensions]
    if filename_contains:
        if type(filename_contains) != list:
            filename_contains = [filename_contains]
    list_extensions = ['.' + ext for ext in list_extensions if ext[0] != '.']
    for file_ext in list_extensions:
        for bin_in_dir in glob.glob('*%s' % file_ext):
            if not version in bin_in_dir:
                remove_file(bin_in_dir)
            if filename_contains:
                for filename_contain in filename_contains:
                    if not filename_contain in bin_in_dir:
                        remove_file(bin_in_dir)


										

  Changelog 



Changelog software url : https://www.ccleaner.com/ccleaner/version-history



No changelog.txt.
									
  manifest.sha256