Seite 1 von 1

[GELÖST] tis-ultravnc – Verbesserte Installation der INI-Datei

Veröffentlicht: 29. Juni 2026 - 17:53 Uhr
von STbar
Guten Morgen,

Ich schlage eine Modifikation des tis-ultravnc-Pakets (neueste Version 1.8.2.4-38) vor.

Die heutige Konstellation ist wie folgt:

Code: Alle auswählen

# -*- 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")
Seit Version 1.8 muss die INI-Konfigurationsdatei jedoch nicht mehr im Installationsordner, sondern in %ProgramData%\UltraVNC\ abgelegt werden (sofern die Installation als Dienst erfolgt).

Ich schlage folgendes Setup vor:

Code: Alle auswählen

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

Vielen Dank für Ihr Feedback und Ihre Kommentare

Betreff: tis-ultravnc - Verbesserung der INI-Dateiinstallation

Veröffentlicht: 30. Juni 2026 - 09:52 Uhr
von Gadam
Guten Morgen,

Vielen Dank für den Bericht. Ich habe ihn dem Paket in unserem Shop hinzugefügt; er wird in wenigen Minuten in der Vorproduktion und in 5 Tagen in der Produktionsumgebung verfügbar sein. Ich habe lediglich die Funktion `uninstall()` zu `setup.py` hinzugefügt, um nach der Deinstallation aufzuräumen. Hier ist die finale `setup.py`-Datei:

Code: Alle auswählen

# -*- 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)
Aufrichtig
Gwenaël

Betreff: tis-ultravnc - Verbesserung der INI-Dateiinstallation

Veröffentlicht: 30. Juni 2026 - 11:00 Uhr
von STbar
Vielen Dank für die schnelle Antwort.

Bezüglich des Deinstallationsprozesses, wäre es nicht sinnvoller, Folgendes zu verwenden:

Code: Alle auswählen

path_uvnc_dir = install_location("Ultravnc2_is1")
anstatt

Code: Alle auswählen

path_programfiles_uvnc = makepath(programfiles, "uvnc bvba")
Guten Tag,

Betreff: tis-ultravnc - Verbesserung der INI-Dateiinstallation

Veröffentlicht: 30. Juni 2026 - 11:44 Uhr
von Gadam
Hallo,

Ihr Kommentar ist hilfreich. Ich habe diesen Pfad verwendet, da der in install_location angegebene Pfad ein Unterordner von uvnc bvba ist: „C:\Program Files\uvnc bvba\UltraVNC\“. Ich möchte den gesamten Ordner löschen. Die Deinstallationsfunktion löscht zwar den Ordner C:\Program Files\uvnc bvba\UltraVNC\, der übergeordnete Ordner uvnc bvba bleibt jedoch erhalten, sofern er nicht leer ist.

Zur Information: Das Vorab-Paket ist unter folgendem Link verfügbar: https://wapt.tranquil.it/store/fr/detai ... EPROD.wapt. Die finale Version wird voraussichtlich am 5. Juli am späten Vormittag veröffentlicht.

Mit freundlichen Grüßen,
Gwenaël