tis-greenshot

1.2.10.6-2
Greenshot - Screenshot application
2916 downloads
Download

  Description 

  • package : tis-greenshot
  • version : 1.2.10.6-2
  • architecture : all
  • categories :
  • maintainer : Tranquil IT Systems
  • description : Greenshot - Screenshot application
  • locale :
  • target_os :
  • min_wapt_version :
  • sources :
  • installed_size :
  • impacted_process :
  • description_fr :
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2020-02-27T21:33:18.977767

  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.txt.
									
  manifest.sha256