tis-filezilla 3.27.1-13

  • package : tis-filezilla
  • version : 3.27.1-13
  • description : Client FTP Filezilla (limited to V3.8 for XP)
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2017-10-11 11:03:53
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20171011-110353
  • min_os_version :
  • min_wapt_version :

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 *
import platform
uninstallkey=['FileZilla Client']

def install():
    versionsoft = control['version'].split('-',1)[0]
    exe = 'FileZilla_%s_win32-setup.exe' % versionsoft

    if platform.win32_ver()[0]=='XP' or platform.win32_ver()[0]=='2003Server':
        #3.8.0 is the last supported version on winXP
        install_exe_if_needed('WinXP_FileZilla_3.8.0_win32-setup.exe','/S',key='FileZilla Client',min_version='3.8.0',killbefore='filezilla.exe')
    else:
        # for win Vista and above
        install_exe_if_needed(exe,'/S',key='FileZilla Client',min_version=versionsoft,killbefore='filezilla.exe')
    # disable auto update
    filecopyto('fzdefaults.xml',os.path.join(programfiles32,'FileZilla FTP Client'))


def update_package():
    """updates the package / control version with the latest stable firefox version"""
    import re,requests,urlparse,glob

    # get index of all dowloads
    """
    #url_base = 'https://download-installer.cdn.mozilla.net/pub/firefox/releases/latest/win32/de/'
    url_base = 'https://download-installer.cdn.mozilla.net/pub/firefox/releases/43.0/win32/de/'
    index = wgets(url_base)

    # get list of lastest german versions
    re_setup = re.compile(r'<a href=".*/(Firefox%20Setup%20[0-9.]*.exe)">Firefox Setup .*</a>')
    filename = urlparse.unquote(re_setup.findall(index)[0])
    url = url_base+filename
    """
##    url = requests.head('https://filezilla-project.org/download.php?type=client').headers['Location']
##    filename = urlparse.unquote(url.rsplit('/',1)[1])

    import re,requests,BeautifulSoup
    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())

    page = requests.get('https://filezilla-project.org/download.php?show_all=1',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'}).text
    pattern=re.compile(r"win32-setup.exe")
    bs = BeautifulSoup.BeautifulSoup(page)

    current_version = pe['version'].split('-',1)[0]
    filezilla_exe = str(bs.find('a',text=pattern))
    filezilla_version = re.findall('FileZilla_(.*)\_win32-setup.exe',str(filezilla_exe))[0]

    print "Current Filezilla WAPT package version is : %s" % current_version
    print "Latest Filezilla version is  is : %s" % filezilla_version

    wget_url = "http://10gbps-io.dl.sourceforge.net/project/filezilla/FileZilla_Client/%s/FileZilla_%s_win32-setup.exe" % (filezilla_version,filezilla_version)

    # updates control version from filename, increment package version.
    control = PackageEntry().load_control_from_wapt ('.')
    control.version = '%s-%s' % (filezilla_version,int(control.version.split('-',1)[1])+1)
    control.save_control_to_wapt('.')

    if not isfile(filezilla_exe):
        print('Downloading %s from %s'%(filezilla_exe,wget_url))
        wget(wget_url,filezilla_exe)
        # removes old exe
        if isfile(filezilla_exe):
            exes = glob.glob('Filezilla*.exe')
            for fn in exes:
                if fn != filezilla_exe:
                    remove_file(fn)
    else:
        print("Latest version already downloaded, skip download")

if __name__ == '__main__':
    update_package()

    

manifest

[["WAPT/icon.png", "d5a5102f01469aee0298405bf9f60ac6c5cc56ef"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WinXP_FileZilla_3.8.0_win32-setup.exe", "987bcc105770de7a1093d559dd84bbb9ecab3a9d"], ["WAPT/wapt.psproj", "557e60050809687d56525e6ac46df9c0e02ccae6"], ["fzdefaults.xml", "ce285fe432c9fda43c49dd29a021d75b878e2e38"], ["FileZilla_3.27.1_win32-setup.exe", "d68cfa54aa4bdc98cfba93f36ab7b3e30237a3a8"], ["setup.py", "cbaece49dd4b9511181e247eb1347aa8148b40e2"], ["WAPT/control", "ca8ff07aa10f38698fa7a8f87b0da346b66bb77d"]]