tis-greenshot 1.2.10.6-2

  • package : tis-greenshot
  • version : 1.2.10.6-2
  • architecture : all
  • locale :
  • description : Greenshot - Screenshot application
  • maintainer : Tranquil IT Systems
  • date : 2017-09-26 16:43:36
  • min_wapt_version :
  • min_os_version :
  • max_os_version :
  • impacted_process :

setup.py

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

# registry key(s) where WAPT will find how to remove the application(s)
uninstallkey = []

software_name = "Greenshot"

def install():
    print('installing tis-greenshot')
    pe = PackageEntry().load_control_from_wapt ('.')
    software_version = pe.version.split('-',1)[0]
    exe = "Greenshot-INSTALLER-%s-RELEASE.exe" % software_version
    install_exe_if_needed(exe,silentflags='/VERYSILENT /NORESTART /LOADINF="install.inf"',key="Greenshot_is1",min_version=software_version,killbefore="Greenshot.exe")
    ##filecopyto('language-fr-FR.xml', os.path.join(programfiles,'Greenshot','Languages'))

def uninstall():
    killalltasks('Greenshot.exe')
    run(r'"C:\Program Files\Greenshot\unins000.exe" /VERYSILENT')
    remove_tree(os.path.join(programfiles,'Greenshot'))

def update_package():
    import BeautifulSoup,requests,re
    from zipfile import *
    from waptpackage import PackageEntry
    verify=True
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    current_version = pe['version'].split('-',1)[0]

    base_url = "https://github.com/greenshot/greenshot/releases/latest"

    page = requests.get(base_url,headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'},verify=verify).text
    bs = BeautifulSoup.BeautifulSoup(page)
    bs_raw_string = str(bs.find('h1',{'class':'release-title'}).find('a').text)
    software_version = re.findall('Greenshot-RELEASE-(.*)',str(bs_raw_string))[0]

    print "Current %s WAPT package version is : %s" % (software_name,current_version)
    print "Latest %s version available is : %s" % (software_name,software_version)

    if Version(current_version) < Version(software_version):
        print("%s package is not up-to-date, updating" % software_name)
        print("Cleanup current files")

        filename = "Greenshot-INSTALLER-%s-RELEASE.exe" % software_version

        for exe in glob.glob('*.exe'):
            if exe != filename:
                remove_file(exe)

        print("Downloading latest version")
        download_url = 'https://github.com/greenshot/greenshot/releases/download/Greenshot-RELEASE-%s/Greenshot-INSTALLER-%s-RELEASE.exe' % (software_version,software_version)
        wget(download_url,filename)

        pe.version = software_version + '-0'
        pe.save_control_to_wapt(os.getcwd())
    else:
        print("No update needed, package already up to date")


if __name__ == "__main__":
    update_package()
    

Changelog

No changelog
    

manifest.sha256

WAPT/icon.png 05417a4a2a8d3a20390d0da8ffa7d5a82ad93f652d1d380df3f90fc70e516ad3
language-fr-FR.xml 8f62f849e7dbbb63bfabab74e333f4ce373765e386647fe35c18007b7c32351c
WAPT/wapt.psproj 795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b
Greenshot-INSTALLER-1.2.10.6-RELEASE.exe 1687311b4e7a3720be20490e8ed6cc772a32336a7bed8896e475b8ec616c6b81
install.inf 0c0adfbcdb38b75f7085e789e11d92a4f6fcad5129fd15b5cd491250ac5b227a
WAPT/certificate.crt 20f25d6b242159077345379865f8e0d84bdc9e4764190f1aa6cb3816bcabd341
setup.py 178159f5ab4a07157f946f32f6a801d939c5277bfeeb9418b902575886819450
WAPT/control 80ab835240d04227ac4545437631a22a0275005e2add2bd1013ff8c68a336722