Xml combining nodes

Having trouble running Advanced Installer? Got a bug to report? Post it all here.
Post Reply
sfaust
Posts: 42
Joined: Tue Oct 13, 2015 11:57 pm

Xml combining nodes

Post by sfaust » Tue May 21, 2019 5:23 pm

I have an install project that creates an xml file that was defined by using the 'import xml file' function. The attached image is the basic configuration.

I have users that are getting this xml on their machines:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<RevitAddIns>
<AddIn Type="DBApplication">
<Name>Keynote Manager +KM+ Keynote DB Server</Name>
<AddInId>457da48a-c5ea-4f6f-8cf3-7c7a1dbd115e7094496c-c706-4bc1-8dd5-d9d5db7bb0e4</AddInId>
<FullClassName>RDES.KeynoteManager.Plus.Revit.KMPlusAppRDES.KeynoteManager.Plus.Revit.KMServerDB</FullClassName>
<Assembly>C:\Program Files (x86)\Revolution Design\Keynote Manager\2019\KMPlusApp.dll</Assembly>
<VendorId>RDES</VendorId>
<VendorDescription>Revolution Design, Inc., revolutiondesign.biz</VendorDescription>
<Assembly>C:\Program Files (x86)\Revolution Design\Keynote Manager\2019\KMPlusApp.dll</Assembly>
<VendorId>RDES</VendorId>
<VendorDescription>Revolution Design, Inc., revolutiondesign.biz</VendorDescription>
</AddIn>
</RevitAddIns>

As you can see, it created one 'Addin' node instead of two. Where the child node values differed between the two nodes I defined (the first 3 children) it concatenated the values; where they were the same (all the others) it just used the matching value.

What I really want is to have it ensure that the file exists just as I have defined it when the install is done. If it doesn't exist, create it as I have defined it; if it does exist, overwrite it with what I have defined... How do I do that?
Attachments
xml settings.png
xml settings.png (54.42 KiB) Viewed 280 times

sfaust
Posts: 42
Joined: Tue Oct 13, 2015 11:57 pm

Re: Xml combining nodes

Post by sfaust » Wed May 22, 2019 5:20 pm

bueller....

sfaust
Posts: 42
Joined: Tue Oct 13, 2015 11:57 pm

Re: Xml combining nodes

Post by sfaust » Wed May 22, 2019 8:24 pm

It doesn't seem like there is a way to make it create the xml each time but would love to be proven wrong. I'm going to try to install an empty xml file with 'always overwrite' and the do the 'update' to actually fill it out...

Ok well this seems clunky but it also seems to work... I installed a blank xml with just the declaration and root node and set it to 'always overwrite existing' I then created the xml file with the correct structure under the root and gave it the same name and location as the empty file and had it run as an update and that gives me the result I want.

Just seems clunky that I have to store a blank xml file on my local drive and have two install entries when it should be able to be built with just one. Also, whenever I create both of them I get a 'conflicted file' notification. That notification directs me to the FAQ for 'How do I update an XML file form my package?'... which tells me to put the base xml file in the directory and then an xml windows installer file with the same name... which is exactly what I did... which gave me the notification...

Catalin
Posts: 1214
Joined: Wed Jun 13, 2018 7:49 am

Re: Xml combining nodes

Post by Catalin » Thu May 23, 2019 9:05 am

Hello Steve,

This seems like a strange behavior, indeed. In order for me to further investigate & test this, could you please forward me the following:

- a copy of the .AIP file, but stripped down (should only contain the XML file that you are trying to import)

- a copy of the XML file that you are trying to import

by e-mail at support at advancedinstaller dot com?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

sfaust
Posts: 42
Joined: Tue Oct 13, 2015 11:57 pm

Re: Xml combining nodes

Post by sfaust » Thu May 23, 2019 2:51 pm

Files sent

sfaust
Posts: 42
Joined: Tue Oct 13, 2015 11:57 pm

Re: Xml combining nodes

Post by sfaust » Tue May 28, 2019 4:35 pm

Catalin any advice?

Catalin
Posts: 1214
Joined: Wed Jun 13, 2018 7:49 am

Re: Xml combining nodes

Post by Catalin » Wed May 29, 2019 9:13 am

Hello Steve,

First of all, please accept my apologies for the delayed reply, but we were quite busy lately.

Thanks for the sent files.

I have investigated the sent .AIP file and to be honest with you everything was just fine. I have also built it and tested the resulted setup. The XML file that was copied on the machine during the installation looks like this:
xml.PNG
xml.PNG (91.31 KiB) Viewed 173 times
which, if I understood correctly, is how it should look (please let me know if I'm wrong).

I have tested this on a Win 10 clean machine.

Were you able to reproduce the behavior using the sent .AIP file on your machines? If yes, did you try to test it on a clean machine or on the dev machine?

Looking forward to hearing from you.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

sfaust
Posts: 42
Joined: Tue Oct 13, 2015 11:57 pm

Re: Xml combining nodes

Post by sfaust » Wed May 29, 2019 2:38 pm

Yes that's what I get and no that's not what it's supposed to look like. The final xml should look like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<RevitAddIns>
<AddIn Type="Application">
<Name>Keynote Manager +</Name>
<Assembly>C:\Program Files (x86)\Revolution Design\Keynote Manager\2019\KMPlusApp.dll</Assembly>
<AddInId>457da48a-c5ea-4f6f-8cf3-7c7a1dbd115e</AddInId>
<FullClassName>RDES.KeynoteManager.Plus.Revit.KMPlusApp</FullClassName>
<VendorId>RDES</VendorId>
<VendorDescription>Revolution Design, Inc., revolutiondesign.biz</VendorDescription>
</AddIn>
<AddIn Type="DBApplication">
<Name>KM+ Keynote DB Server</Name>
<Assembly>C:\Program Files (x86)\Revolution Design\Keynote Manager\2019\KMPlusApp.dll</Assembly>
<AddInId>7094496c-c706-4bc1-8dd5-d9d5db7bb0e4</AddInId>
<FullClassName>RDES.KeynoteManager.Plus.Revit.KMServerDB</FullClassName>
<VendorId>RDES</VendorId>
<VendorDescription>Revolution Design, Inc., revolutiondesign.biz</VendorDescription>
</AddIn>
</RevitAddIns>

The '2019, folder in the assembly path will change based on which year they are installing for but the rest should be the same.

Catalin
Posts: 1214
Joined: Wed Jun 13, 2018 7:49 am

Re: Xml combining nodes

Post by Catalin » Mon Jun 03, 2019 10:31 am

Hello Steve,

First of all, thanks for your patience.

I have further investigated this and this seems to be cause by a miss configuration in the sent project.

In your XML file, for the second "AddIn" component, you had the following option:

"If the element is found:

Update: First Matching"

Capture.PNG
Capture.PNG (24.91 KiB) Viewed 147 times
This is why, the first "AddIn" node was actually created by appending the second one to it.

In order to avoid this behavior, please select the "Add as new sibling" option for your second "AddIn" and all its child nodes.

After doing so, this will be the resulted XML file:
Capture1.PNG
Capture1.PNG (67.63 KiB) Viewed 147 times
Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Post Reply