tis-qgis-x86 2.18.15-3

  • package : tis-qgis-x86
  • version : 2.18.15-3
  • description : QGIS - SIG Libre et Open Source - x86
  • maintainer : TIS
  • date : 2018-02-27 19:07:15

setup.py

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

uninstallkey = []

short_version = "2.18"
targetdir = makepath(programfiles,'QGIS %s' % short_version)
exename = 'qgis-bin.exe'
uninstall = ('Uninstall-QGIS.exe /S')


def get_qgis_version():
    qgis_reg_version = registry_readstring(HKEY_LOCAL_MACHINE,"SOFTWARE\\QGIS %s" % short_version,"VersionNumber")
    return qgis_reg_version

def remove_qgis():
    print('Uninstalling every previous version of QGIS')
    for items in glob.glob(makepath(programfiles,'QGIS*')):
        run_notfatal('"%s" /S ' %  makepath(programfiles,items,'Uninstall-QGIS.exe'))
        run_notfatal('"%s" /S ' %  makepath(programfiles,items,'uninstall.exe'))
        #remove_tree(makepath(programfiles,items))

    registry_deletekey(HKEY_LOCAL_MACHINE,'SOFTWARE','QGIS %s' % short_version)
    unregister_uninstall('QGIS %s' % short_version)

    for icons in glob.glob(makepath(common_desktop,"QGIS*")):
        remove_tree(icons)

    for items_startmenu in glob.glob(makepath(start_menu(1),"Programs","QGIS*")):
        if isdir(makepath(start_menu(1),"Programs",items_startmenu)):
            remove_tree(makepath(start_menu(1),"Programs",items_startmenu))


def install():
    versionsoft = control['version'].split('-')[0]
    current_qgis_version = get_qgis_version()
    print("Installed version : %s" % current_qgis_version)
    print("Package version : %s" % versionsoft)
    if Version(versionsoft) != Version(current_qgis_version):
        print("QGIS %s needs to be updated" % current_qgis_version)
        remove_qgis()
        killalltasks(exename)
        time.sleep(20)
        print('installing tis-qgis-osgeo4w-%s' % versionsoft)
        run('"QGIS-OSGeo4W-%s-1-Setup-x86.exe" /S' % versionsoft)
        print('Installation finished, waiting for shortcuts to populate')
        time.sleep(20)
    else:
        print("QGIS %s already up-to-date, skipping install" % current_qgis_version)


def uninstall():
    versionsoft = control['version'].split('-')[0]
    print('uninstalling tis-qgis-osgeo4w-%s-1-setup-x86' % versionsoft)
    killalltasks(exename)
    remove_qgis()






    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "e18db709c36dd19c4815b7832587119de232543c42c32133926d5d36eebbf00a"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"], ["QGIS-OSGeo4W-2.18.15-1-Setup-x86.exe", "a9776c0b29bf7eeb84a22ba098470b565684e59972ea8feb35cbcab8da671cb3"], ["setup.py", "e556a21d41ad03b32448a33cdee8f981211ee3d25168f371b6769d21c6829340"], ["WAPT/control", "716d3bb5a52b03168e0d4154644cd76ecf45318a201acf6f220e0081914b7ec1"]]