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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:36:22+00:00 2026-05-13T10:36:22+00:00

I have 2 projects in my solution A Windows service Its Setup project I

  • 0

I have 2 projects in my solution

  1. A Windows service

  2. Its Setup project

I need that my ProjectInstaller : System.Configuration.Install.Installer‘s method called OnAfterInstall to get the ProductName from the Setup Project. How do I do that?

  • 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-13T10:36:22+00:00Added an answer on May 13, 2026 at 10:36 am

    Within your setup project right click project and select View > Custom Actions. Add a custom action. Now select Add Output, select your web service project, and click OK.

    Now select your custom action and set the CustomActionData property to contain something like /ProductName=[PRODUCTNAME] /whateveryouwant=[Whateveryouwant] (note that these are key-value pairs; i.e. to access the product name, ProductName is the key and the value is PRODUCTNAME).

    Note that CustomActionData contains the parameters that will be passed to your installer class. The PRODUCTNAME is the property name associated with the input control in the user interface dialog, and so in your case you would prompt user for Product Name within yor installer. So the label is “Product Name” and the corresponding property should be set as PRODUCTNAME (obviously you could change this, but the most important thing to note is that the UI property name must be the same as the property name in the CustomActionData) for this example to work.

    Now within your installer class you can get product name by doing

    public override void Install(IDictionary stateSaver)
    {
          // If you need to debug this installer class, uncomment the line below
          //System.Diagnostics.Debugger.Break();
    
           string productName = Context.Parameters["ProductName"].Trim();
    
           string whateveryouwant = Context.Parameters["whateveryouwant"].Trim();
    }
    

    note i included the commented code //System.Diagnostics.Debugger.Break(); which you can comment in so that you can debug the installer class.

    hope this helps.

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

Sidebar

Related Questions

I have a Windows forms project and a Web Service project in my solution,
I have a solution with several projects. One of them is a setup project.
I have 3 projects in my solution that I want to deploy. Is there
I have 3 projects in my solution that I want to deploy. Is there
I have a solution containing several projects that have migrated from VS 2003, 2005,
I have a number of projects in a solution file that have unit tests
I'm working in VS 2008 and have three projects in one solution. I'm debugging
I have several projects and a website in a large asp.net solution. In some
I have several web application projects in one solution. When I start debugging one
I have a Visual Studio Solution. Currently, it is an empty solution (=no projects)

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.