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

Run Custom Action IF Feature is uninstalled.

Hi there,

i just cant get the correct condition together to run a custom action only if a feature is uninstalled.

I have two Custom Actions. One installs a Service needed by the feature "SCREENrec", the other one deletes it.

My Condition for the installation is:
NOT !SCREENrec=3 AND &SCREENrec=3

Which means: IF the Feature IS NOT installed AND WILL BE installed.
Works fine and dandy, will also install the service correctly if the feature is added via "modify".

For uninstallation i reversed the condition:
!SCREENrec=3 AND NOT &SCREENrec=3

Which should mean: IF the feature IS installed and WILL NOT BE installed.

However, the problem is that, if i install the feature on first time install. It will correctly install the service.
Then i open the modify function and add another feature, (not touching the SCREENrec), it will trigger the uninstall action!
WHY?

Could someone please give me a condition to execute if a specific feature will be installed or will be uninstalled?
Google wasn't quite helpfull..

Thanks in advance,
Johann
Labels (1)
0 Kudos
(2) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

The canonical source of reference information here is the help topic Conditional Statement Syntax, or its related Examples of Conditional Statement Syntax. I believe the problem with your attempted uninstallation condition is that it will only be false when a feature is present and being reinstalled. You probably want to condition on an installed feature being removed (action set to absent: 2).
0 Kudos
johannboehme
Level 3

Thanks!
The second Link had exactly the example i needed!

(&FeatureName=2) AND (!FeatureName=3)

But i fully agree with the comment section below this MSDN Article. It should be documented way better.. 😉
0 Kudos