Windows Installer custom action BEFORE any check
I wrote a custom Windows Installer Action based on a tutorial found here: http://www.codeproject.com/kb/install/msicustomaction.aspx
My custom action is killing a background process with a given name that the user can still open. The reason is that I do not want users to see a warning that this EXE is running and must be closed to continue with the installation. This works great when the MSI goes through the UI sequence as the activity is created in the "InstallUISequence" table like in the tutorial.
However, when the MSI is used silently (right click and select repair or uninstall) then my custom action is not performed of course.
Where do I need to place my custom action so that it runs right away on silent startup?
I tried adding it to the "InstallExecuteSequence" but the "start application" warning is still displayed. Then I tried to reduce the ordinal of my custom action to 5, but that also didn't help.
Note:
I am using Orca to modify an MSI generated from a Visual Studio setup project. Then I use a transform file to apply it.
a source to share
You need to schedule the action twice , once in the UI sequence and once in the Execute sequence, then schedule it to run only on the first sequence that tries to execute it. (for example CustomAction/@execute='firstSequence'
in WiX)
Update: . If you're using Orca, see the documentation on Custom Action Scheduling Options , you'll just need to make sure the bit is msidbCustomActionTypeFirstSequence
set.
a source to share
You have correctly placed the custom action in the "InstallExecuteSequence". Who shows the "app is running" warning? Have you checked if your own action has actually been taken? Does Orca have its individual action as the first action in a sequence? What does the installation log say?
a source to share