This project is read-only.

Allowing applications to automatically close while using the defer option

Topics: Archive - General
Jul 10, 2014 at 11:07 PM
Edited Jul 10, 2014 at 11:09 PM
Hi,

We are currently planning to adopt the toolkit for deployments and during the discussions we got a request that besides providing the defer option to the users we should also make sure that there is a timeout to automatically close the applications after a certain amount of time and proceed with the installation.

The code I thought it would allow this is:
Show-InstallationWelcome -CloseApps "iexplore,firefox,chrome" -AllowDeferCloseApps -CloseAppsCountdown 3600 -BlockExecution -DeferTimes 3 -PersistPrompt
But by default when you still have remaining deferrals the CloseAppsCountdown will be ignored.

Would it be possible to have a ForceCloseAppsCountdown in the toolkit that would always display the countdown and close the applications regardless of how many deferrals the user still has?

We want to use this option to ensure that the deployment would be successful if the user is not on his desk at the time of the deployment but he is logged on to the machine.

Anderson Cassimiro
Jul 15, 2014 at 10:07 PM
Hi,

I understand your request, the challenge is we get a lot of requests for to cater for different nuances and we need to evaluate the level of effort/complexity involved versus the value they provide and what is in the interest of the toolkit.

The reason we have a deferral is to allow a user the opportunity to postpone an installation. The countdown to close applications is seen as a last resort to force close applications. To us it made more sense only to show the countdown timer if no deferrals are remaining, otherwise you are saying - "here you have a chance to defer this but if you don't respond within the allotted time we're going to kill your applications" (pretty harsh - I wouldn't like to return to my computer only to find my applications were closed without warning!), as opposed to "you've already deferred this installation X number of times, now I'm afraid we must insist on installing this time and if you don't close your applications within the allotted time we will do it automatically"

Sean
Aug 14, 2014 at 4:01 PM
Hi Sean,

For this case the reasoning we got from the deployment team is: when deploying packages to a call center environment we don't want to disturb their work if they are on the middle of a call and hence provide them the ability to defer, but if they are not in their machines or if they are out of office we need to ensure that the deployment is happening.

I understand that if we just change the current behavior it might not fit the scenario for everyone and that's why I think that by providing a new option (ForceCloseAppsCountdown) besides the already existing one (CloseAppsCountdown) would fit both cases.

We were able to do the change in the script for our internal use but I think everyone could benefit if the tool would natively provide this option.

Anderson Cassimiro
Aug 20, 2014 at 10:10 PM
Hi Anderson,

I've looked through the code to see what's involved here and I'm not convinced the use case warrants it - we'd need to change the UI to have both the deferral and countdown options and text displayed at the same time.

I'd suggest making use of the parameters below already available, create an extension or modify the toolkit yourself if preferred.
  • AllowDeferCloseApps
  • CloseAppsCountdown
  • Silent
Regards,
Sean
Oct 24, 2014 at 6:38 PM
Hi Sean,

I was able to add a parameter (ForceCloseAppsCountdown) and that only required to change 4 lines in the main toolkit code. No UI modification was necessary because the toolkit automatically fits everything accordingly. This is what I did with version 3.2.0:

Added the following parameter to the function Show-InstallationWelcome:
[switch] $ForceCloseAppsCountdown = $false
Changed line 2859 from:
$promptResult = Show-WelcomePrompt -ProcessDescriptions $runningProcessDescriptions -CloseAppsCountdown $closeAppsCountdownGlobal -PersistPrompt $PersistPrompt -AllowDefer -DeferTimes $deferTimes -DeferDeadline $deferDeadlineUniversal -MinimizeWindows $minimizeWindows
To:
$promptResult = Show-WelcomePrompt -ProcessDescriptions $runningProcessDescriptions -CloseAppsCountdown $closeAppsCountdownGlobal -PersistPrompt $PersistPrompt -AllowDefer -DeferTimes $deferTimes -DeferDeadline $deferDeadlineUniversal -MinimizeWindows $minimizeWindows -ForceCloseAppsCountdown $ForceCloseAppsCountdown
Changed line 3033 from:
If ($showDefer -ne $true) {
To:
If ($showDefer -ne $true -or $ForceCloseAppsCountdown -ne $false) {
Changed line 3288 from:
ElseIf ($showCountdown -eq $true) {
To:
If ($showCountdown -eq $true) {
Do you think that it would be possible to include that in the next versions of the toolkit?

Regards,
Anderson Cassimiro
Nov 6, 2014 at 11:52 PM
This was way more complicated than you'd imagine but it's done now and will be added to the 3.5 release.

Note, if you allow deferral and there are no apps to close then the "ForceCloseAppsCountdown" won't appear since it's only for closing applications not a general UI timeout. So you'll still have the prompt sitting on the screen of machines where the apps don't need to be closed. This is why I suggested making use of the AllowDeferCloseApps and CloseAppsCountdown parameters which will only show deferral if the apps are open and if deferral has expired and the apps are open it will force close them.
Nov 7, 2014 at 4:44 PM
Hi Sean,

We are planning to use the -ForceCloseAppsCountdown parameter only with the -AllowDeferCloseApps to ensure that the users will only be prompted if they have any of the specified processes open. I tested the new code and it's behaving exactly like that. =)

Thank you very much for including this!

Regards,
Anderson Cassimiro
Nov 9, 2014 at 9:34 PM
Hey Anderson,

Yeah that makes sense.

Cheers
Sean