This project is read-only.

CloseAppsCountdown ignoring remaining Deferrals

Topics: Archive - General
Jan 12, 2015 at 10:24 PM
Just started testing this toolkit (v 3.5) to integrate your notification functions into our own installation script library (very nice job!).

However, testing the option to close apps after a countdown seems to be ignoring the Defer count.
Searching the discussions, it seems likely that the change for this thread:
https://psappdeploytoolkit.codeplex.com/discussions/551194
Broke the intended functionality

My command-line is this:

Show-InstallationWelcome -CloseApps "notepad" -PersistPrompt -CloseAppsCountdown 30 -AllowDefer -DeferTimes 3

But even though I have deferalls remaining, the CloseApps countdown starts and closes my apps and proceeds with the install unless I press the Defer button first.
Jan 12, 2015 at 10:35 PM
Just downloaded v3.2 and tested and functions as expected - CloseApps countdown does not get invoked until deferrals = 0
Jan 12, 2015 at 11:07 PM
Problem seems to be in function Show-WelcomePrompt, line 4789:
        ## If deferral is being shown and 'close apps countdown' or 'persist prompt' was specified, enable those features.
        If ($showDefer) {
            If ($closeAppsCountdown -gt 0) {
                Write-Log -Message "Close applications countdown has [$closeAppsCountdown] seconds remaining." -Source ${CmdletName}
                $showCountdown = $true
            }
            If ($persistPrompt) { $persistWindow = $true }
        }
This should be "if deferral is NOT being shown" and separate from $persistPrompt I think. I changed it to:
        If (!($showDefer)) {
            If ($closeAppsCountdown -gt 0) {
                Write-Log -Message "Close applications countdown has [$closeAppsCountdown] seconds remaining." -Source ${CmdletName}
                $showCountdown = $true
            }
        }
        If ($showDefer) {
            If ($persistPrompt) { $persistWindow = $true }
        }
and that seems to be behaving
Developer
Jan 13, 2015 at 9:09 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.