cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
amarold
Level 5

When to run custom action ?

I have a custom action that runs devcon to install a device driver. When in the install sequence am I supposed to put it ? I tried putting it in a couple places like 'After InstallServices' but it always fails with an error about something missing, and if I look in Windows explorer at the install dir before I acknowledge the error popup, there's no installed files yet. The only place so far I've been able to get it to works is if I put it after InstallFinalize. Should the files be in place anywhere in the sequence after InstallFiles ?
Labels (1)
0 Kudos
(5) Replies
JesseBearden
Level 5

Your custom action is most likely set to "Immediate Execution". If you want it to be in the transacted phase of the installation, then you probably want it to be set to "Deferred Execution".

See here for more info.

Keep in mind that custom actions run in deferred execution don't have the same access to properties that ones run in Immediate Execution do. You can search for more info on that if it becomes an issue.
0 Kudos
franklint79
Level 4

You can set it as Deferred in System Context and sequence it after InstallFiles.

Hope this helps.
0 Kudos
amarold
Level 5

Thanks for the pointers. I got it to work using Deferred Execution. Related question: how do I prevent the action from running during an uninstall ? It keeps trying to install the driver during the uninstall and causing an error.
0 Kudos
Dan_Galender
Level 10

You can put a condition on your custom action.


  • Not REMOVE="ALL" will run only if the product is not being completely uninstalled (first time install and maintenance).

  • Not Installed will run only when the product is being installed and is not already installed (first time install only).

  • In addition, you can use conditions utilizing the Feature and Component State values (see the bottom of the help topic "Conditional Statement Syntax") for finer control.
.
0 Kudos
amarold
Level 5

Thanks, the not remove=all did the trick.
0 Kudos