tis-vncrestricted 2.7.10.0-1

  • package : tis-vncrestricted
  • version : 2.7.10.0-1
  • description : TightVNC Viewer et server pour x86 et x64 avec mot de passe et rstriction IP
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2017-07-20 11:24:40
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170720-112440
  • min_os_version :
  • min_wapt_version :

setup.py

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

uninstallkey = []

# password for full access VNC viewer
password = 'mainpass'

# list of IP of authorized VNC viewers
authorized_ips = ['192.168.149.14','192.168.149.16']

def install_msi_if_needed(msi,min_version=None,killbefore=[],properties={}):
    if not isfile(msi):
        error('msi file %s not found in package' % msi)
    key = get_msi_properties(msi)['ProductCode']
    # will try to add key in the caller's (setup.py) uninstallkey list
    import inspect
    caller_globals = inspect.stack()[1][0].f_globals
    WAPT = caller_globals.get('WAPT',None)
    force = WAPT and WAPT.options.force

    if not min_version:
        min_version = getproductprops(msi)['version']

    if need_install(key,min_version=min_version,force=force):
        props = ' '.join(["%s=%s" % (k,v) for (k,v) in properties.iteritems()])
        if killbefore:
            killalltasks(killbefore)
        run(r'msiexec /norestart /q /i "%s" %s' % (msi,props))
        if not installed_softwares(uninstallkey=key):
            error('MSI %s has been installed but the uninstall key %s can not be found' % (msi,key))
    else:
        print('MSI %s already installed. Skipping msiexec' % msi)
    if key:
        if 'uninstallkey' in caller_globals and not key in caller_globals['uninstallkey']:
            caller_globals['uninstallkey'].append(key)

def install():
    # be sure to remove old vnc and associated settings...
    old_vnc = installed_softwares('TightVNC')
    for soft in old_vnc:
        print('Uninstall %s' % soft['name'])
        run_notfatal(uninstall_cmd(soft['key']))

    if iswin64():
        msi = 'tightvnc-2.7.10-setup-64bit.msi'
    else:
        msi = 'tightvnc-2.7.10-setup-32bit.msi'
    options = dict(
        SET_USEVNCAUTHENTICATION=1,
        VALUE_OF_USEVNCAUTHENTICATION=1,
        SET_PASSWORD=1,
        VALUE_OF_PASSWORD=password,
        SET_IPACCESSCONTROL=1,
        VALUE_OF_IPACCESSCONTROL= '"%s"'%( ','.join('%s-%s:0'%(ip,ip) for ip in ensure_list(authorized_ips))))

    install_msi_if_needed(msi,properties=options)

    

manifest

[["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "bb14ed53e67038f372abc2d8ecff6b16c3eb06f2"], ["tightvnc-2.7.10-setup-64bit.msi", "d2d76b7e77737de2f9126ecff7f7212b5a7c695e"], ["wapt.psproj", "176f9fbee5c5dfba9a943e398a7a27cab8c9e8ca"], ["tightvnc-2.7.10-setup-32bit.msi", "f619e5c7fbc63744ad8606f20ac11d237eabb132"], ["setup.py", "1fdbfc09bd192f3533543f99d6470c221d9f8d92"], ["WAPT/control", "3f7fb2547bead09d5f72438b1a1d26ae6bbfb6bc"]]