Search code examples
c#xmlvisual-studio-2010windows-installerinstallshield

installshield write to file during installation


I want to write to an XML file during the installation. it's a configurations file, and I want that the user will have an option to change a value of a key during the installation.

I'm using InstallShield 17, and I want to create MSI intall file to a project I wrote in visual studio (I can create the MSI install file, but I have to change a value of a key in my XML file during the installation).


Solution

  • For you to make it done you need a few things to setup in your installsheild Basic MSI Project.

    First, Create New Property in Property Manager and named it what ever you want all caps. All caps property name make it public variable.

    Second, Bind your variable in your dialog control like text-box or checkbox. Put your variable in property.

    Third, Add your XML file in XML File Changes under System Configuration.

    Fourth, Add new Element and target the node and key that you want to change using XPATH.

    I used same steps to change my configuration file based on user input during installation. I hope this will help you.