I am trying to edit an XML file with Wix. I am using the WixUtilExtension bundled with Wix 3.7. The xml file is a settings file created in Visual Studio 2010 for a C# application. In this file, I am using an element which is used to store multiple string values in an array. This is the content of the unaltered settings file: I want to add elements to the element in this file. One way to do this is by using an element from the wix/UtilExtension namespace. I have added this element to the component which holds the config file like this: This results in the addition of one element to the element. To add another element to the settings file, another XmlConfig element has to be added to the element of the setup project with a different Id attribute and a higher value for the Sequence attribute like this: After installation of the msi, the element in the settings file looks like this: My valueMy second value I have found out that it is possible to set the Value attribute of an attribute to the value of a property like this: This is good. I would like the user to be able to add multiple values in the installation process dynamically so that a variable amount of elements can be added to the settings file. ![]() My first approach was to use a statement like this: There are a few problems with this approach: • The foreach statement uses a preprocessor variable which cannot be set to the value of a property. • The value of the Sequence attribute stays the same. I would like the user to store the values for the string elements in a Property which separates the values by semicolons and then parse them in a foreach statement like this: This throws the following error: The util:XmlConfig/@Id attribute's value, 'String[VALUES]', is not a legal identifier. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.). Every identifier must begin with either a letter or an underscore. Is there any way I can create a variable amount of elements with the XmlFile or the XmlConfig element? Is the only solution to this problem a CustomAction? As an addition to BdN3504's answer. Click to see our Wix review and how they can help you create free websites. This helps them identify and rank your. – file size of images / videos / media. WiX toolset; Bugs; WiX toolset Brought to you. #1316 Illegal identifier File/@Id when only specifying File/@Name Milestone: v3.0. Status: closed. Owner: Rob Mensching. Which could avoid this problem by creating an unique identifier for each my files. Instead of the whole thing. I would suggest the use of This ensures that the XmlConfig table is included in the output MSI, even if it is empty. (I would have just put this as a comment. But I don't have the reputation apparently). Yes, this is possible but if you want to have this determined at install time then the preprocessor is not an option. The preprocessor executes during the build process. Laura branigan greatest hits rar. From her breakthrough signature song 'Gloria' all the way through to her last Top 40 appearance with 'The Power of Love,' 's powerhouse voice and career are fairly represented here. Windows File IdentifierTo get what you want, you'll need to write another custom action that takes the arbitrarily long set of user data and adds temporary rows to the XmlConfig table. The WcaAddTempRecord() function in src ca wcautil wcawrap.cpp can do the work. The src ca wixca dll RemoveFoldersEx.cpp is a pretty good example of using WcaAddTempRecord() to add rows to the RemoveFile table. You'll want to do similarly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |