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

  • Home
  • SEARCH
  • 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 4053610
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:28:09+00:00 2026-05-20T14:28:09+00:00

I have a custom Install method in a project where I’m loading a user’s

  • 0

I have a custom Install method in a project where I’m loading a user’s license code for use in my project. The code looks like this:

public override void Install(IDictionary stateSaver)
{
    base.Install(stateSaver);

    string targetDirectory = Context.Parameters["targetdir"];
    string licenseCode = Context.Parameters["liccode"];

    string exePath = string.Format("{0}prog1.exe", targetDirectory);

    Configuration config = ConfigurationManager.OpenExeConfiguration(exePath);
    config.AppSettings.Settings["LicenseCode"].Value = licenseCode;
    config.Save();
}

What I’m running in to however is that my users are constantly having to re-key their license code in to the “Textboxes (A)” User Interface Dialog that I’ve added. So what I’d like to do is read the registry where the value is stored and pre-populate the installer screen with the stored value.

So here’s what I tried, but this didn’t seem to work … maybe because it’s not fired at the right point in the chain of events.

protected override void OnBeforeInstall(IDictionary savedState)
{
    RegistryKey key;
    string baseKey = "SOFTWARE\\Test\\Prog1";
    try
    {
        key = Registry.LocalMachine.OpenSubKey(baseKey, false);

        Context.Parameters["liccode"] = key.GetValue("LicenseCode").ToString();
    }
    catch(Exception e)
    {
    }

    base.OnBeforeInstall(savedState);
}

Anyone have suggestions on how to approach this?

  • 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-20T14:28:09+00:00Added an answer on May 20, 2026 at 2:28 pm

    You can use a System Search ( AppSearch and RegLocator tables ) to pull the value into a property at the beginning of the install. You shouldn’t need a custom action to do this.

    BTW, VDPROJ and InstallUtil has some serious drawbacks. I would look into factoring most of your installer out into a WiX Merge module and replacing your InstallUtil with DTF ( assuming you can’t eliminate all of your custom actions in the first place )

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

Sidebar

Related Questions

hi i would like to create a custom calendar, this calendar will have custom
I have an install project (running on Windows 7) that launches a custom action
I have created custom attributes for a category in my module's install script like
I have a Setup Project which uses a System.Configuration.Install.Installer Class forhandling some custom actions.
I have a mac with a custom PHP 5 install that built from about
I have custom coded several enterprise applications for mid to large organizations to use
I have a custom validation function in JavaScript in a user control on a
I have a setup project with a custom installer class which launch the application
I have a custom action that runs in the very beginning of my Install
I have custom errors configured in my web.config, but IIS 6.0 is returning the

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.