- If I use the button to close apps, they close fine.
- If I wait until the timer expires, the PSApp window just starts blinking endlessly (restarting over and over, like pressing the continue button when apps are still active).
Why is ForceCloseAppsCountdown is not working? Does it use a different technique opposed to the button $closeapps? I’m using v3.8.4 with below command:
Show-InstallationWelcome -CloseApps ‘acad,outlook,winword,excel’ -BlockExecution -AllowDefer -DeferTimes 3 -ForceCloseAppsCountdown 30 -CheckDiskSpace
Found my own answer. Per this community, I disabled the Close Apps button so users don’t accidentally close their apps without saving. Like so:
#If ($showCloseApps) { $panelButtons.Controls.Add($buttonCloseApps) }
Problem with this is, after countdown expires, a PerformClick is done on the button:
Else {
Write-Log -Message 'Close application(s) countdown timer has elapsed. Force closing application(s).' -Source ${CmdletName}
If ($buttonCloseApps.CanFocus) { $buttonCloseApps.PerformClick() }
Else { $buttonContinue.PerformClick() }
}
So I added the if statement before the click action is performed.
Else {
Write-Log -Message 'Close application(s) countdown timer has elapsed. Force closing application(s).' -Source ${CmdletName}
If ($showCloseApps) { $panelButtons.Controls.Add($buttonCloseApps) }
If ($buttonCloseApps.CanFocus) { $buttonCloseApps.PerformClick() }
Else { $buttonContinue.PerformClick() }
}
Why would they accidentally close the programs? The Close button isnt in the focus when the window appears. The Continue button is focused. So if the window was active and they pressed Enter or Space it would press Continue, which does not close any programs.
Well that’s our users. They just press buttons and then blame IT. Now they can’t, and are forced to close the apps themselves.
Maybe a better solution would be to make the buttons inactive for a couple of seconds after opening the dialog so they have time to read and respond to it. The buttons would be disabled and there would be a countdown on them. But I would rather have the option to close them all as a user, personally. To each their own I guess.