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!