Page 1 of 1

dialog box during package installation

Published: March 25, 2025 - 12:56
by Joshernandez
Good morning,

I am trying to create a "universal" package for uninstalling applications that are not managed by WAPT.
To do this, I use waptmessage, following an example found here on the forum, to open a dialog box and choose the application to uninstall.
It works perfectly in dev mode but once sent to the server, the dialog box does not open and the installation times out.

Here is the part of the code that opens this dialog box:

Code: Select all

application = ""
# Choix par défaut liste déroulante
default_value = "--Choisir une option s'il vous plait--"
# Forlumaire pour rentrer le nom de l'application lors de l'installation
form =f"""\
<html encoding="utf8">
    <form method="STDOUT">
        <h4>Logiciel à désinstaller :</h4>
        <label for="app-select">Choisir un logiciel :</label>
        <select name="application" id="app-select">
            <option value="">{default_value}</option>
            <option value="ccleaner">CCleaner</option>
        </select>
        <input type="submit" value="Valider">
    </form>
</html>
"""

def install():
    s = base64.b64encode((form % locals()).encode('utf8'))
    result = run(['waptmessage','-c','-b',s])
    if result:
        data = json.loads(result)
        application = data['result']['application']
Can you tell me what might be causing the problem, please?

For your information:
- Installed WAPT version: 2.3.0.13.166(c)
- Operating system of the administration/package creation machine: Windows 10

Re: Dialog box during package installation

Published: March 25, 2025 - 5:56 PM
by dcardon
Hello Joseph,

during package deployment by the WAPT agent, the `def install()` function is called as `LOCALSERVICE`. Therefore, your package, as currently written, will display a `waptmessage` on the `LOCALSYSTEM` graphical buffer.

You can take inspiration from viewtopic.php?p=15145#p15145 , however, it needs some modifications because the current `waptmessage` call is blocking.

Regards,

Denis

Re: Dialog box during package installation

Published: March 27, 2025 - 4:54 PM
by Joshernandez
Hello,

Thank you for your feedback.
I'll see what I can do with the example you gave me!

Best regards,
Joseph

Re: Dialog box during package installation

Published: March 28, 2025 - 11:30 AM
by dcardon
Hello Joseph,

regarding the initial need, the best approach in my opinion is to create an "anti-crapware" package that removes anything that is clearly useless/adware/malware.

Then you can prepare packages for legitimate software and push them to the workstations so they are listed on the machine. This way, they will be the correct, up-to-date version without any security vulnerabilities. If the software is later removed from the workstation, the user can uninstall it themselves using the self-service interface.

Best regards,

Denis