dialog box during package installation

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Answer
Joshernandez
Messages: 2
Registration: March 25, 2025 - 09:44

March 25, 2025 - 12:56

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
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

March 25, 2025 - 5:56 PM

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
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Joshernandez
Messages: 2
Registration: March 25, 2025 - 09:44

March 27, 2025 - 4:54 PM

Hello,

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

Best regards,
Joseph
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

March 28, 2025 - 11:30

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
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Answer