This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: XML file changes are not updating existing elements
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 27, 2011
05:28 PM
XML file changes are not updating existing elements
I have XML changes configured for an element. If the element does not exist in the xml file, then it is added and the content set correctly.
Starting file content:
Add element data:
My property value inserted here.
However if the element exists in the file like:
then the installer will not set the content of Key. Why? Has anyone else seen this? I am having the same problem with attributes. They are not updated. If I delete the element from the source file and then run the installer, the element is created and added correctly. I have tried many combinations of the options with no luck.
Installscript MSI project running on Win7 64 bit.
Note: Test XML File Install Changes produces output as shown:
Input:
Result:
[MYPROPERTY]
Thanks in advance.
Starting file content:
Add element data:
However if the element exists in the file like:
then the installer will not set the content of Key. Why? Has anyone else seen this? I am having the same problem with attributes. They are not updated. If I delete the element from the source file and then run the installer, the element is created and added correctly. I have tried many combinations of the options with no luck.
Installscript MSI project running on Win7 64 bit.
Note: Test XML File Install Changes produces output as shown:
Input:
Result:
Thanks in advance.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2011
01:34 PM
Actually it works fine on my end. The content of the Key element is set to the value of the MYPROPERTY property in both cases where the Key element exists and doesn't exist in the original .xml file. I include the screenshot of the XML view that I have configured. A verbose log may help you troubleshoot the issue. KB article Q104807 explains how to create the log.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2011
03:17 PM
This is my log when tag exists in source file:
...
InstallShield 13:53:16: Installing XML Component 'Server.config'
InstallShield 13:53:16: Installing XML file 'C:\Program Files\Comapny\Product\Server\Server.config'
InstallShield 13:53:16: Using MSXML version 6
InstallShield 13:53:16: Processing XPath '//'
InstallShield 13:53:16: Processing XPath '//Key'
InstallShield 13:53:16: Saving XML file 'C:\Program Files\Comapny\Product\Server\Server.config'
InstallShield 13:53:16: Formatting XML document
InstallShield 13:53:16: Using MSXML version 6
InstallShield 13:53:16: Loading stylesheet
InstallShield 13:53:16: Successfully loaded stylesheet
InstallShield 13:53:16: Using MSXML version 6
InstallShield 13:53:16: Done Formatting XML document
...
Without tag in source file:
InstallShield 14:03:11: Installing XML Component 'Server.config'
InstallShield 14:03:11: Installing XML file 'C:\Program Files\Comapny\Product\Server\Server.config'
InstallShield 14:03:11: Using MSXML version 6
InstallShield 14:03:11: Processing XPath '//'
InstallShield 14:03:11: Processing XPath '//Key'
InstallShield 14:03:11: XPath '//Key' not found, creating
InstallShield 14:03:11: Creating element: Name=Key, Namespace=
InstallShield 14:03:11: Creating text node 19D35623D76E4BF0D739A183E46CEFBC4C06F448B4D4F3E63D590CD8034D06CA
InstallShield 14:03:11: Saving XML file 'C:\Program Files\Comapny\ProductServer\Server.config'
InstallShield 14:03:11: Formatting XML document
InstallShield 14:03:11: Using MSXML version 6
InstallShield 14:03:11: Loading stylesheet
InstallShield 14:03:11: Successfully loaded stylesheet
InstallShield 14:03:11: Using MSXML version 6
InstallShield 14:03:11: Done Formatting XML document
I am using the same settings as shown in your image. Any ideas?
Thanks
...
InstallShield 13:53:16: Installing XML Component 'Server.config'
InstallShield 13:53:16: Installing XML file 'C:\Program Files\Comapny\Product\Server\Server.config'
InstallShield 13:53:16: Using MSXML version 6
InstallShield 13:53:16: Processing XPath '//'
InstallShield 13:53:16: Processing XPath '//Key'
InstallShield 13:53:16: Saving XML file 'C:\Program Files\Comapny\Product\Server\Server.config'
InstallShield 13:53:16: Formatting XML document
InstallShield 13:53:16: Using MSXML version 6
InstallShield 13:53:16: Loading stylesheet
InstallShield 13:53:16: Successfully loaded stylesheet
InstallShield 13:53:16: Using MSXML version 6
InstallShield 13:53:16: Done Formatting XML document
...
Without tag in source file:
InstallShield 14:03:11: Installing XML Component 'Server.config'
InstallShield 14:03:11: Installing XML file 'C:\Program Files\Comapny\Product\Server\Server.config'
InstallShield 14:03:11: Using MSXML version 6
InstallShield 14:03:11: Processing XPath '//'
InstallShield 14:03:11: Processing XPath '//Key'
InstallShield 14:03:11: XPath '//Key' not found, creating
InstallShield 14:03:11: Creating element: Name=Key, Namespace=
InstallShield 14:03:11: Creating text node 19D35623D76E4BF0D739A183E46CEFBC4C06F448B4D4F3E63D590CD8034D06CA
InstallShield 14:03:11: Saving XML file 'C:\Program Files\Comapny\ProductServer\Server.config'
InstallShield 14:03:11: Formatting XML document
InstallShield 14:03:11: Using MSXML version 6
InstallShield 14:03:11: Loading stylesheet
InstallShield 14:03:11: Successfully loaded stylesheet
InstallShield 14:03:11: Using MSXML version 6
InstallShield 14:03:11: Done Formatting XML document
I am using the same settings as shown in your image. Any ideas?
Thanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 31, 2011
01:33 PM
This is my log when the tag does not exist:
InstallShield 13:18:16: Installing 1 XML component(s)
InstallShield 13:18:16: Installing XML Component 'NewXmlFile.xml'
InstallShield 13:18:16: Installing XML file 'C:\Users\Testlab\Pictures\NewXmlFile.xml'
InstallShield 13:18:16: Using MSXML version 6
InstallShield 13:18:16: Processing XPath '//'
InstallShield 13:18:16: Processing XPath '//Key'
InstallShield 13:18:16: Creating text node My property value inserted here.
InstallShield 13:18:16: Saving XML file 'C:\Users\Testlab\Pictures\NewXmlFile.xml'
InstallShield 13:18:16: Formatting XML document
InstallShield 13:18:16: Using MSXML version 6
InstallShield 13:18:16: Loading stylesheet
InstallShield 13:18:16: Successfully loaded stylesheet
InstallShield 13:18:16: Using MSXML version 6
InstallShield 13:18:16: Done Formatting XML document
Are you using InstallShield 2012? Can you try testing it with a brand new InstallScript MSI project, and see if you can reproduce?
InstallShield 13:18:16: Installing 1 XML component(s)
InstallShield 13:18:16: Installing XML Component 'NewXmlFile.xml'
InstallShield 13:18:16: Installing XML file 'C:\Users\Testlab\Pictures\NewXmlFile.xml'
InstallShield 13:18:16: Using MSXML version 6
InstallShield 13:18:16: Processing XPath '//'
InstallShield 13:18:16: Processing XPath '//Key'
InstallShield 13:18:16: Creating text node My property value inserted here.
InstallShield 13:18:16: Saving XML file 'C:\Users\Testlab\Pictures\NewXmlFile.xml'
InstallShield 13:18:16: Formatting XML document
InstallShield 13:18:16: Using MSXML version 6
InstallShield 13:18:16: Loading stylesheet
InstallShield 13:18:16: Successfully loaded stylesheet
InstallShield 13:18:16: Using MSXML version 6
InstallShield 13:18:16: Done Formatting XML document
Are you using InstallShield 2012? Can you try testing it with a brand new InstallScript MSI project, and see if you can reproduce?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 31, 2011
04:59 PM
It is 2012.
I did find the problem. The appSearch and ISXmlAppSearch actions were in both the UI and Execute sequences. Even though the ISXmlAppSearch is set to 'Immediate Execution' and 'Execute only once', it was executing twice as shown in the log file. The second execution during the execute sequence would delete the property value that was set during the UI sequence. I am using the app search to pre-populate the property if it already exists on the target system.
Thanks
I did find the problem. The appSearch and ISXmlAppSearch actions were in both the UI and Execute sequences. Even though the ISXmlAppSearch is set to 'Immediate Execution' and 'Execute only once', it was executing twice as shown in the log file. The second execution during the execute sequence would delete the property value that was set during the UI sequence. I am using the app search to pre-populate the property if it already exists on the target system.
Thanks
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)