Show-InstallationWelcome Defer Behaviour

Attempting to write a script to take advantage of the Show-InstallationWelcome -defer capability.

We have a requirement to check if chrome.exe is running, and if it is, allow the user to defer the installation of the new version until a time which suits them (or x number of defers).

i have created a psdeployment script which does exactly this, using the line below as a pre-install stage, then execute-msi in the installation section.

Show-InstallationWelcome -CloseApps 'chrome' -AllowDeferCloseApps -DeferTimes 10

It seemed to work, and when i deployed the application via SCCM as a required installation, the prompt appeared on my test account, allowing me to defer the installation.

My question is, when will it retry the installation… SCCM software centre says the installation has failed, and didnt retry during the time i was testing.

Is there a custom return code which could be added to account for a deferred installation, making SCCM try again at some point?

Default defer exit code is listed in AppDeployToolkitConfig.xml:
<InstallationDefer_ExitCode>60012</InstallationDefer_ExitCode>

So if i add a custom return code of 60012 to the SCCM application it will understand that?

Also, do you know if its possible to set a the defer deadline and defer times as a switch, aka setting the install command line as deploy-application.exe 10 20/01/2018

You can create your own parameters in Deploy-Application.ps1 and use these variables further on in the script

[Parameter(Mandatory=$false)]
[string]$DeferTimes,
[Parameter(Mandatory=$false)]
[string]$DeferDeadline

Show-InstallationWelcome -CloseApps ‘chrome’ -AllowDeferCloseApps -DeferTimes $DeferTimes -DeferDeadline $DeferDeadline