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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:59:30+00:00 2026-06-14T06:59:30+00:00

I have created a Installhelper.cs which is inhered from the Installer. Override the Install()

  • 0
  • I have created a Installhelper.cs which is inhered from the Installer.
  • Override the Install() method by using this piece of code(A).

These values that are inserted to the app.config are not available in the [projectName].exe.config file that is created after installation.
I have already added a section as shown below in the app.config manually (B)

data is passed to the installer class but the data is not written to the app.config fields. They remain same in the created configuration file during installation.

Any Help is greatly appreciated. I have spent almost a day on this.

Code A:

[RunInstaller(true)]
public partial class Installation : System.Configuration.Install.Installer
{
    public Installation()
    {
        InitializeComponent();
    }

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

        try
        {
            // In order to get the value from the textBox named 'EDITA1' I needed to add the line:
            // '/PathValue = [EDITA1]' to the CustomActionData property of the CustomAction We added. 

            string userName = Context.Parameters["userName"];
            string password = Context.Parameters["password"];
            string folderPath = Context.Parameters["path"];

            MessageBox.Show(userName);
            MessageBox.Show(password);
            MessageBox.Show(folderPath);

            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
           //config.AppSettings.Settings.Add("userName", userName);
           //config.AppSettings.Settings.Add("password", password);
           //config.AppSettings.Settings.Add("foderPath", folderPath);





            config.AppSettings.Settings["userName"].Value = userName;
            config.AppSettings.Settings["password"].Value = password;
            config.AppSettings.Settings["foderPath"].Value = folderPath;
            config.Save(ConfigurationSaveMode.Full);
            ConfigurationManager.RefreshSection("appSettings");




        }
        catch (FormatException e)
        {
            string s = e.Message;
            throw e;
        }
    }
}

Added section in the app config is
Code B:

<appSettings>
<add key="userName" value="" />
<add key="password" value="" />
<add key="foderPath" value="" />
</appSettings>
  • 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-14T06:59:31+00:00Added an answer on June 14, 2026 at 6:59 am

    Thank you. We had this exact issue and could not figure out why it would not write to the file.
    the only different thing I did was get the path from the Application.

    string path = Application.ExecutablePath;
    Configuration config = ConfigurationManager.OpenExeConfiguration(path);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a module in Magento which takes certain views from customers about
I have created a tab-pane using HAML as shown in my code snippet below
I have created a windows service which is set to start automatically. This service
I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -
I have created an android application that calls (using kSOAP library) a SOAP based
I have created form using ModelForm but its not saving data into database. views.py
We have created a .NET 4 web service, which runs fine on a Windows
I have created a Database Application using Netbeans, GlassFish and JavaDB. Now my controller
I have created a Setup Project for my Project. This project connects to a
Have created a ATL COM project through which I am inserting Menu Items to

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.