Tranquil IT recrute Tranquil IT recrute

tis-ldapadmin

Version : 1.8.3-12

Download
  • package : tis-ldapadmin
  • editor :
  • version : 1.8.3-12
  • licence : GNU General Public License
  • architecture : all
  • locale :
  • description : Ldap Admin is a free Windows LDAP client and administration tool for LDAP directory management.
  • description_fr : Ldap Admin est un client LDAP Windows opensource et un outil d’administration pour la gestion des annuaires LDAP.
  • min_os_version :
  • max_os_version :
  • min_wapt_version :
  • installed_size : 4194304
  • impacted_process : LdapAdmin.exe
  • signature_date : 20181020-131228
  • maintainer : Simon Fonteneau

setup.py

# -*- coding: utf-8 -*-
from setuphelpers import *
import re
import glob
import pefile
import os
from waptpackage import PackageEntry

uninstallkey = []

install_dir = 'ldapadmin'
applabel = "LDAPAdmin"


def find_exes(root):
    """ Returns all .exe in root directory and subdirs"""
    result = []
    for entry in os.listdir(root):
        if os.path.isdir(entry):
            result.extend(find_exes(makepath(root,entry)))
        elif glob.fnmatch.fnmatch(entry,'*.exe'):
            result.append(makepath(root,entry))
    return result

def sort_path_length(exes):
    return sorted(exes,key=lambda a:len(os.path.splitext(a)))

def find_app(adir):
    exes = sorted(sort_path_length(find_exes(adir)),key = lambda a: -os.stat(a).st_size)
    return exes[0]

"""
Available template vars:
    packagename
    uninstallkey
    silentflags
    installer
    product
    description
"""

def install():
    global applabel

    app = find_app(install_dir)
    destdir = makepath(programfiles32,install_dir)
    print('Installing ldapadmin into {}'.format(destdir))
    mkdirs(destdir)
    copytree2(install_dir,destdir)
    create_programs_menu_shortcut('{}.lnk'.format(applabel),makepath(destdir,os.path.basename(app)))

    register_uninstall(applabel,'wapt-get uninstall %s' % control.package,display_name=applabel,display_version=control.version.split('-',1)[0])

    if iswin64() :
        root = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
    else:
        root = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
    with reg_openkey_noredir(HKEY_LOCAL_MACHINE,"%s\\%s" % (root,applabel),sam=KEY_ALL_ACCESS,create_if_missing=True) as appkey:
        reg_setvalue(appkey,'DisplayIcon',makepath(destdir,os.path.basename(app)))


def uninstall():
    global applabel
    if applabel is not None:
        remove_programs_menu_shortcut(applabel)
    unregister_uninstall(applabel)

def update_package():
    htmlsource = wgets('http://www.ldapadmin.org/download/ldapadmin.html')
    for line in htmlsource.splitlines() :
        if 'LdapAdminExe' in line:
            version = line.split('LdapAdminExe-w32-')[1].split('.zip')[0]
            linkdownload = line.split("href='")[1].split("'>LdapAdminExe")[0]
            break

    for exe in glob.glob(r'ldapadmin\*.exe'):
        if get_file_properties(exe)['ProductVersion'] != version:
            remove_file(exe)

    if not isfile(r'LdapAdmin\LdapAdmin.exe'):
        print('New version : %s' % version)
        wget(linkdownload,'LdapAdminExe-w32-%s.zip' % version)

        unzip('LdapAdminExe-w32-1.8.3.zip')
        remove_file('LdapAdminExe-w32-%s.zip' % version)

        os.rename(r'LdapAdminExe-w32-%s\LdapAdmin.exe' % version,r'ldapadmin\LdapAdmin.exe')
        remove_tree('LdapAdminExe-w32-%s' % version)



        os.chdir(os.path.dirname(__file__))

        from waptpackage import PackageEntry
        pe = PackageEntry()
        pe.load_control_from_wapt(os.getcwd())

        pe.version = version + '-0'
        pe.save_control_to_wapt(os.getcwd())
    else:
        print('Already up to date')





if __name__ == '__main__':
    update_package()


			

Changelog

"""{% trans %}No changelog.{% endtrans %}"""
			

manifest.sha256

[["WAPT/icon.png", "b42c6f4c4eab89492f572ecb1767e782996c46a24c3c8e45c767c9e699e5e48b"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "e306ae088b4ffc91364d6f53a3933bffa75f4bc4f8a3d6ff422209e90760feb0"], ["ldapadmin/LdapAdmin.exe", "098bfbec9c63f6a581f1ff494a2e93043fdd627d73fc6c037d2988c469d88aeb"], ["setup.py", "9f1e75bc5ebaec2ac7e06f8d59d7a4f4d000bac5272c56e1263088a6040bd1e9"], ["WAPT/control", "2a55ea7f7b0cf1fbded7543db07b0b2a018bb51b2df192b3f54bc06aee663755"]]