Détails du package smp-putty_0.72-1_all.wapt
retour Revenir à la liste des packages

smp-putty

ATTENTION CE DÉPÔT n'est plus compatible 1.3 vous devez migrer en 1.5.1.21 !

Fichier control :

package           : smp-putty
version           : 0.72-1
architecture      : all
section           : base
priority          : optional
name              : 
categories        : 
maintainer        : blog.lesfourmisduweb.org
description       : Putty ssh client
depends           : 
conflicts         : 
maturity          : 
locale            : 
target_os         : 
min_os_version    : 
max_os_version    : 
min_wapt_version  : 
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : 1432f1b1-b560-4b25-9570-094c5f406fd7
valid_from        : 
valid_until       : 
forced_install_on : 
signer            : wapt.lesfourmisduweb.org
signer_fingerprint: 8da83ebdac1a25e820b186510d049f47407b11835b0664fdc5bacd3595b1671d
signature         : Wwd0YZasfvrQgWbEDIs0RRrljpEH6QbL0wzMPUfLsGMUkohC4KV65QGM9laVOSA6RbwGtH5MQyibMfPFZoY+Kfr8eM30tQUFGKhvFIZ+tPg3UBXLp1XRnQfue5UNefM2lQlg8+ciZzQWfgoJ9wCg77vnBilTmTFXeVs4D/nNccDY8+DUm6OmGZdHA7oJtGpi3nrutt3YIJid5WR9hgDfewxS2fD6FO6HsGTeuZG1rk83mxui3Ojidppz/IwWaeHfvJyqXM5tSt8w1xd0M5SlhR7HtINQUkEyxBJnj8POosO0riV+UHTE2cb57+J5BGzKLAlHnhJeVzvOg06zZszwyw==
signature_date    : 2019-07-21T12:34:26.365000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,signer,signer_fingerprint,signature_date,signed_attributes






Fichier 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=[]


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




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 uninstall():
    remove_putty_if_install_with_exe()










def update_package():

     import urllib2
     import requests


     sock = urllib2.urlopen("http://www.chiark.greenend.org.uk/~sgtatham/putty/changes.html",timeout=10)
     htmlSource = sock.readlines()
     sock.close()
     for line in htmlSource :
         if '<a href="releases/' in line :
             start = line.find("releases")
             end = line.find('.html')
             realversion = line[start + 9 :end]
             break


     if not isfile("putty-%s-installer.msi" % realversion):
        wget("https://the.earth.li/~sgtatham/putty/latest/w32/putty-%s-installer.msi" % realversion,"putty-%s-installer.msi" % realversion)

     versputty = get_msi_properties("putty-%s-installer.msi" % realversion)['ProductVersion']

     if not isfile("putty-64bit-%s-installer.msi" % realversion):
        wget("https://the.earth.li/~sgtatham/putty/latest/w64/putty-64bit-%s-installer.msi" % realversion,"putty-64bit-%s-installer.msi" % realversion)

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

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

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

if __name__ == "__main__" :
    update_package()