tis-geogebra 5.0.385.0-1

  • package : tis-geogebra
  • version : 5.0.385.0-1
  • description : La calculatrice graphique pour les Fonctions, la Geometrie, l'Algebre, le Calcul Differentiel, les Statistiques et la 3D !
  • maintainer : Tranquil it systems
  • date : 2017-09-13 10:19:03
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170913-101902
  • min_os_version :
  • min_wapt_version :
  • Depends :

setup.py

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

uninstallkey = []

""" You can do a CTRL F9 in pyscripter to update the package """

def install():
    softname = 'GeoGebra'
    versionsoft = control['version'].split('-',1)[0]
    fileversion = versionsoft.replace('.','-')

    check_installed = installed_softwares(softname)
    if check_installed:
             for uninstall in check_installed:
                   if Version(uninstall['version']) < Version(versionsoft) :
                         print(u'remove old software')
                         killalltasks("javaw.exe")
                         cmd = WAPT.uninstall_cmd(uninstall['key'])
                         run(cmd)
                         time.sleep(5)

    install_msi_if_needed('GeoGebra-Windows-Installer-%s.msi' % fileversion,killbefore=['javaw.exe'], properties={'ALLUSERS':2})
    remove_desktop_shortcut('GeoGebra')

""" You can do a CTRL F9 in pyscripter to update the package """


def update_package():

    import urllib2
    import requests
    import ssl

    """I retrieve the current version from the official site >>>"""
    versionfile = wgets("http://download.geogebra.org/installers/5.0/version.txt")
    realversion = versionfile.replace('-','.')
    print('Latest Version : ' + realversion)

    """I write the version in the control file >>>"""

    os.chdir(os.path.dirname(__file__))

    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())

    pe.version = realversion + '-0'
    pe.save_control_to_wapt(os.getcwd())

    """
    I list all the msi file of the package and test the msi version
    if the version returned by the msi does not correspond to the previous one, I delete the file
    >>>
    """

    allmsi = glob.glob('*.msi')
    for msi in allmsi:
            vers = get_msi_properties(msi)['ProductVersion']
            if  vers != realversion :
                remove_file(msi)

    """I download the file if it does not exist >>>"""
    if not isfile('GeoGebra-Windows-Installer-%s.msi' % versionfile) :
        wget('http://download.geogebra.org/installers/5.0/GeoGebra-Windows-Installer-%s.msi' % (versionfile),os.getcwd())

    print('The update is complete, you can now test and then launch a build upload.')

if __name__ == '__main__':
    update_package()



    

manifest

[["WAPT/icon.png", "c0f60008814571c50c18cfb45978c207cfc1160b"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "7ccbe65afd42ee7794a86ed74eef48e3f5812c93"], ["GeoGebra-Windows-Installer-5-0-385-0.msi", "cf22260c5b094eeafdc4cf71ef6b4d8fa60cd014"], ["setup.py", "001e0867265de138c4c7f8bcc56ac6b3755ac020"], ["WAPT/control", "3cf0a54f930ae4a82a49f54552f605bb2537ce63"]]