cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jwhitwill
Level 3

Custom action on final removal of merge module (or shared component)

I've created two custom actions in a merge module project. One performs an action involved in installing the components, the other performs an action to remove them. Both are a part of the ModuleInstallExecuteSequence table. The sequence numbers I associated with them are 6601 for the install step and 1501 for the removal step (somewhat arbitrary I wasn't sure what the best practice would have been in this case). For the install step I have the condition "Not Installed" and for the removal step I have the condition "Installed".

My question is regarding the removal step. If this merge module is used by more than one MSI used to install the software on a PC (the components are shared), how can I have my removal logic only executed when its associated components are no longer being used? As it stands today, my action is called regardless of whether the components are being removed or left because of dependencies from other installations. Do I have to implement the reference counting manually or is there a way to accomplish this automatically using conditions built into MSI?
Labels (1)
0 Kudos
(1) Reply
KathyMorey
Level 10

Take a look at the help topic on conditional syntax. It shows how to check either the state or action to be taken on components and features. That may be what you're looking for.
0 Kudos