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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:54:04+00:00 2026-05-26T20:54:04+00:00

I have a program that I am going to deploy via a Windows installer.

  • 0

I have a program that I am going to deploy via a Windows installer. The program outputs files to a location specified in a app.config file.

Is it possible to change the value of the config file to the path selected during the install?

So the process would be as follows.

  1. User runs windows installer
  2. User selects path to install program
  3. Output variable in app.config changed to location of install
  4. User can then edit the config file to change output variable if they wish to change the output path.

Update: Ok so now I know how to create a custom install process as per this link:
Configure App.config Application Settings During MSI Install

This is fine if you want to just use the standard set of controls but I would like a file chooser for them to be able to choose the output path, how can I do this?

Ok I figured out what I needed to do… Heres the answer…

Add an installer class to the project you want to install as per instructions in the link.

Then override the install method in that class as follows to read the path that that user inputs as install directory..

public override void Install(System.Collections.IDictionary stateSaver)
        {

            base.Install(stateSaver);

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

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

            Configuration config = ConfigurationManager.OpenExeConfiguration(exePath);

            config.AppSettings.Settings["ILPrintExportPath"].Value = targetDirectory;


            config.Save();

        }

Then follow the other stages in the above link 🙂

As Joe said I will have to either ensure the users run the app as an administrator or install outside the program files directory so its not a perfect solution but it does what I need it to do.

  • 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-26T20:54:05+00:00Added an answer on May 26, 2026 at 8:54 pm

    See this article Configure App.config Application Settings During MSI Install which shows how to do this using a C# custom action which uses the standard .Net ConfigurationManager class to open and update the app.config file.

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

Sidebar

Related Questions

We have a program that the installer checks for the existence of a config
I have a program that is going to take a password as input and
I have a python program that is going to eat a lot of memory,
I have a program that creates a Windows user account using the NetUserAdd() API
i have a program(winform) that runs through a lot of files(in the area of
currently I have a disfigured avi file that a program of mine creates. I
I have a program that generates a plain text file. The structure (layout) is
I have a C# program that is running as a CGI app in IIS
I have a program that is going to do some work (in a background
I have a program that requires user input, which I save to a file

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.