[RESOLVED] Using the start_interactive_process function for user interaction during deployment

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
Locked
fobrian
Messages: 21
Registration: Sep 26, 2024 - 09:35

December 5, 2024 - 10:12 AM

Good morning,

I am taking the liberty of raising this topic following the post (viewtopic.php?p=14558#p14558) that I had opened regarding the possible interaction with users when deploying a package with WAPT.

Unfortunately, although my command line calling an external PowerShell script and allowing a popup to be displayed to the user worked perfectly when testing locally with PyScripter, it was a completely different story when deploying the package via WAPT because nothing was displayed.

So I wanted to adapt this PowerShell script call using the function start_interactive_process as Simon had indicated, and I managed to build the following command line which works perfectly locally with PyScripter:

Code: Select all

notification_folder = makepath(basedir, "Notification")

for session_id in get_active_sessions():
	popup=notification_folder + "\\PsExec.exe"
        popup_command_exec="-s powershell.exe " + notification_folder + "\\ServiceUI.exe C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoLogo -Noprofile -WindowStyle Hidden -file " + notification_folder + "\\Notification.ps1 -config " + notification_folder + "\\upgrade.xml"
        start_interactive_process(popup, popup_command_exec, session_id=session_id,minimize=True)
However, if I publish the package and test the deployment on a computer, I get this error message:

Picture

However, the directory in question is completely empty because it is used only occasionally and temporarily by the package, I think (I specify that all the necessary files are present in the package directory from the beginning).

My question is: is this phenomenon normal and what is the function start_interactive_process Is it capable of accessing files from the package's native directory?

Thanks in advance.

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

December 5, 2024 - 10:53

Hi Frédéric,

I imagine you're calling this function within the `install()` function (it's best to have the entire script if possible). The package contents are unzipped into a temporary directory in `%TEMP%`. If `psexec.exe` is present in the package, it will be unzipped into the temporary directory. However, this is a file that is deleted on the fly by most antivirus programs, so you should check that first...

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
fobrian
Messages: 21
Registration: Sep 26, 2024 - 09:35

December 6, 2024 - 3:48 PM

Hello Denis,

Thanks for your reply.
Indeed, the script is executed in the part def install(): And here is the complete code:

Code: Select all

def install():

	notification_folder = makepath(basedir, "Notification")

	for session_id in get_active_sessions():
		popup=notification_folder + "\\PsExec.exe"
        	popup_command_exec="-s powershell.exe " + notification_folder + "\\ServiceUI.exe C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoLogo -Noprofile -WindowStyle Hidden -file " + notification_folder + "\\Notification.ps1 -config " + notification_folder + "\\upgrade.xml"
        	start_interactive_process(popup, popup_command_exec, session_id=session_id,minimize=True)
        
        sys.exit(0)
I tried in parallel to create a directory accessible to all users locally, to copy the required executables into it (including "PsExec.exe") and then to call it from my Python script.
The script works perfectly from PyScripter, the directory is created correctly and the files are not deleted by the antivirus.

However, it also fails to work when executed as a package.

Are there any specific points to be observed with the function? start_interactive_process ?

Thanks in advance.

Fred
fobrian
Messages: 21
Registration: Sep 26, 2024 - 09:35

December 10, 2024 - 4:21 PM

Hello,

I finally managed to resolve the issue by changing the command-line syntax, and the notification now displays correctly in the user context.
However, I opted for a scheduled, ephemeral task to avoid using the "PsExec.exe" and "ServiceUI.exe" processes, which are sometimes misinterpreted by EDRs in terms of behavior.

Fred
luc91
Messages: 7
Registration: Oct 11, 2025 - 4:05 p.m.

January 12, 2026 - 11:58 PM

I think your solution with the scheduled task was simpler in the end. It avoids the problems with PsExec and ServiceUI, especially with antivirus software or EDR that can block it.
Locked