Page 1 of 1

Interactive message before Install

Published: January 16, 2025 - 1:36 PM
by CaSmir69
Good morning,
Wapt Discovery version 2.5.5.15691

The editor will work, however, nothing happens during deployment; it remains in "Installation in progress" in the console
Can someone help me? Please review the code

Here is my code:

Code: Select all

def install():
    # Declaring local variables
    from waptservice.enterprise import get_active_sessions, start_interactive_process
    for session_id in get_active_sessions():
        start_interactive_process("wapt-get", "--hide session-setup %s -f" % session_setup(), session_id=session_id)  # , minimize=True

        # Uninstall the version
        print("Uninstall old versions")
        run('msiexec /x {23170F69-40C1-2702-2409-000001000000} /quiet /norestart',accept_returncodes=[0,3010,1605])
        run('msiexec /x {23170F69-40C1-2702-2406-000001000000} /quiet /norestart',accept_returncodes=[0,3010,1605])
        run('msiexec /x {3506E9B7-340F-4ABF-B703-D74F274040B4} /quiet /norestart',accept_returncodes=[0,3010,1605])
        run('msiexec /x {23170F69-40C1-2702-2201-000001000000} /quiet /norestart',accept_returncodes=[0,3010,1605])
        run('msiexec /x {23170F69-40C1-2702-1900-000001000000} /quiet /norestart',accept_returncodes=[0,3010,1605])
        run('msiexec /x {23170F69-40C1-2702-2301-000001000000} /quiet /norestart',accept_returncodes=[0,3010,1605])

        # Installing the software
        print("Installing: 7z2409-x64.msi")
        install_msi_if_needed('7z2409-x64.msi', properties = properties)

def session_setup():
    print("Message USER")
    #showmessage("test")
    message_box(
            message_box_title, message_box_core, style=0
           )

def message_box(title, text, style=0):
    if platform.python_version_tuple()[0] == "3":
        import importlib

        importlib.reload(sys)
    else:
        reload(sys)
        sys.setdefaultencoding("utf-8")

    MB_OK = 0
    MB_OKCANCEL = 1
    MB_YESNOCANCEL = 3
    MB_YESNO = 4
    ctypes.windll.user32.MessageBoxW(0, "%s" % text, "%s" % title, style)
    return