From cc20def99bbd0b28f19d90aee50d67f674738505 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Fri, 26 Jun 2020 14:55:01 -0700 Subject: Remove use of inner text conversions for Util.wixext Also, convert all test code to modern expectation --- .../TestData/BundleWithSearches/Bundle.wxs | 4 +- .../TestData/CloseApplication/Package.wxs | 6 +- .../CloseApplication/PackageComponents.wxs | 4 +- .../TestData/EventManifest/Package.wxs | 6 +- .../TestData/EventManifest/PackageComponents.wxs | 4 +- .../TestData/InternetShortcut/Package.wxs | 6 +- .../InternetShortcut/PackageComponents.wxs | 4 +- .../TestData/PermissionEx/Package.wxs | 6 +- .../TestData/PermissionEx/PackageComponents.wxs | 4 +- .../TestData/UsingFileShare/Package.wxs | 34 ++++---- .../TestData/UsingFileShare/PackageComponents.wxs | 26 +++--- src/wixext/UtilCompiler.cs | 23 +----- src/wixext/util.xsd | 56 ++++++------- src/wixlib/UtilExtension.wxs | 94 ++++++++++------------ src/wixlib/UtilExtension_arm.wxs | 3 +- src/wixlib/UtilExtension_arm64.wxs | 3 +- src/wixlib/UtilExtension_x64.wxs | 3 +- src/wixlib/UtilExtension_x86.wxs | 3 +- 18 files changed, 121 insertions(+), 168 deletions(-) diff --git a/src/test/WixToolsetTest.Util/TestData/BundleWithSearches/Bundle.wxs b/src/test/WixToolsetTest.Util/TestData/BundleWithSearches/Bundle.wxs index 82646b37..56eba137 100644 --- a/src/test/WixToolsetTest.Util/TestData/BundleWithSearches/Bundle.wxs +++ b/src/test/WixToolsetTest.Util/TestData/BundleWithSearches/Bundle.wxs @@ -1,6 +1,4 @@ - - + diff --git a/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.wxs b/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.wxs index 688ce39d..ec54a472 100644 --- a/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.wxs +++ b/src/test/WixToolsetTest.Util/TestData/CloseApplication/Package.wxs @@ -1,7 +1,5 @@ - - - + + diff --git a/src/test/WixToolsetTest.Util/TestData/CloseApplication/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/CloseApplication/PackageComponents.wxs index 4f9e6a9d..49f29600 100644 --- a/src/test/WixToolsetTest.Util/TestData/CloseApplication/PackageComponents.wxs +++ b/src/test/WixToolsetTest.Util/TestData/CloseApplication/PackageComponents.wxs @@ -1,6 +1,4 @@ - - + diff --git a/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.wxs b/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.wxs index fc1018ae..d3130591 100644 --- a/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.wxs +++ b/src/test/WixToolsetTest.Util/TestData/EventManifest/Package.wxs @@ -1,7 +1,5 @@ - - - + + diff --git a/src/test/WixToolsetTest.Util/TestData/EventManifest/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/EventManifest/PackageComponents.wxs index 75af3f59..2ec8ce82 100644 --- a/src/test/WixToolsetTest.Util/TestData/EventManifest/PackageComponents.wxs +++ b/src/test/WixToolsetTest.Util/TestData/EventManifest/PackageComponents.wxs @@ -1,6 +1,4 @@ - - + diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.wxs b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.wxs index fc1018ae..d3130591 100644 --- a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.wxs +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/Package.wxs @@ -1,7 +1,5 @@ - - - + + diff --git a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs index 23b172f8..5319d2f7 100644 --- a/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs +++ b/src/test/WixToolsetTest.Util/TestData/InternetShortcut/PackageComponents.wxs @@ -1,6 +1,4 @@ - - + diff --git a/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.wxs b/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.wxs index fc1018ae..d3130591 100644 --- a/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.wxs +++ b/src/test/WixToolsetTest.Util/TestData/PermissionEx/Package.wxs @@ -1,7 +1,5 @@ - - - + + diff --git a/src/test/WixToolsetTest.Util/TestData/PermissionEx/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/PermissionEx/PackageComponents.wxs index 4b4dd32e..0634d7d4 100644 --- a/src/test/WixToolsetTest.Util/TestData/PermissionEx/PackageComponents.wxs +++ b/src/test/WixToolsetTest.Util/TestData/PermissionEx/PackageComponents.wxs @@ -1,6 +1,4 @@ - - + diff --git a/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.wxs b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.wxs index 68ff98fd..32d1cba6 100644 --- a/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.wxs +++ b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/Package.wxs @@ -1,22 +1,20 @@ - - - - + + + - - + + - - - - - + + + + - - - - - - - + + + + + + + diff --git a/src/test/WixToolsetTest.Util/TestData/UsingFileShare/PackageComponents.wxs b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/PackageComponents.wxs index c548bc1d..7cedbb30 100644 --- a/src/test/WixToolsetTest.Util/TestData/UsingFileShare/PackageComponents.wxs +++ b/src/test/WixToolsetTest.Util/TestData/UsingFileShare/PackageComponents.wxs @@ -1,16 +1,14 @@ - - - - + + + - - - - - - - - - + + + + + + + + + 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 case "Id": id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); break; + case "Condition": + condition = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; case "Description": description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); break; @@ -870,9 +873,6 @@ namespace WixToolset.Util this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "TerminateProcess", "RebootPrompt", "yes")); } - // get the condition from the inner text of the element - condition = this.ParseHelper.GetConditionInnerText(element); - this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "CloseApplications", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM | CustomActionPlatforms.ARM64); @@ -3606,23 +3606,6 @@ namespace WixToolset.Util this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilSymbolDefinitions.XmlConfig, elementId); } - var innerText = this.ParseHelper.GetTrimmedInnerText(element); - if (null != value) - { - // cannot specify both the value attribute and inner text - if (!String.IsNullOrEmpty(innerText)) - { - this.Messaging.Write(ErrorMessages.IllegalAttributeWithInnerText(sourceLineNumbers, element.Name.LocalName, "Value")); - } - } - else // value attribute not specified - { - if (!String.IsNullOrEmpty(innerText)) - { - value = innerText; - } - } - // find unexpected child elements foreach (var child in element.Elements()) { 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 @@ - - - Condition that determines if the application should be closed. Must be blank or evaluate to true - for the application to be scheduled for closing. - - Identifier for the close application (primary key). If the Id is not specified, one will be generated. @@ -42,6 +36,14 @@ Name of the exectuable to be closed. This should only be the file name. + + + + Condition that determines if the application should be closed. Must be blank or evaluate to true + for the application to be scheduled for closing. + + + Description to show if application is running and needs to be closed. @@ -562,7 +564,7 @@ - The name of the shortcut file, which is visible to the user. (The .lnk + The name of the shortcut file, which is visible to the user. (The .lnk extension is added automatically and by default, is not shown to the user.) @@ -571,9 +573,9 @@ URL that should be opened when the user selects the shortcut. Windows - opens the URL in the appropriate handler for the protocol specified - in the URL. Note that this is a formatted field, so you can use - [#fileId] syntax to refer to a file being installed (using the file: + opens the URL in the appropriate handler for the protocol specified + in the URL. Note that this is a formatted field, so you can use + [#fileId] syntax to refer to a file being installed (using the file: protocol). @@ -958,11 +960,11 @@ The custom action that implements RemoveFolderEx does so by writing temporary rows to the RemoveFile table for each subfolder of the root folder you specify. Because it might dramatically affect Windows Installer's - File Costing, + File Costing, the temporary rows must be written before the CostInitialize standard action. Unfortunately, MSI doesn't create properties for the Directory hierarchy in your package until later, in the CostFinalize action. An easy workaround for a typical use case of removing a folder during uninstall is to write the directory - path to the registry and to load it during uninstall. See + path to the registry and to load it during uninstall. See The WiX toolset's "Remember Property" pattern for an example. If you use custom actions to set properties, ensure that they are scheduled before the WixRemoveFoldersEx custom action. @@ -970,8 +972,8 @@ Remove a folder and all contained files and folders if the parent component is selected for installation or removal. - The folder must be specified in the Property attribute as the name of a property that will have a value that resolves - to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used. + The folder must be specified in the Property attribute as the name of a property that will have a value that resolves + to the full path of the folder before the CostInitialize action. Note that Directory ids cannot be used. For more details, see the Remarks. @@ -987,8 +989,8 @@ The id of a property that resolves to the full path of the source directory. The property does not have to exist in the installer database at creation time; it could be created at installation time by a custom - action, on the command line, etc. The property value can contain environment variables surrounded by - percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before + action, on the command line, etc. The property value can contain environment variables surrounded by + percent signs such as from a REG_EXPAND_SZ registry value; environment variables will be expanded before being evaluated for a full path. @@ -1390,8 +1392,8 @@ - Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions. - + Adds or removes .xml file entries. If you use the XmlFile element you must reference WixUtilExtension.dll as it contains the XmlFile custom actions. + @@ -1420,8 +1422,8 @@ - The value to be written. See the Formatted topic for information how to escape square brackets in the value. - + The value to be written. See the Formatted topic for information how to escape square brackets in the value. + @@ -1471,8 +1473,8 @@ - Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language. - + Specify whether the DOM object should use XPath language or the old XSLPattern language (default) as the query language. + @@ -1486,13 +1488,13 @@ - Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions. - + Adds or removes .xml file entries. If you use the XmlConfig element you must reference WixUtilExtension.dll as it contains the XmlConfig custom actions. + - + @@ -1559,8 +1561,8 @@ - The value to be written. See the Formatted topic for information how to escape square brackets in the value. - + The value to be written. See the Formatted topic for information how to escape square brackets in the value. + diff --git a/src/wixlib/UtilExtension.wxs b/src/wixlib/UtilExtension.wxs index 62d9e37a..2e9ad272 100644 --- a/src/wixlib/UtilExtension.wxs +++ b/src/wixlib/UtilExtension.wxs @@ -1,5 +1,4 @@ - - + @@ -8,71 +7,69 @@ - !(loc.msierrUSRFailedUserCreate) - !(loc.msierrUSRFailedUserCreatePswd) - !(loc.msierrUSRFailedUserGroupAdd) - Failed to grant 'logon as service' rights to user. ([2] [3] [4] [5]) - !(loc.msierrUSRFailedUserCreateExists) + + + + + - !(loc.msierrSMBFailedCreate) - !(loc.msierrSMBFailedDrop) + + - - !(loc.msierrInstallPerfCounterData) - !(loc.msierrUninstallPerfCounterData) + + + - - !(loc.msierrPERFMONFailedRegisterDLL) - !(loc.msierrPERFMONFailedUnregisterDLL) + + + - !(loc.msierrSecureObjectsFailedCreateSD) - !(loc.msierrSecureObjectsFailedSet) - !(loc.msierrSecureObjectsUnknownType) + + + - - !(loc.msierrXmlFileFailedRead) - !(loc.msierrXmlFileFailedOpen) - !(loc.msierrXmlFileFailedSelect) - !(loc.msierrXmlFileFailedSave) + + + + + - - !(loc.msierrXmlConfigFailedRead) - !(loc.msierrXmlConfigFailedOpen) - !(loc.msierrXmlConfigFailedSelect) - !(loc.msierrXmlConfigFailedSave) + + + + + - - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + - - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + @@ -159,13 +156,11 @@ - - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + - - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + @@ -266,14 +261,13 @@ - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) + - @@ -305,25 +299,25 @@ - + - - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - + + + - - VersionNT > 400 OR (VersionNT = 400 AND ServicePackLevel > 3) - + + + - - + + - - + + diff --git a/src/wixlib/UtilExtension_arm.wxs b/src/wixlib/UtilExtension_arm.wxs index c3ec27f7..8ae19029 100644 --- a/src/wixlib/UtilExtension_arm.wxs +++ b/src/wixlib/UtilExtension_arm.wxs @@ -1,5 +1,4 @@ - - + diff --git a/src/wixlib/UtilExtension_arm64.wxs b/src/wixlib/UtilExtension_arm64.wxs index 1d552acf..b9dc73b8 100644 --- a/src/wixlib/UtilExtension_arm64.wxs +++ b/src/wixlib/UtilExtension_arm64.wxs @@ -1,5 +1,4 @@ - - + diff --git a/src/wixlib/UtilExtension_x64.wxs b/src/wixlib/UtilExtension_x64.wxs index e902f97a..40cdf306 100644 --- a/src/wixlib/UtilExtension_x64.wxs +++ b/src/wixlib/UtilExtension_x64.wxs @@ -1,5 +1,4 @@ - - + diff --git a/src/wixlib/UtilExtension_x86.wxs b/src/wixlib/UtilExtension_x86.wxs index ff4f08c4..bd0fa562 100644 --- a/src/wixlib/UtilExtension_x86.wxs +++ b/src/wixlib/UtilExtension_x86.wxs @@ -1,5 +1,4 @@ - - + -- cgit v1.2.3-55-g6feb