Adding XML Files - Advanced Installer Community
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Adding XML Files

Hello!

I have an XML file that is included in my installation. There are some elements in the XML file that I want to update with information that I'm gathering from the user during install. I'm not sure how I should be properly handling this. I'm trying the following from this page: http://www.advancedinstaller.com/user-g ... files.html
Update files that are part of the installation package

In this case you have an XML file that you want to install and then update it, all done in the same install package. This is possible because a regular XML file is installed on the target machine before the XML changes are applied. In order to achieve this behaviour, first add the XML file as a "regular file". Then, simply add the same XML file in the Windows Installer format and by using the XML Editor modify the elements that you want to create, update or remove.
However, this doesn't seem correct. AI gives me a warning when I add the file twice, and I receive and error when installing (see screenshots). Should I only be adding the file once (as an XML file)? If so, it appears an XML file cannot be a stand-alone component. Do I just attach it to another component (which seems odd)?

Thanks.
Attachments
Config.png
Config.png (20.74 KiB) Viewed 6578 times
Warning1.PNG
Warning1.PNG (4.68 KiB) Viewed 6578 times
InstallError.PNG
InstallError.PNG (82.08 KiB) Viewed 6578 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Adding XML Files

Hi,
I have an XML file that is included in my installation. There are some elements in the XML file that I want to update with information that I'm gathering from the user during install. I'm not sure how I should be properly handling this. I'm trying the following from this page: http://www.advancedinstaller.com/user-g ... files.html
That warning is displayed because sometimes the users get a file added to the project as a regular file and also as a Windows Installer file, but they do not know that the content of those file will get combined.

We will improve that message in a future version of Advanced Installer to be clearer. Thank you for bringing this to our attention.
AI gives me a warning when I add the file twice, and I receive and error when installing (see screenshots). Should I only be adding the file once (as an XML file)?
I'm not sure why that error appears, but there should be no problem with adding the file twice. Can you please send us the .AIP (project file), the XML file and a verbose log of the installation to support at advancedinstaller dot com, so we can investigate them?
If so, it appears an XML file cannot be a stand-alone component. Do I just attach it to another component (which seems odd)?
Indeed, an "XML Edit" operation cannot have its own component, it can only be added to an already existent component. This happens because it is not a resource, it is, practically, a custom action that edits a file.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hitman
Posts: 6
Joined: Tue Jan 31, 2017 4:19 pm

Re: Adding XML Files

Apologies butting in on this post but I'm having the same issue. After reading Eusebiu's reply, I now have our .config as a normal file with it additionally imported as a Windows Installer file - see below:

Image

However when installing, the config doesn't appear in the installation folder. The config file has been updated as I can access the installed application, but we need it so this .config file is visible so manual changes can be made if necessary.

Am I missing something obvious?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Adding XML Files

Hi and welcome to our forums.

I'm not sure why the config file is not visible in the installation folder because no file is installed as hidden. Can you create a verbose log of the installation and see the information it contains about that file?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
codesynergy
Posts: 100
Joined: Fri Nov 14, 2014 10:29 pm

Re: Adding XML Files

Ok, I feel stupid. The XML file was read-only, so that's why I was receiving the error during uninstall. Everything seems to work as expected now.
Indeed, an "XML Edit" operation cannot have its own component, it can only be added to an already existent component. This happens because it is not a resource, it is, practically, a custom action that edits a file.
Ahh, that makes sense.

Thanks for the help.


Hitman,

As Eusebiu said, the log file would probably tell you what's going on. You might also want to search the C:\ drive for Web.config to see if it was installed somewhere else (though, you might have other Web.config files on your machine). I would also check the "Show hidden files, folders, and drives" option in Windows. This would tell you if the file was somehow marked as hidden.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Adding XML Files

You're welcome. I'm glad you solved the problem. Thank you for the feedback.

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

Return to “Common Problems”