Show-InstallationWelcome -CloseApps

Using the Show-InstallationWelcome -CloseApps applet in a Powershell script and it works if the deployment is Available, but it forces closure of apps without prompting if the deployment is required. DeploymentMode is set to ‘Interactive’. This is what shows in the log for session 0
Session 0 detected, process not running in user interactive mode; deployment mode set to [NonInteractive].
What would cause this behavior?

How have you set up your User Experience settings for you Deployment Type?

The User Experience is: Install for system, whether or not a user is logged on, Normal.

I’m also struggling with this issue. It seems like if you run the installation manually from the Software Center the notifications are displayed, but if it runs on its own when the deadline is reached they are not.

I’m experiencing a similar issue: when I deploy applications the -closeapps notification is not shown, the script just kills the processes right away. Does anybody has an idea what to do? Additionally, when I check the log it says

[Initialization] :: Installation is running in [NonInteractive] mode. PSAppDeployToolkit 18.07.2016 14:44:56 8456 (0x2108)

though I explicitely set it to Interactive by using -DeployMode “Interactive” (and -DeploymentMode “Interactive” - just to make sure). Either way, the log says

[Initialization] :: The following non-default parameters were passed to [Deploy Application]: [-DeploymentType "uninstall"] PSAppDeployToolkit 18.07.2016 14:44:52 8456 (0x2108)

Ok, I know that Interactive is the default method but why isn’t the script using the interactive method? Is it because I “Install it for SYSTEM”? Any kind of ideas are appreciated, thank you.

Make sure Logon requirement is set to Only when a user is logged on and to check Allow users to view and interact with the program installation.

1 Like

Is this the same issue as this thread?

http://psappdeploytoolkit.com/forums/topic/session-0-ui

Hi,
is there any better solution for this old issue? “Only when a user is logged on” is not a good idea since the installation cannot run while no user is logged on. The option “allow users to view and interact with the program installation” is possible but there is a security warning when you activate that option.
As long as the software deployment is available the popup message shows up as expected. When the deployment (the same as before) becomes required, the popup messages is no longer showing up.
So the question for me is, why? I’m logged in (since no one needs popup messages when not logged in) and I still want to see a warning message that I have to close specific applications and not to loose my work without having the chance to react.
When I configure “interactive” in my deploy-application.ps1 script I want it to be interactive, regardless the deployment type “available” or “required”.

The “allow users to view and interact with the program installation” option is needed for the user to just SEE anything from PSADT.

RE: “Only when a user is logged on” is not a good idea
Agreed! So select “Whether or not a user in logged on”.
If no user is logged on, PSADT will go on just fine.

Hi,
that isn’t correct. The deployment type makes the difference. We normally use required deployments that have one week of availabilty. As long as a deployment is available, the popup request for closing applications is shown. As soon as the deployment becomes required, the popup disappears. I tried to use the option “allow users to view and interact…” with no change of the result. If you use an available deployment instead, everything is fine with the welcome message box.
In the logfile you can see what happens. The logged on user is recognized. Also the application that is required to be closed for the installation. But then PSAD continues with “force closing App without promptimg user”. PSAD doesn’t try to show the dialog box when the deployment is set to required.

I guess I have an idea what happens. Within PSAD an env variable is declared:
[boolean]$IsProcessUserInteractive = [Environment]::UserInteractive
As long at the deployment runs in available mode, this variable seems to be set to “true”. As soon as it goes to “false”, the close force happens due to the script behind the scenes.
I’m trying to write this value to my log now in order to find out if this env variable is manipulated by the deployment type.
I’m not sure why this value is checked by the script and then overrides the “interactive” setting in my config.

Sorry for the confusion,
both is correct. As long as you have an available deployment, the variable $IsProcessUserInteractive is set to true. It doesn’t matter if you set the checkbox in your application for “allow users to view and interact with the program installation”. The value is always true.
The checkbox only matters for required deployments. Then you can change the value to false, if you remove the hook from that checkbox.
But - and that’s why things confused me and took me several hours to understand - it doesn’t help to update the content after you changed the checkbox. Also refreshing the hardware policy or anything else on the client side doesn’t bring the change to the client. The fastest way to activate the change was deleting the deployment and creating a new one. Also clearing the client wmi was successful. Maybe it helps to wait a very long time and maybe it isn’t a problem for clients that are added to the deployment collection for the first time after the change was made.
Because of the behaviour during available deployments I didn’t see the problem with the checkbox in the wild.
In the end a new parameter within PSAD would be great for bringing up the welcome message regardless of the nasty checkbox. But there might be a reason for looking at a parameter that only works for required deployments.
If you check for a logged on user, session 0 and open applications a -forceshowwelcomemessage parameter or something like that would be nice.

Regards

Sven

Hello,

Am too facing the same problem. but I can set the deploy mode to “Interactive” during the required mode of installation. But after setting this am getting the below error with respect to show-dialog.

Exception calling “ShowDialog” with “0” argument(s): "Showing a modal dialog box or form when the **
** application is not running in UserInteractive mode is not a valid operation. Specify the **
** ServiceNotification or DefaultDesktopOnly style to display a notification from a service application."

Also this happens only for first time and when I re-try the same without any changes. it works fine as expected.

Any idea ?

Regards,
Nagaraj

-CloseApps exists, so that an installation that runs after it, can run successfully. You cant uninstall/replace applications without closing them first otherwise a reboot will be required. If the toolkit is run in a non interactive session - we cant display anything - the function chooses for the user and closes them instead of asking as that is the preferred action since we need the apps to be closed.

It doesnt really make sense to deploy something as “REQUIRED” and then not require the user to close the app that is being reinstalled/uninstalled.