tis-rufus 2.17-2

  • package : tis-rufus
  • version : 2.17-2
  • description : Create bootable USB drives the easy way
  • maintainer : Administrateur, Amelie LE JEUNE
  • date : 2017-10-11 11:06:41
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20171011-110641
  • min_os_version :
  • min_wapt_version :

setup.py

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

uninstallkey=[]

destdir = makepath(programfiles32,'Rufus')
exefile = makepath(destdir,'rufus.exe')

def install():
    print('Installing Rufus')
    mkdirs(destdir)
    filecopyto('rufus.exe',exefile)
    create_programs_menu_shortcut('Rufus', exefile)

def uninstall():
    print('Removing Rufus')
    remove_file(exefile)
    remove_tree(destdir)
    remove_programs_menu_shortcut('Rufus')

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]

    software_name = "Rufus"
    software_download_url = "https://rufus.akeo.ie/downloads/rufus.exe"

    pattern=re.compile(r"/downloads/rufus-(.*).exe")

    page = requests.get('https://rufus.akeo.ie',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'},verify=verify).text
    bs = BeautifulSoup.BeautifulSoup(page)

    bs_raw_string = bs.find('a',{'href':pattern}).text
    software_version = re.findall('Rufus (.*)',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 EXE files"

        for exe in glob.glob('*.exe'):
            remove_file(exe)

        print("Downloading latest version")
        wget(software_download_url,"rufus.exe")

        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()




    

manifest

[["WAPT/icon.png", "56ca373142830483af8f1f333d10122864792ad7"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "557e60050809687d56525e6ac46df9c0e02ccae6"], ["setup.py", "a502817b17baa89693551febd5887a6f37fed06f"], ["rufus.exe", "c9ecc59a4dd97b4f07d023258a44983f19b1f18a"], ["WAPT/control", "29d453459952f3f2075194a19b39334d22a2eeaa"]]