More info about how MSI custom actions work behind the scenes

I received a couple of interesting questions about custom actions in response to one of my previous blog entries. So I wanted to explain a little bit more about what is going on behind the scenes. I'm sure many of you have noticed that when a setup is in progress, there are multiple msiexec processes running on your system. You can use a process viewer such as tlist.exe or tasklist.exe to list the msiexec processes that are running on the system along with their command line parameters. Here are the various types of msiexec processes along with example command lines to help you distinguish between them:

  • msiexec /i <product>.msi /l*v install.log - this is the main MSI client process for an installation when it is in progress
  • msiexec.exe /V - this is the Windows Installer service process; the service name is msiserver; in general, the msiserver service will start when an installation begins, and the service will stay running for 10 minutes after the installation completes as an optimization so that the overhead of unloading and reloading the service data does not happen if setups are run one after another
  • msiexec.exe -Embedding <GUID> - this is the custom action server (indicated by the -Embedding switch)

It can be useful to know which msiexec process is which in case you have a custom action that is not working correctly and you want to kill the custom action process but not the overall setup process.

In addition, here are some documents that have been published on MSDN about writing, securing and debugging custom actions that may be useful:

I hope that this info is useful to those of you interesting in writing and debugging setup packages. Please let me know if you have additional questions about how Windows Installer works behind the scenes and I will try to answer them in future blog posts.