There is a bug in PowerShell module in the method AddDeprecateUpdate. The following two blocks of code don't work the same way.
Code: Select all
$advinst = New-Object -ComObject AdvancedInstaller
$xUpdateProject = $advinst.LoadProject($UpdateProjectFilePath)
# Replace all previous updates --> This works correctly
foreach ($update in $xUpdateProject.Updates) {
if ($update.Installer.ProductVersion -ne $releaseVersion) {
$NewUpdate.AddReplaceUpdate($update)
}
}
# Deprecate all previous updates --> This breaks the configuration and generates wrong entries in the AIP file
foreach ($update in $xUpdateProject.Updates) {
if ($update.Installer.ProductVersion -ne $releaseVersion) {
$NewUpdate.AddDeprecateUpdate($update)
}
}
Please confirm the correct way of adding the deprecated updates if the above code is wrong.