Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8146443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:00:00+00:00 2026-06-06T14:00:00+00:00

How are properties set on CustomActionData to be retrieved by a deferred custom action?

  • 0

How are properties set on CustomActionData to be retrieved by a deferred custom action?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:00:02+00:00Added an answer on June 6, 2026 at 2:00 pm

    Deferred custom actions can not directly access installer properties (reference). In fact, only CustomActionData property

    session.CustomActionData
    

    and other methods and properties listed here are available on the session object.

    Therefore, for a deferred custom action to retrieve a property such as the INSTALLLOCATION, you have to use a type 51 custom action — i.e. a set-property custom action — to pass that information along and you’ll consume the data from the CustomAction’s C# code through session.CustomActionData. (see reference & reference)

    Below is an example of a type 51 custom action (CustomAction1) that will set a property that can be retrieved in CustomAction2.

    <CustomAction Id="CustomAction1"
                  Property="CustomAction2"
                  Value="SomeCustomActionDataKey=[INSTALLLOCATION]"
    />
    

    Notice that Property attribute name is CustomAction2. This is important. The Property attribute’s value of the type 51 action must be equal/identical to the name of the custom action that is consuming CustomActionData. (see reference)

    Notice the name SomeCustomActionDataKey in the Value attribute key/value pair? In your C# code in the consuming custom action (CustomAction2), you’ll look-up that property from CustomActionData by using the following expression:

    string somedata = session.CustomActionData["SomeCustomActionDataKey"];
    

    The key that you use to retrieve the value from CustomActionData is NOT the value in Property attribute of the type 51 custom action, but the key from the key=value pair in the Value attribute. (Important takeaway: CustomActionData is populated by setting an installer property that has the same name as the Id of the consuming custom action, but CustomActionData keys are NOT installer properties.) (see reference)

    In our scenario the consuming custom action is a deferred custom action defined somewhat like the below:

    <Binary Id="SomeIdForYourBinary" SourceFile="SomePathToYourDll" />
    <CustomAction Id="CustomAction2"
                  BinaryKey="SomeIdForYourBinary"
                  DllEntry="YourCustomActionMethodName"
                  Execute="deferred"
                  Return="check"
                  HideTarget="no"
    />
    

    Configuring the InstallExecuteSequence

    Of course, the consuming custom action (CustomAction2) must run after the type 51 custom action (CustomAction1). So you’ll have to schedule them like this:

    <InstallExecuteSequence>
      <!--Schedule the execution of the custom actions in the install sequence.-->
      <Custom Action="CustomAction1" Before="CustomAction2" />
      <Custom Action="CustomAction2" After="[SomeInstallerAction]" />      
    </InstallExecuteSequence>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My installer has a custom action which contacts a windows service and set some
How does one properly read values of custom control properties set via design time?
I have been trying to build a user control with some custom properties set
I have a ComboBox control with the DropDownStyle properties set to DropDownList . Once
i've no idea how i can set properties for an iframe that's positioned 300px
I have some logic that depends upon two properties being set, as it executes
The ExpandoObject class being added to .NET 4 allows you to arbitrarily set properties
I'm trying to create a method that will allow me to set properties within
I have a simple website with a master-page. To set properties to elements on
How do i set Border properties on a TextBox Control in Winforms so that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.