tis-anydesk

6.2.3-1
Connect to a computer remotely, be it from the other end of the office or halfway around the world. AnyDesk ensures secure and reliable remote desktop connections for IT professionals and on-the-go individuals alike.
7070 downloads
Download
default icon

  Description 

  • package : tis-anydesk
  • version : 6.2.3-1
  • architecture : all
  • categories : Utilities
  • maintainer : WAPT Team,Tranquil IT,Bertrand Lemoigne,Gaëtan Segat
  • description : Connect to a computer remotely, be it from the other end of the office or halfway around the world. AnyDesk ensures secure and reliable remote desktop connections for IT professionals and on-the-go individuals alike.
  • locale : all
  • target_os : windows
  • min_wapt_version : 1.7
  • sources : https://anydesk.com/downloads
  • installed_size : 4120576
  • impacted_process : AnyDesk
  • description_fr : Connectez-vous à un ordinateur à distance, que vous soyez de l’autre côté du bureau ou à l’autre bout du monde. AnyDesk garantit aux professionnels de l’informatique comme aux particuliers mobiles des connexions sûres et fiables aux bureaux à distance
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2021-03-10T09:51:53.051072
  • Homepage : https://anydesk.com

  Setup.py 

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

uninstallkey = []

# Installation procedure: https://support.anydesk.com/Automatic_Deployment

# Defining variables
bin_name_sub = 'AnyDesk-%s.exe'
silent_args = '--install "%s\AnyDesk" --silent --remove-first --update-disabled' % programfiles32
app_exe = 'AnyDesk.exe'
app_name = 'AnyDesk'
app_dir = makepath(programfiles32,app_name)
app_bin = makepath(app_dir,app_exe)
app_uninstallkey = app_name
services_to_disable = ['AnyDesk']

def install():
    # Initializing variables
    package_version = control.version.split('-')[0]
    bin_name = bin_name_sub % package_version

    # Installing the package
    print('Installing: %s' % bin_name)
    install_exe_if_needed(bin_name,
        silentflags=silent_args,
        key=app_uninstallkey,
        min_version=package_version)

    create_programs_menu_shortcut(app_name,app_bin)

    # Disabling AnyDesk Services
    for service in services_to_disable:
        if service_installed(service):
            try:
                service_disable(service)
            except:
                print('Unable to disable the service: %s' % service)

    # Avoiding the usage by WAPT of the app built-in Uninstallstring
    uninstallkey.remove(app_uninstallkey)

    
def uninstall():

    print ('Uninstall: %s' % app_name)

    # Initializing variables
    silent_arg = ' --silent --remove'
    # Uninstalling the package
    for uninstall in installed_softwares(uninstallkey=app_uninstallkey):
        killalltasks(app_name)
        print('Uninstalling: %s' % uninstall['name'])
        run_notfatal(('"%s" %s') % (makepath(uninstall['install_location'].split('"')[1], app_exe), silent_arg))
    # Remove latest file
    if not installed_softwares(uninstallkey=app_uninstallkey):
        remove_programs_menu_shortcut(app_name)
        remove_tree(app_dir)

def update_package():
    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    url = 'https://anydesk.com/fr/downloads'
    bin_end = bin_name_sub.split('%s')[-1]

    # Getting latest version from official sources
    print('URL used is: %s' % url)
    for bs_search in bs_find_all(url, 'div', 'class', 'd-block', proxies=proxies):
        if bs_search.text.split('v')[1].split('(')[0]:
            version = bs_search.text.split('v')[1].split(' (')[0]
            latest_bin = bin_name_sub % version
            url_dl = 'https://download.anydesk.com/AnyDesk.exe'
            break

    print("Latest %s version is: %s" % (app_name, version))
    print("Download url is: %s" % url_dl)

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

        # Changing version of the package
        control.version = '%s-%s' % (version, control.version.split('-', 1)[-1])
        control.save_control_to_wapt()
        print("Changing package version to: %s in WAPT\\control" % control.version)

    # Deleting outdated binaries
    remove_outdated_binaries(version)


def get_proxies():
    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():
    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 get_version_from_binary(filename, parameter='ProductVersion'):
    if filename.endswith('.msi'):
        return get_msi_properties(filename)[parameter]
    else:
        return get_file_properties(filename)[parameter]


def remove_outdated_binaries(version, list_extensions=['exe','msi','deb','rpm','dmg','pkg','zip'], list_filename_contain=None):
    if type(list_extensions) != list:
        list_extensions = [list_extensions]
    if list_filename_contain:
        if type(list_filename_contain) != list:
            list_filename_contain = [list_filename_contain]
    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 list_filename_contain:
                for filename_contain in list_filename_contain:
                    if not filename_contain in bin_in_dir:
                        remove_file(bin_in_dir)


def bs_find(url, element, attribute=None, value=None, user_agent=None, proxies=None, features='html.parser', **kwargs):
    """"You may need to use a user agent for some websites.
    Example: user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.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, headers=None, proxies=None, features='html.parser', **kwargs):
    """"You may need to use a header for some websites. For example: headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'}
    """
    import requests
    page = requests.get(url, proxies=proxies, headers=headers, **kwargs).text
    try:
        import bs4 as BeautifulSoup
        soup = BeautifulSoup.BeautifulSoup(page, features=features)
    except:
        import BeautifulSoup
        soup = BeautifulSoup.BeautifulSoup(page)
    if value:
        return soup.findAll(element,{attribute:value})
    else:
        return soup.findAll(element)


def service_disable(service_name):
    """Disabling a service by its service name and stopping it
    """
    import wmi
    c = wmi.WMI()
    for service in c.Win32_Service(Name=service_name):
        service.ChangeStartMode(StartMode="Disabled")
        service.StopService()





										

  Changelog 



Changelog software url : https://download.anydesk.com/changelog.txt



No changelog.txt.
									
  manifest.sha256