I’m using PSADT v4.0.6, and when I run the following cmdlet, it neither closes the specified processes nor proceeds with the auto-installation.
My expectation: if the user does not click 'Install Now' or 'Defer' before the countdown ends, the installation should automatically start.
Show-ADTInstallationWelcome -CloseProcesses 'iexplore','msedge' -AllowDefer -DeferTimes $DeferTimes -CheckDiskSpace -PersistPrompt -CloseProcessesCountdown 20 -ForceCloseProcessesCountdown 20 -AllowDeferCloseProcesses
Am I missing something in the syntax or in how this parameter works?
I think it is the process list that is causing you issues, You might want to have a look at example 2 or 4 here:
Yes, I’ve updated the cmdlet, but I’m still seeing the same behavior — no auto-install:
Show-ADTInstallationWelcome -CloseProcesses @{ Name = 'msedge' }, @{ Name = 'Weasis' } -AllowDefer -DeferTimes $DeferTimes -CheckDiskSpace -PersistPrompt -CloseProcessesCountdown 10 -ForceCloseProcessesCountdown 10 -AllowDeferCloseProcesses
Also, I get the following warning (which I forgot to mention earlier):
"[2025-08-21 13:01:49.242] [Finalization] [Close-ADTSession] [Warning] :: [WeasisDICOMViewer_4.6.2.0_EN_01] install completed with exit code [1618]."
exit code [1618] normally occurs when another MSI install is still in progress (so the current MSI install can not complete until the first one has) - I'm unsure how the WeasisDICOMViewer MSI install works - it may be installing some dependancies
I am unsure if you are relying on the Zero config setup to do your MSI install or not? I have seen some guidance on here about telling the (Executable) installer to wait for all child processes to complete, before it finishes the install. But this isn't an option for MSI installers.
You might want to have a look at the example here for installing an MSI (In case you need to parse some extra parameters):
N.B. Here is some background on error code 1618: Understanding MSI Error Code 1618 | Knowledge Base
This would have worked fine, you don't need to use the hashtable constructor for these unless you truly want to.
kabilan_Jayaraman:
Also, I get the following warning (which I forgot to mention earlier):
"[2025-08-21 13:01:49.242] [Finalization] [Close-ADTSession] [Warning] :: [WeasisDICOMViewer_4.6.2.0_EN_01] install completed with exit code [1618]."
I concur with Adrian regarding this. It's not a toolkit issue, there's something else going on. Please review the adjacent msiexec.exe log and see why the MSI won't install.
2 Likes
Thanks for the reply, but I’m not installing an MSI or EXE. I only copy some files to the Program Files directory, create a desktop shortcut, and add entries to the uninstall registry hive.
Here's the code
Show-ADTInstallationWelcome -CloseProcesses @{ Name = 'msedge' }, @{ Name = 'Weasis' } -AllowDefer -DeferTimes $DeferTimes -CheckDiskSpace -PersistPrompt -CloseProcessesCountdown 10 -ForceCloseProcessesCountdown 10 -AllowDeferCloseProcesses
Show-ADTInstallationProgress
if (Test-Path $LogDir) {
Write-ADTLogEntry -Message "Custom log directory exists: $LogDir" -Severity 1
} else {
Write-ADTLogEntry -Message "Custom log directory does not exist: $LogDir" -Severity 3
}
Write-ADTLogEntry -Message "Starting pre-installation cleanup..." -Severity 1
if (Test-Path $regKey) {
Write-ADTLogEntry -Message "Removing registry key: $regKey" -Severity 1
Remove-Item -Path $regKey -Recurse -Force
} else {
Write-ADTLogEntry -Message "Registry key not found: $regKey" -Severity 2
}
if (Test-Path $DestWeasisFolder) {
Write-ADTLogEntry -Message "Removing folder: $DestWeasisFolder" -Severity 1
Remove-ADTFolder -Path $DestWeasisFolder
} else {
Write-ADTLogEntry -Message "Folder not found: $DestWeasisFolder" -Severity 2
}
if (Test-Path $shortcutPath) {
Write-ADTLogEntry -Message "Removing shortcut: $shortcutPath" -Severity 1
Remove-ADTFile -Path $shortcutPath
} else {
Write-ADTLogEntry -Message "Shortcut not found: $shortcutPath" -Severity 2
}
##================================================
## MARK: Install
##================================================
$adtSession.InstallPhase = $adtSession.DeploymentType
Write-ADTLogEntry -Message "Copying Weasis files to $folderPath..." -Severity 1
$SourceWeasisFolder = Join-Path $adtSession.DirFiles '\Weasis'
Copy-ADTFile -Path $SourceWeasisFolder -Destination $folderPath -Recurse
if (Test-Path $folderPath) {
Write-ADTLogEntry -Message "Copied Weasis files: $folderPath" -Severity 1
} else {
Write-ADTLogEntry -Message "Folder not found after copy: $folderPath" -Severity 3
}
Write-ADTLogEntry -Message "Copying shortcut to desktop..." -Severity 1
Copy-ADTFile -Path "$folderPath\Weasis\Weasis DICOM Viewer.lnk" -Destination 'C:\Users\Public\Desktop'
if (Test-Path $shortcutPath) {
Write-ADTLogEntry -Message "Copied shortcut: $shortcutPath" -Severity 1
} else {
Write-ADTLogEntry -Message "Shortcut not found: $shortcutPath" -Severity 2
}
# Registry path for 64-bit app
$RegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WeasisDICOMViewer"
Write-ADTLogEntry -Message "Creating registry key: $RegPath" -Severity 1
New-Item -Path $RegPath -Force | Out-Null
Write-ADTLogEntry -Message "Setting ARP registry values..." -Severity 1
Set-ItemProperty -Path $RegPath -Name "DisplayName" -Value $adtSession.AppName
Set-ItemProperty -Path $RegPath -Name "DisplayVersion" -Value $adtSession.AppVersion
Set-ItemProperty -Path $RegPath -Name "InstallLocation" -Value 'C:\Program Files\Weasis'
Set-ItemProperty -Path $RegPath -Name "UninstallString" -Value ''
Set-ItemProperty -Path $RegPath -Name "DisplayIcon" -Value "$folderPath\AppIcon.ico"
Set-ItemProperty -Path $RegPath -Name "InstallDate" -Value (Get-Date -Format "yyyyMMdd")