tis-opensc

0.19.0-1
OpenSC smartcard framework
1689 downloads
Download
default icon

  Description 

  • package : tis-opensc
  • version : 0.19.0-1
  • architecture : all
  • categories : Drivers
  • maintainer : WAPT Team,Jimmy PELÉ
  • description : OpenSC smartcard framework
  • locale :
  • target_os : windows
  • min_wapt_version : 1.5
  • sources : https://github.com/OpenSC/OpenSC/releases
  • installed_size : 75423744
  • impacted_process : pkcs11-tool.exe,certutil.exe,opensc-notify.exe,opensc-tool.exe
  • description_fr :
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence : LGPL
  • signature_date : 2020-02-27T21:38:30.362383

  Setup.py 

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

uninstallkey = []

# Declaring specific app values (TO CHANGE)
bin_name_string_x64 = 'OpenSC-win64_%s.msi'
bin_name_string_x86 = 'OpenSC-win32_%s.msi'


def install():
    print('installing %s' % control.asrequirement())

    # Specific app values
    package_version = control.version.split('-',1)[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_msi_if_needed(bin_name_string_x86 % package_version
        ,min_version=package_version)

    if iswin64():
        install_msi_if_needed(bin_name_string_x64 % package_version
            ,min_version=package_version)

	# 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 update_package():
    print('Download/Update package content from upstream binary sources')
    import json

    # Getting proxy informations from WAPT settings
    proxy = {}
    if isfile(makepath(application_data(),'waptconsole','waptconsole.ini')):
        proxywapt = inifile_readstring(makepath(user_local_appdata(),'waptconsole','waptconsole.ini'),'global','http_proxy')
        if proxywapt :
            proxy = {'http':proxywapt,'https':proxywapt}

    # Specific app values
    app_name = control.name
    url_api = 'https://api.github.com/repos/OpenSC/OpenSC/releases/latest'

    # Getting latest informations from Github API
    json_load = json.loads(wgets(url_api,proxies=proxy))
    for download in json_load:
        version = json_load['tag_name']
        break

    latest_bin_x64 = bin_name_string_x64 % version
    latest_bin_x86 = bin_name_string_x86 % version
    url_dl_x64 = 'https://github.com/OpenSC/OpenSC/releases/download/' + version + '/' + latest_bin_x64
    url_dl_x86 = 'https://github.com/OpenSC/OpenSC/releases/download/' + version + '/' + latest_bin_x86

    print('Latest ' + app_name + ' version is: ' + version)

    # Downloading latest binaries
    if not isfile(latest_bin_x64):
        print('Downloading: ' + latest_bin_x64)
        wget(url_dl_x64,latest_bin_x64,proxies=proxy)

    if not isfile(latest_bin_x86):
        print('Downloading: ' + latest_bin_x86)
        wget(url_dl_x86,latest_bin_x86,proxies=proxy)

		# Change version of the package
        print('Writing ' + version + '-0 in WAPT\\control')
        from waptpackage import PackageEntry
        pe = PackageEntry()
        pe.load_control_from_wapt(os.getcwd())

        pe.version = version + '-0'
        pe.save_control_to_wapt(os.getcwd())
        print('Update package done. You can now build-upload your package')
    else:
        print('This package is already up-to-date')

    # Deleting outdated binaries
    for bin_in_dir in glob.glob('*.msi'):
        if bin_in_dir != latest_bin_x64 and bin_in_dir != latest_bin_x86:
            print('Outdated binary: ' + bin_in_dir + ' Deleted')
            remove_file(bin_in_dir)


if __name__ == '__main__':
    update_package()


										

  Changelog 



https://github.com/OpenSC/OpenSC/wiki#news
									
  manifest.sha256