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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:35:32+00:00 2026-05-26T04:35:32+00:00

How do you modify the machine.config using Inno setup? I have looked at the

  • 0

How do you modify the machine.config using Inno setup?

I have looked at the documentation and searched google and can’t find anything so it makes me feel like I’m asking the wrong question or missing something obvious.

I’m guessing that if it is not obvious then it requires writing a small script to do it. If that is the case, does anyone have a good example?

Edit: machine.config is an xml formatted file used to hold machine level configuration settings for .net applications.

  • 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-26T04:35:33+00:00Added an answer on May 26, 2026 at 4:35 am

    It’s been a while since I last used Inno Setup, but I think you have two possibilities. The best, and simplest would be to write a small .exe app that your installer will run after the installation & uninstallation has finished:

    [Files]
    Source: "mconfig.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall; 
    
    [Run]
    Filename: "{tmp}\mconfig.exe"; Parameters: "/inst"; Flags: waituntilterminated runhidden
    
    [UninstallRun]
    Filename: "{tmp}\mconfig.exe"; Parameters: "/uninst"; Flags: waituntilterminated runhidden
    

    Now, I don’t know what language/or what modification you need to do, but a simple c# console-app that does some simple modification of the machine.config could look like this:

    using System;
    using System.Configuration; // Note: Also add a reference to "System.Configuration.dll"
    
    public class Program {
        static void Main(string[] args) {
            Configuration config = ConfigurationManager.OpenMachineConfiguration();
            if (args.Length > 0) {
                if (args[0] == "/inst") {
                    config.AppSettings.Settings.Add("Test", "Value");
                } else if (args[0] == "/uninst") {
                    config.AppSettings.Settings.Remove("Test");
                }
                config.Save();
            }
        }
    }
    

    Now, another way to do this is to write this as a function, in the Inno Setup built-in “Pascal scripting” language (if you have previous experience in Turbo/Borland Pascal or Delphi that could be fun to revive). Having tried it myself, I would however recommend against that, since it’s quite limited, but may be good for other (less complex) things.

    Hope this helps!

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

Sidebar

Related Questions

In a .NET windows application to to modify a remote machine config file that
I've found that the best way to modify machine.config is to use the XmlConfig
I'm creating a windows service on a windows 2003 machine, using dsofile to modify
If I modify or add an environment variable I have to restart the command
How can I modify a SharePoint site so that versioning is turned on by
I have a strange situation using asp ajax chart controls. I have an application
I am trying to modify an application and replace the application into my machine,
I am trying to modify a registry key that I have been told controls
I currently have an svn server running on a machine to which multiple users
I am using Windows 2003. I have mapped a web application into a virtual

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.