tis-paint.net 4.0.17-1

  • package : tis-paint.net
  • version : 4.0.17-1
  • description : Paint.NET Setup 32/64
  • maintainer : Simon Fonteneau
  • date : 2017-10-11 11:06:24
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20171011-110623
  • min_os_version :
  • min_wapt_version :
  • Depends :

setup.py

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

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

def install():
    if iswin64():
         install_msi_if_needed('PaintDotNet_x64.msi',killbefore=['PaintDotNet.exe'])
    else:
         install_msi_if_needed('PaintDotNet_x86.msi',killbefore=['PaintDotNet.exe'])
    remove_desktop_shortcut('paint.net')

def update_package():
    import BeautifulSoup,requests,re
    from zipfile import *
    from waptpackage import PackageEntry

    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    current_version = pe['version'].split('-',1)[0]

    currentpath = os.path.dirname(os.path.realpath(__file__))

    page = requests.get('http://www.getpaint.net/index.html',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'},verify=False).text
    bs = BeautifulSoup.BeautifulSoup(page)

    paintdotnet_raw = str(bs.find('a',{'href':'download.html#download'}).find('font').find('b').text)
    paintdotnet_version = re.findall('paint.net \r\n\t\t\t\t\t\t(.*)',str(paintdotnet_raw))[0]

    print "Current Paint.NET WAPT package version is : %s" % current_version
    print "Latest Paint.NET version available is : %s" % paintdotnet_version

    if current_version < paintdotnet_version:
        print("Paint.NET package is not up-to-date, updating")
        print("Cleanup current MSI files")

        for msi in glob.glob('*.msi'):
            vers = get_msi_properties(msi)['ProductVersion']
            if  vers != paintdotnet_version :
                remove_file(msi)

        if not isfile('PaintDotNet_x64.msi'):
            print("Downloading latest version")
            wget('http://www.dotpdn.com/files/paint.net.%s.install.zip' % paintdotnet_version, 'paintnet.zip')

            zip = ZipFile('paintnet.zip')
            zip.extractall(path='paintfolder')
            zip.close()
            remove_file('paintnet.zip')

            print("Extracting MSIs from exe installer")
            run(makepath('paintfolder','paint.net.%s.install.exe' % paintdotnet_version) + " /createmsi")
            remove_tree('paintfolder')

            msipaint = glob.glob(makepath(desktop(),'PaintDotNetMsi','*.msi'))
            for paint in msipaint :
                filecopyto(paint,currentpath)

            os.chdir(os.path.dirname(__file__))

            pe.version = paintdotnet_version + '-0'
            pe.save_control_to_wapt(os.getcwd())

            remove_tree(makepath(desktop(),'PaintDotNetMsi'))
    else:
        print("No update needed, package already up to date")

if __name__== "__main__" :
    update_package()
    

manifest

[["WAPT/icon.png", "171263995b91144c10c85de550699c3242532e9e"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "557e60050809687d56525e6ac46df9c0e02ccae6"], ["PaintDotNet_x86.msi", "93fb754ab944e77e81e4e58db9cbadb9e3786828"], ["PaintDotNet_x64.msi", "57569ed8c84673fa953ef836e3b1a8a1c31ce593"], ["setup.py", "cf286b3438fa3eef5eecb57569bbaaf285bc97cb"], ["WAPT/control", "a0e54b0cab55d7d283eda5c9a739e5540c70ce6d"]]