Is this possible?

Yes
No votes
0
No
No votes
0
 
Total votes: 0
OlegK
Posts: 7
Joined: Tue Jan 02, 2018 9:37 am

Retaining XML attributes after upgrade overwrites my XML

Hey guys I would appreciate your help.

I have an XML configuration file that I overwrite at each upgrade.
The thing is that I wish to retain the properties that I change between the first install and the upgrade.
Meaning that when I upgrade any new information will added to my XML but specific properties will be left the same.
Is this possible? If so then what can I do to achieve this?

Thank you very much for your time! ;)
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Retaining XML attributes after upgrade overwrites my XML

Hello Oleg,

I am not sure I understand your scenario. Could you please give me some more details about what you want to achieve (maybe exemplify)?

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
OlegK
Posts: 7
Joined: Tue Jan 02, 2018 9:37 am

Re: Retaining XML attributes after upgrade overwrites my XML

Catalin wrote:Hello Oleg,

I am not sure I understand your scenario. Could you please give me some more details about what you want to achieve (maybe exemplify)?

All the best,
Catalin
Hi Catalin.

At the first installation I want add a new XML file, this XML file will always have two specific attributes under a specific element.
The thing is that I want during each upgrade, I want to overwrite the file and by so add any new elements.
But at the same time if those two specific attributes that I mentioned at the start are already set
and their value are not default,then I want to keep the custom values.

I hope this is clearer, thank you :]
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Retaining XML attributes after upgrade overwrites my XML

Hello Oleg,

Thank you for your explanation. In order to achieve what you want, you can proceed as it follows:

- Open your project and go to "Files and Folders" page.

- Double click on your XML file

- Select the child note that contains the two attributes and uncheck the following options:
1- "Remove element on uninstall" option from under the "Element Settings" tab.
2- "Create element if it doesn't already exist" option from under the "Element Settings" tab.
3- "If the element is found:" option from under the "Element Settings" tab.

- Now click on the XML file name (located above the root node's name) and, under "Install" tab, uncheck the "Only if it was created at install" option from under "Remove file on uninstall:"

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”