1

I created an installation MSI package using WixSharp. I have a custom dialog with language, server, etc. options. I want to generate an application config file based on these options and deploy it next to the .exe file as part of an installation process. If it is possible, how should I do that?

Fraction
  • 11,668
  • 5
  • 28
  • 48
Erik Parso
  • 194
  • 14

1 Answers1

1

You can subscribe on AfterInstall event (when files has been coppied) and modify your config file there.

AfterInstall demostration

project.AfterInstall += project_AfterInstall;

...

static void project_AfterInstall(SetupEventArgs e)

Installation directory you can find here:

private void OnAfterInstall(SetupEventArgs e)
{
    var installationPath = e.Session["INSTALLDIR"];

    // Change your config file here
    // if you need to modify your file once time after installation
    // just add this one condition if (e.IsInstalled) { ... }
}
Sergey Vaulin
  • 722
  • 4
  • 16