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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:57:23+00:00 2026-05-29T10:57:23+00:00

My installer has a custom action which contacts a windows service and set some

  • 0

My installer has a custom action which contacts a windows service and set some parameters.
In order to successfully use the service, it must be run with the elevated privileges.

In the first time install when a user clicks on the Install button, it is presented with the UAC prompt and install completes successfully. However, when a user decides to change the product(add new feature), call to the service will fail! This happens because installer is not run in the privileged mode. When I start the installer from a command prompt with administrative rights, change operation also completes successfully.

I’ve came across the following article which suggests creating a bootstrapper. Is there any easier way to accomplish this?

Did I implement the custom action correctly?. Here’s the custom action code

     <CustomAction Id='SetParams' BinaryKey='Setup.CustomAction' DllEntry='SetParameters' Execute='deferred' Impersonate='no' Return='asyncWait'/>
<Binary Id='Setup.CustomAction' SourceFile='$(var.CustomActionDll)' />

<InstallExecuteSequence>
  <Custom Action='SetParams' Before='InstallFinalize'><![CDATA[REMOVE <> "ALL"]]></Custom>
</InstallExecuteSequence>

Update: After Cosmin’s comment, I realized I was accessing the session data in CA. SetParams CA uses dynamic properties generated in the UI sequence. To access data in deferred CA, I’ve created an immediate CA which dynamically extracts this data and puts it in the CustomActionData.

<CustomAction Id='SaveParams' BinaryKey='Setup.CustomAction' DllEntry='SaveParameters' Execute='immediate'  Return='check'/>
<CustomAction Id='SetParams' BinaryKey='Setup.CustomAction' DllEntry='SetParameters' Execute='deferred' Impersonate='no' Return='check' />

<Custom Action='SaveParams' Before='SetParams'><![CDATA[REMOVE <> "ALL"]]></Custom>
  <Custom Action='SetParams' Before='InstallFinalize'><![CDATA[REMOVE <> "ALL"]]></Custom>

Following is the part of SaveParameters method in the custom action

propertyName = moduleInfo.GetPropertyName(moduleParameter.Name);
customActionData.Append(string.Format(CultureInfo.InvariantCulture, "{0}={1};", propertyName, session[propertyName]));

This approach works!
When started from admin cmd session[propertyName] returns the correct value, but when I run the installer change from non-elevated cmd prompt, I cannot access the property values in the immediate CA – session[propertyName] returns empty string ?!

I can access the (static) property defined in wxs file

<Property Id="INSTALL" Secure="yes" /> 

but not the one’s I’ve added in some other immediate custom action in the UI sequence like this

session[property] = parameters[paramcount++];
  • 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-29T10:57:23+00:00Added an answer on May 29, 2026 at 10:57 am

    Deferred custom action with no impersonation attribute set will ensure that the CA is run in elevated mode.

    I’ve added a new question to address the other issue which emerged.

    Solution to accessing dynamic property value issue

    1. Immediate action which reads properties to be moved from execution
      sequence to UI sequence
    2. Actions in execution phase can access data
      from secure properties as stated in the question. If the properties
      are dynamically created in CA, they must be added to
      SecureCustomProperties system property. Separator char is ‘;’.”
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a windows service setup project on VS2008, it has a custom action
I'm creating a msi based installer (using InstallShield) that has a custom action to
Has anyone been able to get Windows Installer to use the InstallUISequence table during
I have a Setup Project which uses a System.Configuration.Install.Installer Class forhandling some custom actions.
I have a MSI installer custom action which calls Process.Start() to run a batch
We install a windows service from a custom action as described here: CodeProject Every
I have an install project which has a custom action that executes a VBScript
My original product has a custom action which does not have the NOT Installed
I have a windows.bat file which is actually my custom installer. When everything is
I have a .NET Setup Project to which I've added a custom installer action.

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.