tis-driver-store-explorer

0.11.79-5
Driver Store Explorer [RAPR] makes it easier to deal with Windows driver store. Supported operations include list/add/install/delete third-party driver packages.
44 downloads
Download
View on luti logo
tis-driver-store-explorer icon

  Description 

  • package : tis-driver-store-explorer
  • version : 0.11.79-5
  • architecture : all
  • categories : Utilities,System and network
  • maintainer : WAPT Team,Tranquil IT,Gaëtan SEGAT,Jimmy PELÉ
  • description : Driver Store Explorer [RAPR] makes it easier to deal with Windows driver store. Supported operations include list/add/install/delete third-party driver packages.
  • locale : all
  • target_os : windows
  • min_wapt_version : 1.7
  • sources : https://github.com/lostindark/DriverStoreExplorer/releases/latest
  • installed_size : 2539520
  • impacted_process : Rapr
  • description_fr : Driver Store Explorer [RAPR] facilite la gestion du magasin de pilotes Windows. Les opérations prises en charge incluent la liste/l'ajout/l'installation/la suppression de packages de pilotes tiers.
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence : GLPv2
  • signature_date : 2022-04-12T12:01:59.811175
  • Homepage : https://github.com/lostindark/DriverStoreExplorer
  • Depends :

  Setup.py 

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

uninstallkey = []

# Defining variables
bin_name_sub = 'DriverStoreExplorer.v%s.zip'
app_uninstallkey = 'Driver Store Explorer'
app_dir = makepath(programfiles32, 'Driver Store Explorer')
app_bin_path = makepath(app_dir, 'Rapr.exe')


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

    # Getting installed version
    if isfile(app_bin_path):
        installed_version = get_version_from_binary(app_name)
    else :
        installed_version = ''

    # Installing the package
    print("Installing: %s" % app_name)
    if installed_version < package_version:
        killalltasks(impacted_process_list)
        if isdir(app_dir):
            remove_tree(app_dir)
        mkdirs(app_dir)
        print("Extracting: %s to: %s " % (bin_name, app_dir))
        unzip(bin_name, app_dir)
        create_programs_menu_shortcut(app_name, app_bin_path)

        # Adding the package to the "list-registry"
        register_windows_uninstall(control) # control is a PackageEntry object corresponding to the package
    else:
        print("%s portable is already installed in the correct version" % app_name)


def uninstall():
    # Initializing variables
    impacted_process_list = control.version.split(',')
    app_name = control.name

    # Uninstalling the package
    print("Uninstalling: %s" % app_name)
    killalltasks(impacted_process_list)
    if isdir(app_dir):
        remove_tree(app_dir)
    unregister_uninstall(app_uninstallkey)
    remove_programs_menu_shortcut(app_name)


def audit():
    # Initializing variables
    package_version = control.version.split('-')[0]
    app_version = get_version_from_binary(app_bin_path)

    if isdir(app_dir):
        if package_version == app_version:
            print("OK: Folder exists: %s" % app_dir)
            return "OK"
    else:
        print("ERROR: Folder not exists: %s" % app_dir)
        return "ERROR"


def update_package():
    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    git_repo = 'lostindark/DriverStoreExplorer'
    url_api = 'https://api.github.com/repos/%s/releases/latest' % git_repo
    bin_start = bin_name_sub.split('%s')[0]

    # Getting latest version from official sources
    print("API used is: %s" % url_api)
    json_load = json.loads(wgets(url_api,proxies=proxies))

    for download in json_load['assets']:
        if download['name'].startswith(bin_start):
            url_dl = download['browser_download_url']
            break

    version = json_load['tag_name'].replace('v','')
    latest_bin = bin_name_sub % version

    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():
    import platform
    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)



										

  Changelog 



Changelog software url : https://github.com/lostindark/DriverStoreExplorer/releases



No changelog.txt.
									
  manifest.sha256