StackOverflow: Removal of Advertised Product Information.

I've been so heads down running FireGiant that my attendance on StackOverflow has decreased signifcantly. However, someone who answers a fair number of MSI related questions on StackOverflow asked me a question to clarify his understanding. I started to answer but realized that it could be a useful blog post. So let's try to answer "Remove information about installed product".

First of all, it isn't clear why the questioner wants to know when the advertised product information is removed. So for the sake of this discussion I'm going to assume you're here just because you'd like to understand a little bit more about how the Windows Installer works.

Second, if you don't know what advertisement is then this isn't the blog post for you. You might start by digging into the MSI SDK Advertisment documentation.

With the context set, let's get to the answer.

When you advertise an MSI, like msiexec.exe /jm my.msi, the Windows Installers sets the ACTION property to ADVERTISE. The advertise action causes the Windows Installer to process the AdvtExecuteSequence instead of the sequence you are likely more familar with InstallExecuteSequence.

That fact is probably what leads to the question. If you look at the allowed actions in the AdvtExecuteSequence you'll notice that there are only "publish" type actions, no "unpublish" type actions. That's an important hint. The AdvtExecuteSequence is not used for uninstall.

In fact, that makes complete sense because to remove an advertised product you run msiexec /x my.msi. The /x basically sets REMOVE property to ALL then runs the InstallExecuteSequence.

Awesome, so the answer is that there must be an UnpublishProduct action in the InstallExecuteSequence that removes the advertised product. Right?

Uhh, wait. There is no UnpublishProduct. So, uhh, how does the published product information get removed?

I have to admit. I had to go digging to find the actual answer. Can you guess? We know it has to be an action in the InstallExecuteSequence, which admittedly does not narrow down the list terribly much. It also probably should be late in the transaction such that a hard failure doesn't put the product in a state where where the Windows Installer thinks it is removed but still has stuff from the product is still left on the machine.

That line of thinking is what led me to the answer. Turns out it is actually documented in the MSI SDK. Ladies and gentlemen, I present to you the remover of all product information: InstallFinalize.

Well, that was fun. Now get back to coding. You know I am.

FireGiant provides dedicated support for the WiX toolset. Ever wish you could get your WiX questions answered immediately with the technical detail that you find in the blog posts here? You can with FireGiant!

Send a comment

Thank you for sending your comment.