Show-InstallationWelcome CloseApps is failing

Topics: Archive - General
Nov 19, 2014 at 9:29 PM
Edited Nov 19, 2014 at 9:29 PM
I use version 3.2.0

The following command is failing:
Show-InstallationWelcome -CloseApps "iexplore,notes,excel,onenote,powerpnt,winword,outlook" -PersistPrompt -CloseAppsCountdown "3600" -AllowDefer -DeferTimes 3
When I only use CloseApps "iexplore" then the command is working as it should, when adding more application to check I get the following error:
[19-11-2014 23:23:17] [Pre-Installation] Checking for running applications [iexplore,notes,excel,onenote,powerpnt,winword,outlook]...
[19-11-2014 23:23:17] [Pre-Installation] The following processes are running: [iexplore,iexplore]
[19-11-2014 23:23:17] [Pre-Installation] Resolving process descriptions...
[19-11-2014 23:23:17] [Pre-Installation] Finished checking running applications.
[19-11-2014 23:23:17] [Pre-Installation] Prompting user to close application(s) [Internet Explorer]...
[19-11-2014 23:23:17] [Pre-Installation] User has the option to defer.
[19-11-2014 23:23:18] [Pre-Installation] User selected to force the applications to close...
[19-11-2014 23:23:18] [Pre-Installation] Stopping Process iexplore...
[19-11-2014 23:23:18] [Pre-Installation] Stopping Process iexplore...
[19-11-2014 23:23:20] [Pre-Installation] Checking for running applications [iexplore,notes,excel,onenote,powerpnt,winword,outlook]...
[19-11-2014 23:23:21] [Pre-Installation] Applications are not running.
[19-11-2014 23:23:21] [Pre-Installation] Finished checking running applications.
[19-11-2014 23:23:21] [Pre-Installation] Cannot bind argument to parameter 'DifferenceObject' because it is null. (at Show-InstallationWelcome, G:\xxxxxx\Package\AppDeployToolkit\AppDeployToolkitMain.ps1: line 2950
at <ScriptBlock>, G:\xxxxxxxxxxx\Package\ComputerRestartScript.ps1: line 118)
[19-11-2014 23:23:21] [Pre-Installation] Displaying Dialog Box with message: [Cannot bind argument to parameter 'DifferenceObject' because it is null. (at Show-InstallationWelcome, G:\xxxxxxxx\Package\AppDeployToolkit\AppDeployToolkitMain.ps1: line 2950
at <ScriptBlock>, G:\xxxxxx\Package\ComputerRestartScript.ps1: line 118)]...
[19-11-2014 23:23:22] [Pre-Installation] Dialog Box Response: OK
[19-11-2014 23:23:22] [Pre-Installation] Invoking UnBlock-AppExecution Function...
[19-11-2014 23:23:22] [Pre-Installation] Removing the Image File Execution Options registry keys to unblock execution of [taskmgr.exe]...
[19-11-2014 23:23:22] [Pre-Installation] Retrieving Scheduled Tasks...
[19-11-2014 23:23:25] [Pre-Installation] Deleting Scheduled Task [ComputerRestartScript_1.0_EN__BlockedApps] ...
[19-11-2014 23:23:25] [Pre-Installation] Working Directory is [C:\Windows\System32]
Any ideas what goes wrong or is it solved in a newer release ?

In above example I had only iexplore open and the other apps (notes,excel,onenote,powerpnt,winword,outlook) are not started.
Then when pressing the Close Apps button resulted in the error message :-(
Nov 25, 2014 at 12:29 PM
I tested with version 3.5.0 but this issue is still there :-(

This command is working:
Show-InstallationWelcome -PersistPrompt -AllowDefer -DeferTimes 3
or
Show-InstallationWelcome -CloseApps "iexplore" -PersistPrompt -CloseAppsCountdown "3600" -AllowDefer -DeferTimes 3

This command is failing:
Show-InstallationWelcome -CloseApps "iexplore,onenote,notes" -PersistPrompt -CloseAppsCountdown "3600" -AllowDefer -DeferTimes 3

So when the -CloseApps contains more then 1 application the follow up line "Show-InstallationRestartPrompt -Countdownseconds 60 -CountdownNoHideSeconds 30" is failing.

Any idea why and can it be solved ?
Nov 25, 2014 at 12:37 PM
UPDATE !!!!

When -CloseApps contains "notes" the command is failing.

The error is:
<![LOG[[Installation] :: Display Dialog Box with message: Error Record:
-------------

Message        : Cannot bind argument to parameter 'DifferenceObject' because it is null.
InnerException : 

FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObjectCommand
ScriptStackTrace      : at Show-InstallationWelcome<Process>, G:\SCCM2012\ComputerRestartScript.1_0.EN\Package\AppDeployToolkit\AppDeployToolkitMain.ps1: line 4673 at <ScriptBlock>, G:\SCCM2012\ComputerRestartScript.1_0.EN\Package\ComputerRestartScript.ps1: line 163

PositionMessage : At G:\SCCM2012\ComputerRestartScript.1_0.EN\Package\AppDeployToolkit\AppDeployToolkitMain.ps1:4673 char:173
                  + ... fferenceObject $notesPathExes -IncludeEqual | Where-Object { ($_.SideIndicator - ...
                  +     
Developer
Nov 25, 2014 at 6:51 PM
It looks like line 4671 failed to find any .exe files in the directory where notes is supposed to be installed. Because $notesPathExes is $null, the Compare-Object command fails on next line. If there truly are no .exe files in that directory, then we would have to add a check that says to only process line 4673 and 4674 if $notesPatheExes is not null by adding conditional: If ($notesPatheExes) { LINE 4673, 4674 }
Nov 26, 2014 at 8:28 AM
mmashwani wrote:
It looks like line 4671 failed to find any .exe files in the directory where notes is supposed to be installed. Because $notesPathExes is $null, the Compare-Object command fails on next line. If there truly are no .exe files in that directory, then we would have to add a check that says to only process line 4673 and 4674 if $notesPatheExes is not null by adding conditional: If ($notesPatheExes) { LINE 4673, 4674 }
Yes that seems to work...maybe solution for future version of package ?
So when I use the -CloseApps option and configure ´notes´ without having Notes, it should not crash ! A check should be build into it.

Please add that to newer version of package.

tnx
Developer
Nov 26, 2014 at 8:46 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.