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

Preguntas sobre paquetes WAPT / Solicitudes y ayuda sobre paquetes WAPT.
Reglas del foro
Reglas del foro de la comunidad
* Soporte en inglés en www.reddit.com/r/wapt
* El soporte de la comunidad en francés está disponible en este foro
* Por favor, anteponga [RESUELTO] al título del tema si está resuelto.
* Por favor, no edite un tema que esté etiquetado como [RESUELTO]. Abra un nuevo tema haciendo referencia al anterior.
* Especifique la versión de WAPT instalada, la versión completa y el número de compilación (2.2.1.11957 / 2.2.2.12337 / etc.), así como la edición Enterprise/Discovery.
* Las versiones 1.8.2 y anteriores ya no son compatibles. Las únicas preguntas aceptadas sobre la versión 1.8.2 están relacionadas con la actualización a una versión compatible (2.1, 2.2, etc.).
* Especifique el sistema operativo del servidor (Linux/Windows) y la versión (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Especifique el sistema operativo de la máquina de administración/creación de paquetes y de la máquina con el agente problemático, si corresponde (Windows 7/10/11/Debian 11/etc.).
* Evite hacer varias preguntas al abrir un tema, ya que podría ser ignorado. Si hay varios temas, ábralos por separado, preferiblemente uno tras otro y no todos a la vez (es decir, no sature el foro con spam).
* Incluya fragmentos de código, capturas de pantalla y otras imágenes directamente en la publicación. Los enlaces a Pastebin, Bitly y otros sitios de terceros serán eliminados sistemáticamente.
* Como en cualquier foro comunitario, el soporte es proporcionado voluntariamente por los miembros. Si necesita soporte comercial, puede comunicarse con el departamento de ventas de Tranquil IT al 02.40.97.57.55.
Bloqueado
Barra ST
Mensajes: 5
Inscripción: 31 de enero de 2019 - 09:39

29 de junio de 2026 - 17:53

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
gadam
Mensajes: 27
Inscripciones: 30 Oct 2025 - 14:46 horas.

30 de junio de 2026 - 09:52

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
Barra ST
Mensajes: 5
Inscripción: 31 de enero de 2019 - 09:39

30 de junio de 2026 - 11:00

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,
gadam
Mensajes: 27
Inscripciones: 30 Oct 2025 - 14:46 horas.

30 de junio de 2026 - 11:44

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
Bloqueado