tis-ezcast icon

EZCast

Paquet d’installation silencieuse pour EZCast

3.0.0.21-3

  • package: tis-ezcast
  • name: EZCast
  • version: 3.0.0.21-3
  • categories: Media,Drivers
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ,Gaëtan SEGAT
  • editor: Actions Microelectronics
  • licence: Freeware
  • locale: all
  • target_os: windows
  • impacted_process: EZCast,EZCastService
  • architecture: all
  • signature_date:
  • size: 70.42 Mo
  • installed_size: 151.81 Mo
  • homepage : https://www.ezcast.com/

package           : tis-ezcast
version           : 3.0.0.21-3
architecture      : all
section           : base
priority          : optional
name              : EZCast
categories        : Media,Drivers
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ,Gaëtan SEGAT
description       : Forced reboot on install and uninstall - Displays your Windows embedded PC and Notebook wirelessly via EZCast devices or platforms.
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 1.7
sources           : https://www.ezcast.com/app/ezcast/windows
installed_size    : 151805952
impacted_process  : EZCast,EZCastService
description_fr    : Redémarrage forcé à l'installation et à la désinstallation - EZCast permet d’envoyer vers l’écran interactif tactile ou le vidéoprojecteur interactif le contenu de votre tablette (iOS ou Android) ou de votre PC (Windows).
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : Actions Microelectronics
keywords          : cast,ez,ezcast,display,wireless,wirelessly
licence           : Freeware
homepage          : https://www.ezcast.com/
package_uuid      : 5b8be96d-660d-45f8-b919-fb7485becd55
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://www.ezcast.com/release
min_os_version    : 6.1
max_os_version    : 
icon_sha256sum    : cabb90e38d838b6375f25df0b41d3c7023a8fa526eaac32d7c10f0d62ae54c0b
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : NiILKOlKi0o6dy6oJzluKUztvRaP9QslpwuQr8IGbqTZUY1oYbbUYK7mOiU4nuAKSKMaSGv6NecmyZVh+1KQRpEjSPxmjyw/JT65N/LLyyXVz5ztQ9R7MHaLbhYliA0xiHuEor+D+36mWw/O9c79AavAbn6QfXvHtCuFLlt9plGnxqjr/C3xsPSRC8aaA2XXb1rHhVfy/dJ1gk3Bmv7Ev7MMs7P0gY/GsquKTO7TdI1zya8W4MDsX4rFOkStNahcpiqa33/grGBV7B6ckhWvoraP1dnkm3aezTq/5lA1rdSc8DUWvd3FXg4dtHxr1utEAlWSntb5RntL82pzmlddSg==
signature_date    : 2022-04-23T06:00:27.783523
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes

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

# Declaring specific app values (TO CHANGE)
bin_name_string = 'EZCast_Win%s.exe'
silent_args = '/S -var:Reboot=No'
app_uninstallkey = '{74CECDD9-4B8E-4AE3-9571-8070A17F3C34}'
app_exe = ['EZCast.exe', 'EZCastService.exe']


def install():
    # Specific app values
    package_version = control.version.split('-')[0]

    # Getting the used storage on programfiles before installation (place it on the top)
    get_disk_free_space_before = get_disk_free_space(programfiles)

    # Installing the package
    install_exe_if_needed(bin_name_string % package_version
        ,silentflags=silent_args
        ,key=app_uninstallkey
        ,min_version=package_version)

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

    # Return used storage of the program. (place it on the bottom)
    get_disk_free_space_after = get_disk_free_space(programfiles)
    free_space_after_diff = get_disk_free_space_before - get_disk_free_space_after
    print("Storage used: " + str(free_space_after_diff))

def uninstall():
    # Uninstalling the package
    killalltasks(app_exe)
    
    run(r'"%s" /S /norestart' % makepath(install_location(app_uninstallkey),'Uninstall.exe'))


def update_package():
    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    url = "https://www.ezcast.com/app/ezcast/windows"
    bin_end = bin_name_string.split('%s')[-1]
    bin_start = bin_name_string.split('%s')[0]

    # Getting latest version from official sources
    print('URL used is: %s' % url)
    for bs_search in bs_find_all(url, 'a', 'href', 'javascript:void(0);', proxies=proxies):
        url_dl = bs_search['onclick'].split("'")[1]
        if url_dl.endswith(bin_end):
            latest_bin = url_dl.split('/')[-1]
            version = latest_bin.split(bin_start)[-1].split(bin_end)[0]
            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)

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin)
        if version != version_from_file:
            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 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'], 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')
    """
    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)

e455a34a7173e12c7f4a7e7ff8358aa0675da0c39346914f9647cf94d4ca6b1c : setup.py
d042f4d0cc32625d91f1b98a7722e92e084d6ee4fbd7c6edec9c4599bd1ad7d0 : EZCast_Win3.0.0.21.exe
cabb90e38d838b6375f25df0b41d3c7023a8fa526eaac32d7c10f0d62ae54c0b : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
aee743b422c4a07093a9fb8201e63f1cd42e33efc06a94fc4a773570e89826ed : luti.json
a27775ded4c5096eac4cc157192e5d7e4ca6c3ddde7d931f55015216d5f81504 : WAPT/control