We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

yusuf
Posts: 7
Joined: Tue Apr 25, 2017 2:00 pm

Updating app.config or web.config files

Hi,
I am building installer in which I want to update config based on users entries. I have done read 'How to import and edit an XML file' http://www.advancedinstaller.com/user-g ... -file.html and searched your forum for answer. None of those appear to answer my question.

I have a folder that is synchronized which I am picking up files including configuration files. Your manual suggested to import the config file and edit the xml. I have done that it works.
2017-05-19 10_38_00-Vision 8 CAMA - Vision CAMA.aip (English US) - Advanced Installer 14.0.1.png
2017-05-19 10_38_00-Vision 8 CAMA - Vision CAMA.aip (English US) - Advanced Installer 14.0.1.png (23.82 KiB) Viewed 8941 times
This approach generally works, but it is no longer synchronized with my local version of the config files. Now if there a change in the config file it won't get picked up automatically forcing me to manually enter the changes in the xml editor. Is there a way to synchronize the imported xml file to local copy so that any changes gets picked up automatically.

If the answer to the synchronization is not possible then what other ways can I modify a file ( configuration in this case ) during install?

Thanks
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Updating app.config or web.config files

Hello,

In order to edit an XML file, this file must be imported in Windows Installer format. Unfortunately this operation is not possible with synchronized folders, the files being added as regular files. As a workaround you could update the installed XML file. To achieve this follow the steps:
- after you have synchronized the folder, manually add the XML file in it by clicking "Add File" toolbar button. You will be prompted to import the file in Windows Installer format. Check Select all checkbox and click OK. The folder should contain two XML files with the same name. One of "XML file" type, the other "XML File (Windows Installer)" type.
-Double click the "XML File (Windows Installer)" and edit the file. Make sure you select "Update" for new elements, as the default is "Add as a new sibling"

Hope this helps!

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Kaizer69
Posts: 2
Joined: Mon Mar 12, 2018 2:43 pm

Re: Updating app.config or web.config files

Hi,

Can you please elaborate more on this solution, from what I understand the user still has to manually updated the Windows Installer XML File. Please corerct me if I am wrong
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Updating app.config or web.config files

Hi,

The end user will not have to update the XML file manually. He will just write some requested values in the input text boxes during the installation and those values will be automatically updated in the XML file.

But for this to be possible, you need to add the XML file in your project in the Windows Installer format, then define some properties as attributes' values that will bind the input text boxes to those values.

Let me know if you have other questions.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”