Execution failed with exit code [1603] – Caching issue with SCCM package
Recently came across the caching issue while deploying a new version of an application via SCCM.
The earlier version that was installed on the user machine required the installation media of earlier version in order to uninstall, which was somehow not available on the machine. It could be due to cron jobs clearing cache in case the machine is running out of memory, or someone may have cleared the cache from ‘Configuration Manager Properties‘ etc on the affected machines.
Error received was as follows –

<![LOG[[Installation] :: Working Directory is [C:\WINDOWS\ccmcache\8j\Files].]LOG]!><time="17:25:14.544660" date="03-04-2024" component="Execute-Process" context="NT AUTHORITY\SYSTEM" type="1" thread="19952" file="Deploy-Application.ps1">
<![LOG[[Installation] :: Executing [C:\WINDOWS\System32\msiexec.exe /i "C:\WINDOWS\ccmcache\8j\Files\Mimecast for Outlook 7.10.1.133 (x86).msi" /quiet /norestart /L*v "C:\WINDOWS\Logs\Software\Mimecast for Outlook 7.10.1.133 (x86)_Install.log"]...]LOG]!><time="17:25:14.544660" date="03-04-2024" component="Execute-Process" context="NT AUTHORITY\SYSTEM" type="1" thread="19952" file="Deploy-Application.ps1">
<![LOG[[Installation] :: Get message for exit code [1603].]LOG]!><time="17:25:23.255660" date="03-04-2024" component="Get-MsiExitCodeMessage" context="NT AUTHORITY\SYSTEM" type="1" thread="19952" file="Deploy-Application.ps1">
<![LOG[[Installation] :: Execution failed with exit code [1603].]LOG]!><time="17:25:23.255660" date="03-04-2024" component="Execute-Process" context="NT AUTHORITY\SYSTEM" type="3" thread="19952" file="Deploy-Application.ps1">
<![LOG[[Installation] :: The installation progress dialog does not exist. Waiting up to 5 seconds...]LOG]!><time="17:25:23.302660" date="03-04-2024" component="Close-InstallationProgress" context="NT AUTHORITY\SYSTEM" type="1" thread="19952" file="Deploy-Application.ps1">
<![LOG[[Installation] :: The installation progress dialog was not created within 5 seconds.]LOG]!><time="17:25:28.344660" date="03-04-2024" component="Close-InstallationProgress" context="NT AUTHORITY\SYSTEM" type="2" thread="19952" file="Deploy-Application.ps1">
<![LOG[[Installation] :: CyberSecurityTool-MimecastforOutlook7.10.1.133 Installation completed with exit code [1603].]LOG]!><time="17:25:28.344660" date="03-04-2024" component="Exit-Script" context="NT AUTHORITY\SYSTEM" type="1" thread="19952" file="Deploy-Application.ps1">
NOTE – Exit Code 1603 translates to “Fatal Error during Installation“.
Manually ran the whole process on my sandbox and identified that the shell script was failing at the point of un-installation of existing version.
In order to overcome the issue, I had to identify :
- The previous installation registry
- The ValueName InstallSource
- The install path specified in the ValueData
- Check if install path exists
- Copy the previous version installer package, if path doesn’t exists
- Create the path and copy the installer package
Below are my three iterations, gradually identified that some boxes had the 64-bit version installed and it was not uninstalling as I was only checking the 32-bit version installation in my initial iteration.
######## ITERATION 01 ########
# Read the Registry Key Value Data
$registryPath = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{MMMMMMMM-EEEE-4444-BBBB-MMMMMNNNNN}"
$valueName = "InstallSource"
$valueData = (Get-ItemProperty -Path $registryPath -Name $valueName).$valueName
# Check if the Path Exists on the Device
$pathExists = Test-Path $valueData
# Copy the mime.exe if Path Doesn’t Exist
$uncPath = "\\Mimecast\Mimecast for Outlook Plugin\7.10.0.72\R01.Interactive\Files\Mimecast for Outlook 7.10.0.72 (x86).msi"
if (-not $pathExists) {
# Create the path if it doesn't exist
New-Item -Path $valueData -ItemType Directory -Force
# Copy mime.exe to the path specified in data key
Copy-Item -Path $uncPath -Destination $valueData -Force
}
######## ITERATION 02 ########
# Check Reg
$registryPath1 = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{MMMMMMMM-EEEE-4444-BBBB-MMMMMNNNNN}"
$registryPath2 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{MMMMMMMM-EEEE-4444-BBBB-MMMMMNNNNN}"
# UNC
$uncPath = "\\Mimecast\Mimecast for Outlook Plugin\7.10.0.72\R01.Interactive\Files\Mimecast for Outlook 7.10.0.72 (x86).msi"
# Flag
$actionTaken = $false
write-Output "Action Taken - FALSE - L174"
# set regPath
if (Test-Path $registryPath1)
{
$regPath = $registryPath1
Write-Output "$regPath"
}
else {
$regPath = $registryPath2
Write-Output "$regPath"
}
$valueName = "InstallSource"
$valueData = (Get-ItemProperty -Path $regPath -Name $valueName).$valueName #-ErrorAction SilentlyContinue
write-Output "$valueData"
$cpExists = Test-Path $valueData
if($cpExists = $true)
{
write-Output "cache path exists"
}
if (-not $cpExists)
{
New-Item -Path $valueData -ItemType Directory -Force
Write-Output "CPath Created"
Copy-Item -Path $uncPath -Destination $valueData -Force
write-Output "Files Copied"
}
######## ITERATION 03 ########
# Check Reg
$registryPaths = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{MMMMMMMM-EEEE-4444-BBBB-MMMMMNNNNN}", "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{MMMMMMMM-EEEE-4444-BBBB-MMMMMNNNNN}"
# UNC
$uncPath = "\\Mimecast\Mimecast for Outlook Plugin\7.10.0.72\R01.Interactive\Files\Mimecast for Outlook 7.10.0.72 (x86).msi"
# Flag
$actionTaken = $false
# Loop through
foreach ($path in $registryPaths)
{
Write-Output "Testing $path "
if (Test-Path $path) {
$value = Get-ItemPropertyValue -Path $path -Name "Installsource" -ErrorAction SilentlyContinue
Write-Output "$value fetched"
if ($null -ne $value) {
if (!(Test-Path -Path $value)) {
New-Item -ItemType Directory -Force -Path $value
Write-Output "CPath Created"
}
Copy-Item -Path $uncPath -Destination $value -Force
$actionTaken = $true
Write-Output "File Copied"
break
}
}
}
if(-not $actionTaken) {
Write-Output "No registry found, no prior installation of MIMECAST on this machine"
}