tis-pgadmin3

1.22.2-11
pgAdmin III
715 downloads
Download

  Description 

  • package : tis-pgadmin3
  • version : 1.22.2-11
  • architecture : all
  • categories : Development
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : pgAdmin III
  • locale : all
  • target_os : windows
  • min_wapt_version : 1.5
  • sources :
  • installed_size :
  • impacted_process : pg_dump,pg_dumpall,pg_restore,pgadmin3,psql
  • description_fr :
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2020-06-29T12:31:45.326000

  Setup.py 

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

uninstallkey = []

# Defining variables
bin_name = 'pgadmin3.msi'
silent_args = '/quiet'


def install():
    # Initializing variables
    package_version = control.version.split('-')[0]
    app_name = control.name

    # Uninstalling older versions
    for uninstall in installed_softwares(app_name):
        if Version(uninstall['version']) < Version('1.22'):
            print('Older %s version found (%s)' % (app_name,uninstall['version']))
            print('Uninstalling: %s' % uninstall['name'])
            run(uninstall_cmd(uninstall['key']))

    # Installing the package
    install_msi_if_needed(bin_name
        ,properties=silent_args
        ,remove_old_version=True)


def uninstall():
    # Initializing variables
    package_version = control.version.split('-')[0]
    app_name = control.name

    # Uninstalling the package
    for uninstall in installed_softwares(name=app_name):
        print('Uninstalling: %s' % uninstall['name'])
        run(uninstall_cmd(uninstall['key']))


def update_package():
    print('Download/Update package content from upstream binary sources')

    # Getting proxy informations from WAPT settings
    proxy = {}
    if platform.system()=='Windows' and isfile(makepath(user_local_appdata(),'waptconsole','waptconsole.ini')):
        proxywapt = inifile_readstring(makepath(user_local_appdata(),'waptconsole','waptconsole.ini'),'global','http_proxy')
        if proxywapt :
            proxy = {'http':proxywapt,'https':proxywapt}

    # Initializing variables
    app_name = control.name
    version = control.version.split('-')[0]
    url_dl = 'https://ftp.postgresql.org/pub/pgadmin/pgadmin3/v1.22.2/win32/pgadmin3-1.22.2.zip'
    latest_bin = url_dl.split('/')[-1]

    # Downloading latest binaries
    if not isfile(latest_bin):
        print('Downloading: %s' % latest_bin)
        wget(url_dl,latest_bin,proxies=proxy)
    if isfile(bin_name):
        remove_file(bin_name)
    if not isfile(bin_name):
        # Extracting binary
        unzip(latest_bin,target=basedir,filenames=bin_name)

    # Changing version of the package
    control.version = '%s-%s'%(version,int(control.version.split('-')[-1])+1)
    control.save_control_to_wapt()
    print('Changing version to: %s in WAPT\\control' % control.version)

    # Deleting outdated binaries
    for bin_in_dir in glob.glob('*.zip'):
        if bin_in_dir != bin_name :
            print('Outdated binary: %s Deleted' % bin_in_dir)
            remove_file(bin_in_dir)




										
  manifest.sha256