I’ve noticed that when when the following options are specified
- CloseApps option is specified, populated with 1 or more processes and one of those processes is running
- AllowDefer and -DeferTimes are specified
For example:
Show-InstallationWelcome -CloseApps 'notepad' -AllowDefer -DeferTimes 3 -CheckDiskSpace -PersistPrompt -BlockExecution -CloseAppsCountdown 3000
I receive two dialogs with defer & continue options.
The first dialog looks like this:
The second dialog looks like this:
I’m perfectly happy & comfortable to go diving into the code, but before I go down that route, I wanted to seek an understanding:
Is this normal & expected behavior?
If yes, would you help me to understand why that is? My brain is struggling to wrap around what I’m seeing:
-
If I click ‘Close Process’ on the first dialog, I don’t get the second.
Why don’t I receive the second dialog?
Why is this path different? -
If I click ‘Continue’ with the process still open, the dialog reappears.
This is normal & expected behavior.
But if I close the process & ‘Continue’ on the dialog, I still get the second.
I already said ‘Continue’ so why does it ask again?
Steps to Reproduce:
- Use stock 3.8.2 toolkit
- Modify first Show-InstallationWelcome dialog to close one process (e.g.: iexplore; notepad etc.) and allow deferrals.
- Launch the process you specified in the close apps in the script & leave it running
- Run Deploy-Application.exe
- Receive first dialog shown above
- Manually close the process
- One of two things happens:
(a) More often than not the first dialog disappears automatically which is great I think or
(b) The dialog stays open log enough for one to click ‘Continue’ to allow the installation the proceed - which is what I want to have happen. - Second dialog appears
The PSADT logs look like this
Text version of the PSADT log follows
|[Pre-Installation] :: Get deferral history...|Get-DeferHistory|10/5/2020 1:47:38 PM|22788 (0x5904)|
|---|---|---|---|
|[Pre-Installation] :: Return fully qualified registry key path [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\PSAppDeployToolkit\DeferHistory\PS_AppDeployToolkitMain_3.8.2_EN_01].|Convert-RegistryPath|10/5/2020 1:47:38 PM|22788 (0x5904)|
|[Pre-Installation] :: Registry key [Registry::HKEY_LOCAL_MACHINE\SOFTWARE\PSAppDeployToolkit\DeferHistory\PS_AppDeployToolkitMain_3.8.2_EN_01] does not exist. Return $null.|Get-RegistryKey|10/5/2020 1:47:38 PM|22788 (0x5904)|
|[Pre-Installation] :: User has [2] deferrals remaining.|Show-InstallationWelcome|10/5/2020 1:47:38 PM|22788 (0x5904)|
|[Pre-Installation] :: Check for running application(s) [notepad]...|Get-RunningProcesses|10/5/2020 1:47:38 PM|22788 (0x5904) <- PSADT checks to see if one of the specified processes is running|
|[Pre-Installation] :: The following processes are running: [notepad].|Get-RunningProcesses|10/5/2020 1:47:39 PM|22788 (0x5904) <- PSADT sees that one of the specified processes is running|
|[Pre-Installation] :: Resolve process descriptions...|Get-RunningProcesses|10/5/2020 1:47:39 PM|22788 (0x5904)|
|[Pre-Installation] :: Prompt user to close application(s) [Notepad]...|Show-WelcomePrompt|10/5/2020 1:47:39 PM|22788 (0x5904) |
|[Pre-Installation] :: User has the option to defer.|Show-WelcomePrompt|10/5/2020 1:47:39 PM|22788 (0x5904) <- PSADT displays the first dialog giving me the option to close the processes, defer or continue|
|[Pre-Installation] :: The running processes have changed. Updating the apps to close: [Notepad]...|Show-WelcomePrompt|10/5/2020 1:47:41 PM|22788 (0x5904) <- I quickly closed the application/process and …|
|[Pre-Installation] :: User selected to continue...|Show-InstallationWelcome|10/5/2020 1:47:46 PM|22788 (0x5904) <- I quickly clicked continue in the first PSADT dialog|
|[Pre-Installation] :: Check for running application(s) [notepad]...|Get-RunningProcesses|10/5/2020 1:47:48 PM|22788 (0x5904) <- PSADT checks to see if one of the specified processes is running|
|[Pre-Installation] :: Application(s) are not running.|Get-RunningProcesses|10/5/2020 1:47:48 PM|22788 (0x5904) <- PSADT correctly confirms the processes are not running! Although, I’m not sure it’s necessary but I am ok with it.|
|[Pre-Installation] :: User has the option to defer.|Show-WelcomePrompt|10/5/2020 1:47:48 PM|22788 (0x5904) <- PSADT displays the second dialog giving me the option to defer or continue. But why? I already clicked continue above. |
|[Pre-Installation] :: User selected to continue...|Show-InstallationWelcome|10/5/2020 1:48:12 PM|22788 (0x5904) <- I click continue again and it actually executes.|
|[Pre-Installation] :: [-BlockExecution] parameter specified.|Show-InstallationWelcome|10/5/2020 1:48:14 PM|22788 (0x5904)|
|[Pre-Installation] :: Create scheduled task to cleanup blocked applications in case installation is interrupted.|Block-AppExecution|10/5/2020 1:48:17 PM|22788 (0x5904)|
|[Pre-Installation] :: Retrieve Scheduled Tasks...|Get-ScheduledTask|10/5/2020 1:48:17 PM|22788 (0x5904)|