CustomActionData Property Home
This page is specific to:.NET Framework Version:1.12.03.54.0
Deployment in Visual Studio
CustomActionData Property

Specifies additional data that can be evaluated by a custom action during installation. Custom actions are run at the end of an installation and cannot access information about the installation; the CustomActionData property allows you to store information about the installation that can be read by the custom action.

For example, if your deployment project included a file search with a Property property of FILESEARCH1, you could pass the value returned by the file search by setting the CustomActionData property to /MyFile=[FILESEARCH1]. In your custom action, you could query the MyFile property to retrieve the value.

Remarks

The format for the CustomActionData property depends on the type of the custom action.

  • For custom actions that are installation components (ProjectInstaller classes), the CustomActionData property takes a format of /name=value. Each name must be unique and have only one value. Multiple values must be separated by a single space: /name1=value1 /name2=value2. If the value has a space in it, it must be surrounded by quotation marks: /name="a value".

    Windows Installer properties can be passed using the bracketed syntax: /name=[PROPERTYNAME]. For Windows Installer properties such as [TARGETDIR] that return a directory, in addition to the brackets you must include quotation marks and a trailing backslash: /name="[TARGETDIR]\".

    NoteNote:

    In order for a custom action to be treated as an installation component, the InstallerClass property must be set to true. For more information, see RunInstallerAttribute.

  • For all other custom actions (.exe, .dll, or script), there are no format requirements. You can pass any string in the CustomActionData property, since you must parse it yourself in your custom action.

Troubleshooting

If your custom action relies on customers typing a path to an installation folder, you may see a ArgumentException error message. This may be related to an invalid directory or URL.

To prevent this error message, replace the backslash with a space: /name="TARGETDIR] ". Then, parse the value and create a fully qualified path using the Combine method.

See Also

Tasks

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View