I have a COM+ application installed on my machine which has two components. This COM+ application was created using an SetupCom.exe
file which was made using C# code some years bac. It used to install and create a COM+ msi file
, but now I don't have access to that code, and I need to remove one component from this COM+ application - which is no longer in use.
So, I searched using google and I found some PowerShell scripts that remove the components from the COM+ application, but they don't create the msi
file. I need this updated COM+ application msi\installer
file so that I can install it on multiple machines.
Below is the Script which removes the component from COM+ application, but doesn't create an updated msi
file.
$comCatalog = New-Object -ComObject COMAdmin.COMAdminCatalog
$appColl = $comCatalog.GetCollection("Applications")
$appColl.Populate()
$app = $appColl | where {$_.Name -eq "COMAPPNAME"}
$compColl = $appColl.GetCollection("Components", $app.Key)
$compColl.Populate()
$index = 0
foreach($component in $compColl) {
if ($component.Name -eq "SOMECOMPONENT.NAME") {
$compColl.Remove($index)
$compColl.SaveChanges()
}
$index++
}