I am creating a CustomBA which will replace the existing install shield Bootstrapper( I don't really know what it's called).
We are installing the same number of MSI as the install shield use to do, so no problem in that. All the MSI entries in the ARP are removed, as we are making MSI's Visible="no".
Only the Custom BA entry is available in the ARP along with the Install shield Bootstrapper entry, both having the same name.
So after some research I got to know that Windows Installer XML (WiX) ships the Microsoft.Deployment.WindowsInstaller interop library as part of Deployment Tools Foundation (DTF), which can be used to uninstall the MSI.
I am using the below code to uninstall the MSI.
Microsoft.Deployment.WindowsInstaller.Installer.SetInternalUI(InstallUIOptions.Silent);
Microsoft.Deployment.WindowsInstaller.Installer.EnableLog(InstallLogModes.Info, @"C:\Uninstall.log");
Microsoft.Deployment.WindowsInstaller.Installer.ConfigureProduct(productCode, 0, InstallState.Absent, "");
Issue that I am facing are as mentioned below
Firstly I have to run the CustomBA as Administrator to uninstall the existing MSI else it throw as error "Error 1730.You must be an Administrator to remove this application.". Is there a way to run the CustomBA without Administrator and uninstall the MSI.
While uninstall( when I run the customBA as admin), the above mentioned code also remove's the chain packages with it, which I don't want it to do.
After the uninstallation code has been run it does not remove the MSI entry from the ARP.
I've found these links but I don't know if it's relevant: https://stackoverflow.com/questions/17523974/how-to-uninstall-msi-using-its-product-code-in-c-sharp Checking for successful uninstall
If you need to be admin then you need to be admin. Allowing a limited user to change areas of the system that are restricted would be a security breach.
You used the word "chain", so it looks like that InstallShield setup was a multiple-MSI install, perhaps with embedded UI that is suppressed. So it appears that the previous MSIs were installed as single-product view and it looks like they are all uninstalled, also as a single product view - they all uninstall. That was probably the intention in the first place - to make multiple MSIs appear as a single product, all installed and all uninstalled. Also, if that IS install was a chain of MSIs then surely you are going to replace them all (or upgrade them) anyway, yes? That's what Burn and BAs will do too.
Which MSI's ARP entry? It's not clear from your post which MSI, assuming you may be referring to one of the chained MSIs installed by IS. And are you sure it is an MSI entry that remains? It might be the chained product's entry that was put there by InstallShield, not an MSI entry. Certainly if your uninstall of the MSI worked its ARP entry would be removed, but may need a refresh to see that it's really gone (but that's a Windows issue). Keep in kind that chained MSI products (and often Burn too) will suppress the individual MSI ARP entries in favor of a single entry that encompasses the multiple MSIs.