Page 1 sur 1

tis-ultravnc - Amélioration installation fichier ini

Publié : 29 juin 2026 - 17:53
par STbar
Bonjour,

Je propose une modification du paquet tis-ultravnc (dernière version en date 1.8.2.4-38).

Aujourd'hui le setup est celui-ci :

Code : Tout sélectionner

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


def install():
    # Declaring local variables
    package_version = control.get_software_version()
    bin_name = glob.glob("*.exe")[0]

    # Installing the software
    print("Installing: %s" % bin_name)
    install_exe_if_needed(
        bin_name,
        silentflags="/VERYSILENT /NORESTART /RESTARTEXITCODE=3010 /SP- /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS /FORCECLOSEAPPLICATIONS",
        key="Ultravnc2_is1",
        min_version=package_version,
    )

    # Arbitrary server options (may be unsecure if the configuration remain untouched !)
    print("WARNING: Applying Arbitrary server options (may be unsecure if the configuration remain untouched !)")
    path_uvnc = makepath(install_location("Ultravnc2_is1"), "winvnc.exe")
    run('"%s" -install' % (path_uvnc))
    remove_file(makepath(path_uvnc, "ultravnc.ini"))
    filecopyto("ultravnc.ini", makepath(install_location("Ultravnc2_is1"), "ultravnc.ini"))
    run("regedit /s acl_vnc.reg")
    run_notfatal("net stop uvnc_service")
    time.sleep(5)
    run("net start uvnc_service")
Or depuis la version 1.8 le fichier de config ini ne doit plus être placé dans le dossier d’instillation mais dans %ProgramData%\UltraVNC\ (si installé comme service).

Je propose le setup suivant :

Code : Tout sélectionner

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


def install():
    # Declaring local variables
    package_version = control.get_software_version()
    bin_name = glob.glob("*.exe")[0]

    # Installing the software
    print("Installing: %s" % bin_name)
    install_exe_if_needed(
        bin_name,
        silentflags="/VERYSILENT /NORESTART /RESTARTEXITCODE=3010 /SP- /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS /FORCECLOSEAPPLICATIONS",
        key="Ultravnc2_is1",
        min_version=package_version,
    )

    # Arbitrary server options (may be unsecure if the configuration remain untouched !)
    print("WARNING: Applying Arbitrary server options (may be unsecure if the configuration remain untouched !)")
    path_uvnc_dir = install_location("Ultravnc2_is1")
    path_uvnc = makepath(path_uvnc_dir, "winvnc.exe")
    run('"%s" -install' % (path_uvnc))

    # Cleanup old config location (migration from pre-1.8)
    remove_file(makepath(path_uvnc_dir, "ultravnc.ini"))
    remove_file(makepath(path_uvnc_dir, "ultravnc.portable"))

    # Copy config to new ProgramData location
    path_programdata_uvnc = makepath(programdata(), "UltraVNC")
    mkdirs(path_programdata_uvnc)
    filecopyto("ultravnc.ini", makepath(path_programdata_uvnc, "ultravnc.ini"))

    # Registering ACL
    run("regedit /s acl_vnc.reg")

    # Service restart
    run_notfatal("net stop uvnc_service")
    time.sleep(5)
    run("net start uvnc_service")

Merci pour votre retour et vos commentaires