tis-winscp 5.11.2-2

  • package : tis-winscp
  • version : 5.11.2-2
  • description : Client SCP sous Windows
  • maintainer : blog.lesfourmisduweb.org
  • date : 2018-02-27 19:09:27

setup.py

#!/usr/bin/python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
#    This file is part of WAPT
#    Copyright (C) 2013  Tranquil IT Systems http://www.tranquil.it
#    WAPT aims to help Windows systems administrators to deploy
#    setup and update applications on users PC.
#
#    WAPT is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    WAPT is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with WAPT.  If not, see <http://www.gnu.org/licenses/>.
#
# -----------------------------------------------------------------------
from setuphelpers import *

uninstallkey = []

def install():

    versionpaquet = control['version'].split('-',1)[0]
    install_exe_if_needed('WinSCP-%s-Setup.exe' % versionpaquet ,silentflags='/VERYSILENT /NORES64RT /LOADINF=winscp.ini',key='winscp3_is1',min_version=versionpaquet,killbefore=['Winscp.exe'])
    remove_desktop_shortcut('WinSCP')


def uninstall():
    run('"%s" /VERYSILENT /NORESTART' % makepath(install_location('winscp3_is1'),'unins000.exe'))







def update_package():
    import requests
    htmlSource = wgets("https://winscp.net/eng/download.php").splitlines()
    for line in htmlSource :
        if '<h3>WinSCP' in line :
            realversion = line[line.find("<h3>WinSCP") + 11 :line.find("</h3>")]
            filename = 'WinSCP-' + realversion + '-Setup.exe'
            link = 'https://winscp.net/download/'+ filename
            htmlSource2 = wgets(link).splitlines()
            for line2 in htmlSource2 :
                if 'https://winscp.net/download/files/' in line2 :
                    reallink = line2[line2.find("href=") + 6 :line2.find("'>[Direct download]")]
                    wget(reallink, filename)
                    break
            break

    if not isfile(filename):
        wget(reallink, filename)

    exes = glob.glob('*.exe')
    for fn in exes:
        if fn != filename:
            remove_file(fn)

    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    pe.version = realversion+'-0'
    pe.save_control_to_wapt(os.getcwd())

    print('The update is complete, you can now test and then launch a build upload.')

if __name__ == '__main__':
    update_package()
    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "8edd03e1a538bbc854bad524ce33289880b95618b8af9cd0ac9d77ae0f6f560a"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"], ["winscp.ini", "866f1daa8c514cea3bca6054f6dde5d9ba01be6609d0174401a9acc8dc823408"], ["WinSCP-5.11.2-Setup.exe", "84d3e95575939b88cfe57242b07b52662aaeea833ba2b67218ca498a0fe93ec0"], ["setup.py", "097dd3230c25e34d41e7c45841c5bcc31fbe6e5fb88d919c51e93a6b8e9626ea"], ["WAPT/control", "051258d221ebd1479632c9c95e669deef498df2be301ee2aeb8d87b12f02db70"]]