tis-plantronics-hub

3.22.53245.32743-2
Plantronics Hub is a client application that allows users to control the settings on their Plantronics audio device.
7903 downloads
Download
tis-plantronics-hub icon

  Description 

  • package : tis-plantronics-hub
  • version : 3.22.53245.32743-2
  • architecture : all
  • categories : Drivers,Utilities
  • maintainer : WAPT Team, Tranquil IT, Jimmy PELÉ
  • description : Plantronics Hub is a client application that allows users to control the settings on their Plantronics audio device.
  • locale : all
  • target_os : windows
  • min_wapt_version : 1.8
  • sources : https://www.poly.com/us/en/support/downloads-apps/hub-desktop
  • installed_size :
  • impacted_process : PLTHub, SpokesUpdateService, CsrDfu, PlantronicsLync2013COM
  • description_fr : Plantronics Hub est une application client permettant aux utilisateurs finaux de contrôler les paramètres de leur périphérique audio Plantronics.
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor : Plantronics, Inc.
  • licence : Freeware
  • signature_date : 2021-06-24T11:47:58.382652
  • Homepage : https://www.poly.com/

  Setup.py 

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

uninstallkey = []

# Defining variables
bin_name_string = 'PlantronicsHubInstaller_%s.exe'
bin_temp = 'PlantronicsHubInstaller.exe'
silent_args = '/install /quiet /norestart'
app_uninstallkey = ''


def install():
    # Initializing variables
    package_version = control.version.split('-',1)[0]
    bin_name = bin_name_string % 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)


def uninstall():
    # Uninstalling the package
    for uninstall in installed_softwares(name="Plantronics Hub Software"):
        print('Removing: %s' % (uninstall['name']))
        run(uninstall_cmd(uninstall['key']))
    for uninstall in installed_softwares(name="OldMHUUninstallerMSI"):
        print('Removing: %s' % (uninstall['name']))
        run(uninstall_cmd(uninstall['key']))
        break
    for uninstall in installed_softwares(name="OldMHUUninstaller"):
        print('Removing: %s' % (uninstall['name']))
        run(uninstall_cmd(uninstall['key']))
        break


def update_package():
    print('Downloading/Updating package content from upstream binary sources')

    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()

    app_name = control.name
    url = control.sources

    # Getting latest version from official website
    latest_bin = bin_temp
    url_dl = 'https://www.poly.com/content/dam/www/software/PlantronicsHubInstaller.exe'

    #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)

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin)
        os.rename(latest_bin,bin_name_string % version_from_file)
        version = version_from_file

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

    # Deleting outdated binaries
    remove_outdated_binaries(version)




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


def get_version_from_binary(filename):
    if filename.endswith('.msi'):
        return get_msi_properties(filename)['ProductVersion']
    else:
        return get_file_properties(filename)['ProductVersion']


def get_version_from_binary(filename):
    if filename.endswith('.msi'):
        return get_msi_properties(filename)['ProductVersion']
    else:
        return get_file_properties(filename)['ProductVersion']


def remove_outdated_binaries(version, list_extensions=['exe','msi','deb','rpm','dmg','pkg'], 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, 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.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 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

										
  manifest.sha256