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 943079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:22:43+00:00 2026-05-15T22:22:43+00:00

action1How do I set a MSI property from within a C# custom action, so

  • 0

action1How do I set a MSI property from within a C# custom action, so far I have this but how do I get the handle?

[DllImport("msi.dll", CharSet = CharSet.Unicode)]
static extern int MsiSetProperty(IntPtr hInstall, string szName, string szValue);

public void SetProperty(string propertyName, string propertyValue)
{
    MsiSetProperty(handle, propertyName, propertyValue);
}

I am calling the CA from WiX with the following line

<CustomAction Id="CA1" BinaryKey="ca1.dll" DllEntry="action1" />

and the action1 looks like this

public class CustomActions
{
    [CustomAction]
    public static ActionResult action1(Session session)
    {
        session.Log("Begin action1");
        SetProperty("xyz", "123");
    }
} 
  • 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-05-15T22:22:44+00:00Added an answer on May 15, 2026 at 10:22 pm

    You should be able to set a property by doing the following:

    public class CustomActions 
    { 
        [CustomAction] 
        public static ActionResult action1(Session session) 
        { 
            string xyzProperty = "XYZ";
    
            session[xyzProperty] = "ABC";
        } 
    } 
    

    See Christopher Painter’s post here:

    http://blog.deploymentengineering.com/2008/05/deployment-tools-foundation-dtf-custom.html

    I’m sure he’ll be along soon to comment on this one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have url: http://site.com/index.php?action=show $_GET['action'] is used in templates to check value of ?action=
Hello to all jQuery enthusiasts and experts!! I currently use on a project this
For example, i can put <g:createLink controller=user action=show /> inside a .gsp file and
I am using the URLRewrite Filter from tuckey ( http://www.tuckey.org/urlrewrite/ ) Now i created
UPDATE: The suggestion of the '' worked around $username. Thanks! But now, the table
Is it possible to instantiate a Controller class within another controller class using the
I have a php page on which I show a jQuery alert when a
I am trying to keep my Ajax call from posting back to the server
i have a problem with my PHP code, i've trying to put some information
How to call main thread ??? i can parse but i cant display data

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.