tis-paint.net 4.0.21-2

  • package : tis-paint.net
  • version : 4.0.21-2
  • description : automatic package for Paint.NET Setup
  • maintainer : Simon Fonteneau
  • date : 2018-02-27 19:41:30
  • Depends :

setup.py

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

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

""" You can do a CTRL F9 in pyscripter to update the package """

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

""" You can do a CTRL F9 in pyscripter to update the package """














def update_package():

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

    """I retrieve the current version from the official site >>>"""
    htmlSource = wgets("http://www.getpaint.net/roadmap.html").splitlines()
    for line in htmlSource :
        if 'released' in line :
            if 'paint.net' in line :
                start = line.find("paint.net")
                startversion = start + 10
                end = line.find("</strong>")
                realversion = line[startversion:end]
                break

    """
    I list all the msi file of the package and test the msi version
    if the version returned by the msi does not correspond to the previous one, I delete the file
    >>>
    """

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

    """I download the file if it does not exist >>>"""
    if not isfile('PaintDotNet_x64.msi'):
        wget('http://www.dotpdn.com/files/paint.net.%s.install.zip' % realversion, 'paintnet.zip')


        """Unzip file >>>"""
        unzip('paintnet.zip','paintfolder')

        """Delete zip >>>"""
        remove_file('paintnet.zip')

        """Run create Msi >>>"""
        run(makepath('paintfolder','paint.net.%s.install.exe' % realversion) + " /createmsi")

        """Delete Folder >>>"""
        remove_tree('paintfolder')

        """Copy msi file in wapt package >>>"""
        msipaint = glob.glob(makepath(desktop(),'PaintDotNetMsi','*.msi'))
        for paint in msipaint :
            filecopyto(paint,currentpath)

    """I write the version in the control file >>>"""

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

    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())

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

    """Clean folder on desktop >>>"""

    remove_tree(makepath(desktop(),'PaintDotNetMsi'))


if __name__== "__main__" :
    update_package()
    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "18aa44d2d96b35d91a3a1664ea558a56b7afcc5d590c2124a2175d65f1a836b0"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "6ced6d42441ea2be5dab71026935e7cce930ae4a6c5e1cf5e03686153e435726"], ["PaintDotNet_x86.msi", "0a800bdc8ae5c6b402dddb0787919638e0f8ce6342dce7c41acbcc06ee399324"], ["PaintDotNet_x64.msi", "76001d0edcde2ac4e819b653d4c6aa6b100c322ed8f976fed39c46c7ab553f57"], ["setup.py", "065f5bc478a02804b3fe2da38306fbac02b79a9ede54dc9d55133f5923b80e59"], ["WAPT/control", "d3d9ea5e9d088d7382faa1094e5fbc8e5fc3392dcbce65ce2e064829b6dc1d0f"]]