I wrote a Windows Installer custom action based on the tutorial found here: http://www.codeproject.com/kb/install/msicustomaction.aspx
My custom action is killing a background process of a given name which could still be opened by the user. The reason is that I don't want users to see the warning that a given EXE is running and must be closed so that setup can continue. This works fine when the MSI passes through the UI sequence as the action is created in "InstallUISequence" table like in the tutorial.
However, when the MSI is used silently (right-click and select repair or uninstall), then my custom action isn't executed of course.
Where do I have to put my custom action so that it is executed immediately also when run silently?
I tried adding it to "InstallExecuteSequence", but the 'app running' warning is still shown. I then tried lowering the sequence number of my custom action to 5, but this also didn't help.
Note:
I'm using Orca to modify an MSI generated from a Visual Studio setup project. I'm then using the transform file to apply it.
You need to schedule the action twice, once in the UI sequence and once in the Execute sequence, then schedule so it will only run in the first sequence that tries to execute it. (e.g. CustomAction/@execute='firstSequence'
in WiX)
Update: If you're using Orca, then see the documentation on Custom Action Execution Scheduling Options, you'll just need to ensure that the msidbCustomActionTypeFirstSequence
bit is set.
You are rightly placed the custom action in the "InstallExecuteSequence". Who shows the "'app running' warning"? Did you verify that your custom action actually executed? Does Orca shows your custom action as first action in sequence? What says installation log?
来源:https://stackoverflow.com/questions/2721093/windows-installer-custom-action-before-any-validation