Página 1 de 1

[RESUELTO] tis-ultravnc - Instalación mejorada del archivo ini

Publicado: 29 de junio de 2026 - 17:53
por STbar
Buen día,

Propongo una modificación del paquete tis-ultravnc (última versión 1.8.2.4-38).

La configuración actual es la siguiente:

Código: Seleccionar todo

# -*- 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")
Sin embargo, desde la versión 1.8, el archivo de configuración ini ya no debe colocarse en la carpeta de instalación, sino en %ProgramData%\UltraVNC\ (si se instala como un servicio).

Propongo la siguiente configuración:

Código: Seleccionar todo

# -*- 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")

Gracias por sus comentarios y opiniones

Re: tis-ultravnc - Mejora de la instalación del archivo ini

Publicado: 30 de junio de 2026 - 09:52
por gadam
Buen día,

Gracias por el informe. Lo he añadido al paquete en nuestra tienda; estará disponible en preproducción en unos minutos y en producción en 5 días. Simplemente he añadido la función `uninstall()` a `setup.py` para limpiar todo después de la desinstalación. Para su información, aquí está el archivo `setup.py` final:

Código: Seleccionar todo

# -*- 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)
    if isfile(makepath(path_uvnc_dir, "ultravnc.ini")):
        remove_file(makepath(path_uvnc_dir, "ultravnc.ini"))
    if isfile(makepath(path_uvnc_dir, "ultravnc.portable")):
        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")

    # Restart service
    run_notfatal("net stop uvnc_service")
    time.sleep(5)
    run("net start uvnc_service")

def uninstall():
    # Define local variables
    path_programdata_uvnc = makepath(programdata(), "UltraVNC")
    path_programfiles_uvnc = makepath(programfiles, "uvnc bvba")

    # Uninstall
    for to_uninstall in installed_softwares("UltraVNC"):
        print(f"Removing: {to_uninstall['name']} ({to_uninstall['version']})")
        killalltasks(ensure_list(control.impacted_process))
        run(uninstall_cmd(to_uninstall["key"]))
        wait_uninstallkey_absent(to_uninstall["key"])
    
    # Cleanup
    if isdir(path_programdata_uvnc):
        remove_tree(path_programdata_uvnc)

    if isdir(path_programfiles_uvnc):
        remove_tree(path_programfiles_uvnc)
Atentamente
Gwenaël

Re: tis-ultravnc - Mejora de la instalación del archivo ini

Publicado: 30 de junio de 2026 - 11:00 a. m.
por STbar
Gracias por la rápida respuesta.

En cuanto al proceso de desinstalación, ¿no sería más prudente utilizar:

Código: Seleccionar todo

path_uvnc_dir = install_location("Ultravnc2_is1")
en lugar de

Código: Seleccionar todo

path_programfiles_uvnc = makepath(programfiles, "uvnc bvba")
Buen día,

Re: tis-ultravnc - Mejora de la instalación del archivo ini

Publicado: 30 de junio de 2026 - 11:44
por gadam
Hola,

tu comentario es pertinente. Utilicé esa ruta porque la ruta proporcionada en install_location es una subcarpeta de uvnc bvba: "C:\Program Files\uvnc bvba\UltraVNC\", y prefiero eliminar la carpeta completa. La función de desinstalación por sí sola elimina la carpeta C:\Program Files\uvnc bvba\UltraVNC\, pero la carpeta principal uvnc bvba permanece si no está vacía.

Para tu información, el paquete lanzado en preproducción está disponible en este enlace: https://wapt.tranquil.it/store/fr/detai ... EPROD.wapt. El lanzamiento de producción está programado para el 5 de julio a última hora de la mañana.

Atentamente,
Gwenaël