Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Conditional Custom Action


1 reply to this topic

Rambler

Rambler
  • Members
  • 1 posts

Posted 11 February 2004 - 21:58

I want to execute a custom action ONLY when a particular Component is Installed.. ie when the component's KEY file dermines that the components files should be installed, run the custom action... and when the components KEY file determines the component does NOT need to be installed then, do NOT run the custom action... how do I accomplish this?

Thanks

hteichert

hteichert
  • Members
  • 158 posts

Posted 13 February 2004 - 10:23

For a detailed description on how to create conditions look in the Windows Installer documentation, chapter "Conditional Statement Syntax".
Especially for your problem, the solution would be (when installed means locally installed and not run from source):
($MyComponent=3) AND Not (?MyComponent=3)

As an excerpt from windows installer help:
The Prefixes mean:
CODE
Symbol type          Prefix  Value
Installer property   (none)  Value of property (Property table).
Environment variable  %      Value of environment variable.
Component table key   $      Action state of the component.
Component table key   ?      Installed state of the component.
Feature table key     &      Action state of the feature.
Feature table key     !      Installed state of the feature.


The state values mean:
CODE
State                 Value Meaning
INSTALLSTATE_UNKNOWN    -1 No action to be taken on feature or component.
INSTALLSTATE_ADVERTISED 1  Advertised feature. This state is not available for components.
INSTALLSTATE_ABSENT     2  Feature or component not present.
INSTALLSTATE_LOCAL      3  Feature or component on local computer.
INSTALLSTATE_SOURCE     4  Feature or component run from source.


h.teichert-ott