How to update a COM+ applications and create its msi file using PowerShell?
Asked Answered
S

1

1

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++
 }
Spadix answered 5/8, 2018 at 14:1 Comment(0)
C
1

Writing the below, I remembered having written something similar before. Here it is: Would this method of installing COM+ work?


There is support in all major deployment tools (thee main bullet point links) to do COM+ deployment. WiX may provide the most flexible features for COM+ installation, but I have never used them.

COM+ deployment has always been a bit strange to deal with. Despite all my years doing deployment I have only done it a few times. And several times I have had a lot of problems with it. I even had a guy make a basic "hello world" COM+ application that I sent to a deployment vendor to illustrate how they did not do COM+ properly. No luck.

Typically I have ended up exporting a COM+ installer MSI from the Component Services (Launch suggestion: Windows Key + tap R type comexp.msc and press Enter). After setting up an application as you want it running, you right click it in the list and export an MSI file (in your case I guess it should already be set up):

Exporting COM+ application

This exported MSI file is not - shall we say - the greatest thing since sliced bread. If you want to modify it, it will quickly break in some fashion. There is an undocumented APL file in there with COM+ settings that I never understood how to handle on my own. Just use the MSI as it is - if you can.


Some Links: I took it a bit far with these links, just go for the bolded ones.

Chaisson answered 5/8, 2018 at 18:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.