Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

Editing xml file during installation

So I have a configuration xml file that is set to be installed with my software. The xml file has some fields, for example the web address of a backend server.

I want to be able to prompt for user input to get the information during the installation to fill out these xml fields.

I'm trying to accomplish this in a basic msi project. Any insights or suggestions on how to complete this would be greatly appreciated.


So I've made some head way, I think I will accomplish this by creating a custom dialog. However I'm not sure how to get the information that is inputted in a dialog text field into my xml.
Labels (1)
0 Kudos
(2) Replies
Level 9

Set the edit control in your dialog to have some know Property: and use ALL UPPERCASE for that Property so it is a Global Property - makes it survive between the UI and Execute sequence this way.

Then in the "XML File Changes" go to your file and on the Advanced tab you can specify the Attributes or Elements you wish to change and Include your new Property in the appropriate location to do your text substitution.

Maybe helps you a little further along?

0 Kudos
Level 2

Thanks a bunch Chad! That did the trick!

So for anyone in the future here is what I did:

  • Create a custom dialog (Under User Interface/Dialogs)
  • Create dialog with edit fields. Name them as you like, but properties of each should be all uppercase (ex. APIURL or MACHINENAME)
  • In text file changes or XML file changes, create a change as you would normally
  • When trying to get your text from the text field, write it as such: [EXAMPLEPROPERTY] (Using [] gets the value)

    This stack overflow post helped a bit when it came to editing and replacing text:

    Then finally you need to place your dialog into your installer. You can do this under Behavior and Logic -> Custom Actions and Sequences
  • 0 Kudos