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 : 2018-02-27 19:07:53

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




    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "631e63108d20a0639769a0d46b231fdc83d713b74b54f0c44e0d57c9f56eac19"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"], ["setup.py", "450880b12674979ef83337d8b255d82d76a9e8d4ba9e30ee44d7a19e3d056c5e"], ["rufus.exe", "260fbc40c09d3c175a62b94d9df1a8c5ccb017a69c8c50bfe9aaeb1df1f45ff6"], ["WAPT/control", "aff0d734d612f766cf33a2e3360420e70de21d2c4260923ff7137812a417ed1a"]]