aboutsummaryrefslogtreecommitdiff
path: root/src/wixext
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-06-26 14:55:01 -0700
committerRob Mensching <rob@firegiant.com>2020-06-26 14:55:01 -0700
commitcc20def99bbd0b28f19d90aee50d67f674738505 (patch)
treed73260b1088990e829183cb4562d5b326a2b8ec7 /src/wixext
parentc95213afde7af57af4b2bbaa2d29344accbebf01 (diff)
downloadwix-cc20def99bbd0b28f19d90aee50d67f674738505.tar.gz
wix-cc20def99bbd0b28f19d90aee50d67f674738505.tar.bz2
wix-cc20def99bbd0b28f19d90aee50d67f674738505.zip
Remove use of inner text conversions for Util.wixext
Also, convert all test code to modern expectation
Diffstat (limited to 'src/wixext')
-rw-r--r--src/wixext/UtilCompiler.cs23
-rw-r--r--src/wixext/util.xsd56
2 files changed, 32 insertions, 47 deletions
diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs
index f7f37fab..acd96e15 100644
--- a/src/wixext/UtilCompiler.cs
+++ b/src/wixext/UtilCompiler.cs
@@ -761,6 +761,9 @@ namespace WixToolset.Util
761 case "Id": 761 case "Id":
762 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); 762 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
763 break; 763 break;
764 case "Condition":
765 condition = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
766 break;
764 case "Description": 767 case "Description":
765 description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); 768 description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
766 break; 769 break;
@@ -870,9 +873,6 @@ namespace WixToolset.Util
870 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "TerminateProcess", "RebootPrompt", "yes")); 873 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "TerminateProcess", "RebootPrompt", "yes"));
871 } 874 }
872 875
873 // get the condition from the inner text of the element
874 condition = this.ParseHelper.GetConditionInnerText(element);
875
876 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); 876 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
877 877
878 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "CloseApplications", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM | CustomActionPlatforms.ARM64); 878 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "CloseApplications", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM | CustomActionPlatforms.ARM64);
@@ -3606,23 +3606,6 @@ namespace WixToolset.Util
3606 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilSymbolDefinitions.XmlConfig, elementId); 3606 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilSymbolDefinitions.XmlConfig, elementId);
3607 } 3607 }
3608 3608
3609 var innerText = this.ParseHelper.GetTrimmedInnerText(element);
3610 if (null != value)
3611 {
3612 // cannot specify both the value attribute and inner text
3613 if (!String.IsNullOrEmpty(innerText))
3614 {
3615 this.Messaging.Write(ErrorMessages.IllegalAttributeWithInnerText(sourceLineNumbers, element.Name.LocalName, "Value"));
3616 }
3617 }
3618 else // value attribute not specified
3619 {
3620 if (!String.IsNullOrEmpty(innerText))
3621 {
3622 value = innerText;
3623 }
3624 }
3625
3626 // find unexpected child elements 3609 // find unexpected child elements
3627 foreach (var child in element.Elements()) 3610 foreach (var child in element.Elements())
3628 { 3611 {
diff --git a/src/wixext/util.xsd b/src/wixext/util.xsd
index 93cdd4ba..bb7a1e39 100644
--- a/src/wixext/util.xsd
+++ b/src/wixext/util.xsd
@@ -26,12 +26,6 @@
26 <xs:complexType> 26 <xs:complexType>
27 <xs:simpleContent> 27 <xs:simpleContent>
28 <xs:extension base="xs:string"> 28 <xs:extension base="xs:string">
29 <xs:annotation>
30 <xs:documentation>
31 Condition that determines if the application should be closed. Must be blank or evaluate to true
32 for the application to be scheduled for closing.
33 </xs:documentation>
34 </xs:annotation>
35 <xs:attribute name="Id" type="xs:string"> 29 <xs:attribute name="Id" type="xs:string">
36 <xs:annotation> 30 <xs:annotation>
37 <xs:documentation>Identifier for the close application (primary key). If the Id is not specified, one will be generated.</xs:documentation> 31 <xs:documentation>Identifier for the close application (primary key). If the Id is not specified, one will be generated.</xs:documentation>
@@ -42,6 +36,14 @@
42 <xs:documentation>Name of the exectuable to be closed. This should only be the file name.</xs:documentation> 36 <xs:documentation>Name of the exectuable to be closed. This should only be the file name.</xs:documentation>
43 </xs:annotation> 37 </xs:annotation>
44 </xs:attribute> 38 </xs:attribute>
39 <xs:attribute name="Condition" type="xs:string">
40 <xs:annotation>
41 <xs:documentation>
42 Condition that determines if the application should be closed. Must be blank or evaluate to true
43 for the application to be scheduled for closing.
44 </xs:documentation>
45 </xs:annotation>
46 </xs:attribute>
45 <xs:attribute name="Description" type="xs:string"> 47 <xs:attribute name="Description" type="xs:string">
46 <xs:annotation> 48 <xs:annotation>
47 <xs:documentation>Description to show if application is running and needs to be closed.</xs:documentation> 49 <xs:documentation>Description to show if application is running and needs to be closed.</xs:documentation>
@@ -562,7 +564,7 @@
562 <xs:attribute name="Name" type="xs:string" use="required"> 564 <xs:attribute name="Name" type="xs:string" use="required">
563 <xs:annotation> 565 <xs:annotation>
564 <xs:documentation> 566 <xs:documentation>
565 The name of the shortcut file, which is visible to the user. (The .lnk 567 The name of the shortcut file, which is visible to the user. (The .lnk
566 extension is added automatically and by default, is not shown to the user.) 568 extension is added automatically and by default, is not shown to the user.)
567 </xs:documentation> 569 </xs:documentation>
568 </xs:annotation> 570 </xs:annotation>
@@ -571,9 +573,9 @@
571 <xs:annotation> 573 <xs:annotation>
572 <xs:documentation> 574 <xs:documentation>
573 URL that should be opened when the user selects the shortcut. Windows 575 URL that should be opened when the user selects the shortcut. Windows
574 opens the URL in the appropriate handler for the protocol specified 576 opens the URL in the appropriate handler for the protocol specified
575 in the URL. Note that this is a formatted field, so you can use 577 in the URL. Note that this is a formatted field, so you can use
576 [#fileId] syntax to refer to a file being installed (using the file: 578 [#fileId] syntax to refer to a file being installed (using the file:
577 protocol). 579 protocol).
578 </xs:documentation> 580 </xs:documentation>
579 </xs:annotation> 581 </xs:annotation>
@@ -958,11 +960,11 @@
958 <xse:remarks> 960 <xse:remarks>
959 <html:p>The custom action that implements RemoveFolderEx does so by writing temporary rows to the RemoveFile table 961 <html:p>The custom action that implements RemoveFolderEx does so by writing temporary rows to the RemoveFile table
960 for each subfolder of the root folder you specify. Because it might dramatically affect Windows Installer's 962 for each subfolder of the root folder you specify. Because it might dramatically affect Windows Installer's
961 <html:a href="http://msdn.microsoft.com/en-us/library/aa368593.aspx">File Costing</html:a>, 963 <html:a href="http://msdn.microsoft.com/en-us/library/aa368593.aspx">File Costing</html:a>,
962 the temporary rows must be written before the CostInitialize standard action. Unfortunately, MSI doesn't 964 the temporary rows must be written before the CostInitialize standard action. Unfortunately, MSI doesn't
963 create properties for the Directory hierarchy in your package until later, in the CostFinalize action.</html:p> 965 create properties for the Directory hierarchy in your package until later, in the CostFinalize action.</html:p>
964 <html:p>An easy workaround for a typical use case of removing a folder during uninstall is to write the directory 966 <html:p>An easy workaround for a typical use case of removing a folder during uninstall is to write the directory
965 path to the registry and to load it during uninstall. See 967 path to the registry and to load it during uninstall. See
966 <html:a href="http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern">The WiX toolset's "Remember Property" pattern</html:a> 968 <html:a href="http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern">The WiX toolset's "Remember Property" pattern</html:a>
967 for an example.</html:p> 969 for an example.</html:p>
968 <html:p>If you use custom actions to set properties, ensure that they are scheduled before the WixRemoveFoldersEx custom action.</html:p> 970 <html:p>If you use custom actions to set properties, ensure that they are scheduled before the WixRemoveFoldersEx custom action.</html:p>
@@ -970,8 +972,8 @@
970 </xs:appinfo> 972 </xs:appinfo>
971 <xs:documentation> 973 <xs:documentation>
972 Remove a folder and all contained files and folders if the parent component is selected for installation or removal. 974 Remove a folder and all contained files and folders if the parent component is selected for installation or removal.
973 The folder must be specified in the Property attribute as the name of a property that will have a value that resolves 975 The folder must be specified in the Property attribute as the name of a property that will have a value that resolves
974 to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used. 976 to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used.
975 For more details, see the Remarks. 977 For more details, see the Remarks.
976 </xs:documentation> 978 </xs:documentation>
977 </xs:annotation> 979 </xs:annotation>
@@ -987,8 +989,8 @@
987 <xs:documentation> 989 <xs:documentation>
988 The id of a property that resolves to the full path of the source directory. The property does not have 990 The id of a property that resolves to the full path of the source directory. The property does not have
989 to exist in the installer database at creation time; it could be created at installation time by a custom 991 to exist in the installer database at creation time; it could be created at installation time by a custom
990 action, on the command line, etc. The property value can contain environment variables surrounded by 992 action, on the command line, etc. The property value can contain environment variables surrounded by
991 percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before 993 percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before
992 being evaluated for a full path. 994 being evaluated for a full path.
993 </xs:documentation> 995 </xs:documentation>
994 </xs:annotation> 996 </xs:annotation>
@@ -1390,8 +1392,8 @@
1390 <xs:element name="XmlFile"> 1392 <xs:element name="XmlFile">
1391 <xs:annotation> 1393 <xs:annotation>
1392 <xs:documentation> 1394 <xs:documentation>
1393 Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions. 1395 Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions.
1394 </xs:documentation> 1396 </xs:documentation>
1395 <xs:appinfo> 1397 <xs:appinfo>
1396 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" /> 1398 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
1397 </xs:appinfo> 1399 </xs:appinfo>
@@ -1420,8 +1422,8 @@
1420 <xs:attribute name="Value" type="xs:string"> 1422 <xs:attribute name="Value" type="xs:string">
1421 <xs:annotation> 1423 <xs:annotation>
1422 <xs:documentation> 1424 <xs:documentation>
1423 The value to be written. See the <html:a href="http://msdn.microsoft.com/library/aa368609(VS.85).aspx" target="_blank">Formatted topic</html:a> for information how to escape square brackets in the value. 1425 The value to be written. See the <html:a href="http://msdn.microsoft.com/library/aa368609(VS.85).aspx" target="_blank">Formatted topic</html:a> for information how to escape square brackets in the value.
1424 </xs:documentation> 1426 </xs:documentation>
1425 </xs:annotation> 1427 </xs:annotation>
1426 </xs:attribute> 1428 </xs:attribute>
1427 <xs:attribute name="Action" use="required"> 1429 <xs:attribute name="Action" use="required">
@@ -1471,8 +1473,8 @@
1471 <xs:attribute name="SelectionLanguage"> 1473 <xs:attribute name="SelectionLanguage">
1472 <xs:annotation> 1474 <xs:annotation>
1473 <xs:documentation> 1475 <xs:documentation>
1474 Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language. 1476 Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language.
1475 </xs:documentation> 1477 </xs:documentation>
1476 </xs:annotation> 1478 </xs:annotation>
1477 <xs:simpleType> 1479 <xs:simpleType>
1478 <xs:restriction base="xs:NMTOKEN"> 1480 <xs:restriction base="xs:NMTOKEN">
@@ -1486,13 +1488,13 @@
1486 <xs:element name="XmlConfig"> 1488 <xs:element name="XmlConfig">
1487 <xs:annotation> 1489 <xs:annotation>
1488 <xs:documentation> 1490 <xs:documentation>
1489 Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions. 1491 Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions.
1490 </xs:documentation> 1492 </xs:documentation>
1491 <xs:appinfo> 1493 <xs:appinfo>
1492 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" /> 1494 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
1493 </xs:appinfo> 1495 </xs:appinfo>
1494 </xs:annotation> 1496 </xs:annotation>
1495 <xs:complexType mixed="true"> 1497 <xs:complexType>
1496 <xs:sequence> 1498 <xs:sequence>
1497 <xs:element ref="XmlConfig" minOccurs="0" maxOccurs="unbounded" /> 1499 <xs:element ref="XmlConfig" minOccurs="0" maxOccurs="unbounded" />
1498 </xs:sequence> 1500 </xs:sequence>
@@ -1559,8 +1561,8 @@
1559 <xs:attribute name="Value" type="xs:string"> 1561 <xs:attribute name="Value" type="xs:string">
1560 <xs:annotation> 1562 <xs:annotation>
1561 <xs:documentation> 1563 <xs:documentation>
1562 The value to be written. See the <html:a href="http://msdn.microsoft.com/library/aa368609(VS.85).aspx" target="_blank">Formatted topic</html:a> for information how to escape square brackets in the value. 1564 The value to be written. See the <html:a href="https://docs.microsoft.com/en-us/windows/win32/msi/formatted" target="_blank">Formatted topic</html:a> for information how to escape square brackets in the value.
1563 </xs:documentation> 1565 </xs:documentation>
1564 </xs:annotation> 1566 </xs:annotation>
1565 </xs:attribute> 1567 </xs:attribute>
1566 <xs:attribute name="VerifyPath" type="xs:string"> 1568 <xs:attribute name="VerifyPath" type="xs:string">