Is there anyway to run the v4 script interactively if say, the apps we have chosen to close are not running but the user is logged on? If we run auto mode, the script runs silently which we don't want really.
At the moment, I have to force the interactive installs but then we get 1602 exits if no user is logged on (because we forced the interactive installs) but we are happy for these to be noninteractive.
This Bypasses process detection logic when DeployMode is set to Auto.
It's used to show the Installation Welcome UI even if there are no processes to close.
I'm running into the same issue with PSADT 4.1.3 as Gordy_B.
I tried adding "NoProcessDetection = $true" as you described to the $adtSession variable. I also tried adding it to the Open-ADTSession call as a parameter.
That's odd. I've been testing adding NoProcessDetection, and it worked fine either as NoProcessDetection = $true within the $adtsession declaration near the top, or added to the end of the line near the bottom:
$adtSession = Open-ADTSession @adtSession@iadtParams -PassThru -NoProcessDetection
I've decided the default ProcessDetection isn't quite right for us. We've always had our own method in v3 for checking if a process is (and therefore later 'was') running. Then based on that, if a process was running we can show install progress and prompts etc, else just Show-ADTBalloonTip at the start and end of the deployment for a subtle indication that something is going on for the end user. I should add, I've only got balloon tips working from today, having tested a new module that @mjr4077au asked me to test, and I'm delighted with the results.
I've also just introduced a boolean variable to 'alwaysShowUI', which we can set (as needed) for each script that will "force" Progress/Prompt boxes to be displayed even if a process wasn't running at the start.
For example... (and I've assumed you've already enabled NoProcessDetection)
# Variables
$processWasRunning = ((Get-ADTRunningProcesses $adtSession.AppProcessesToClose).Count -gt 0)
$alwaysShowUI = $false # set to $true to always show progress/prompts etc
# Pre-Installation
If ($processWasRunning -or $alwaysShowUI) {
Show-ADTInstallationProgress @saipParams
} else {
Show-ADTBalloonTip -BalloonTipTitle $adtSession.InstallTitle -BalloonTipText 'Install in progres...'
}
I suppose alternatively, I could move $alwaysShowUI to be a switch within the parameters at the top, then it could be added when needed to the command line. e.g.
Invoke-Application.exe Install -AlwaysShowUI
Edit: And of course, when no user is logged on, setting "alwaysShowUI = $true" is irrelevant (and won't make the script fail) as PSADT will run silently, as always.
Thank you. I re-tested the behavior using the clean original PSADT 4.1.3 and it IS working as expected. I must have introduced this unexpected behavior through some of the customization code.