tis-putty 0.70-1

  • package : tis-putty
  • version : 0.70-1
  • description : Putty ssh client
  • maintainer : Simon Fonteneau
  • date : 2017-09-26 18:52:32
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170926-185232
  • 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 winshell
import time
import os

uninstallkey=[]

software_name = "PuTTy"

def remove_putty_if_install_with_exe():
    if uninstall_key_exists('PuTTY_is1'):
        killalltasks('putty.exe')
        #uninstaller cannot be silenced by design (cf putty.iss), so we remove stuff by hand
        #run('"%s" /VERYSILENT /SUPPRESSMSGBOXES' % os.path.join(programfiles32,'putty','unins000.exe'))
        if isdir(install_location('PuTTY_is1')):
            remove_tree(install_location('PuTTY_is1'))
        registry_delete(HKEY_LOCAL_MACHINE,'SOFTWARE\Classes\PuTTYPrivateKey',None)
        if iswin64():
            registry_delete(HKEY_LOCAL_MACHINE,'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\PuTTY_is1',None)
        else:
            registry_delete(HKEY_LOCAL_MACHINE,'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PuTTY_is1',None)
        putty_link = makepath(winshell.programs(common=1),'PuTTY')
        if isdir(putty_link):
            remove_tree(putty_link)
        unregister_uninstall('Putty_is1')


def install():
    remove_putty_if_install_with_exe()
    versionsoft = control['version'].split('-',1)[0]
    if iswin64():
        install_msi_if_needed('putty-64bit-%s-installer.msi' % versionsoft,min_version=versionsoft,killbefore=['putty.exe'])
    else:
        install_msi_if_needed('putty-%s-installer.msi' % versionsoft,min_version=versionsoft,killbefore=['putty.exe'])


def update_package():
    import BeautifulSoup,requests,re
    from waptpackage import PackageEntry
    verify=True
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    current_version = pe['version'].split('-',1)[0]

    base_url = "https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html"

    page = requests.get(base_url,headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'},verify=verify).text
    bs = BeautifulSoup.BeautifulSoup(page)
    bs_raw_string = str(bs.find('h1'))
    software_version = str(bs_raw_string[bs_raw_string.find("(")+1:bs_raw_string.find(")")])

    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 files")

        filename = "putty-%s-installer.msi" % software_version
        filename64 = "putty-64bit-%s-installer.msi" % software_version

        for msi in glob.glob('*.msi'):
            if msi not in {filename,filename64}:
                remove_file(msi)

        print("Downloading latest version")
        download_url = 'https://the.earth.li/~sgtatham/putty/latest/w32/putty-%s-installer.msi' % software_version
        download_url64 = 'https://the.earth.li/~sgtatham/putty/latest/w64/putty-64bit-%s-installer.msi' % software_version
        wget(download_url,filename)
        wget(download_url64,filename64)

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


    

manifest

Couldn't retrieve manifest.