From c9546f882bde36d5b525f82280a1e09f81c08845 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 16 Oct 2019 15:40:26 -0400 Subject: Bring extension up to date. --- src/Cpp.Build.props | 2 +- src/ca/packages.config | 4 +- src/ca/utilca.vcxproj | 8 +- .../WixToolsetTest.Util/UtilExtensionFixture.cs | 2 +- src/wixext/Tuples/FileShareTuple.cs | 4 +- src/wixext/UtilCompiler.cs | 86 +++++++++++----------- src/wixext/tables.xml | 4 +- 7 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/Cpp.Build.props b/src/Cpp.Build.props index 0e00132b..44a042c7 100644 --- a/src/Cpp.Build.props +++ b/src/Cpp.Build.props @@ -8,7 +8,7 @@ $(OutputPath)$(Platform)\ - + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) diff --git a/src/ca/packages.config b/src/ca/packages.config index b87f9ab4..4e9403bf 100644 --- a/src/ca/packages.config +++ b/src/ca/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/src/ca/utilca.vcxproj b/src/ca/utilca.vcxproj index 9bff19b0..2ec0c706 100644 --- a/src/ca/utilca.vcxproj +++ b/src/ca/utilca.vcxproj @@ -2,8 +2,8 @@ - - + + @@ -88,7 +88,7 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs index 7affe1f4..74cf9769 100644 --- a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs @@ -19,7 +19,7 @@ namespace WixToolsetTest.Util var results = build.BuildAndQuery(Build, "FileShare", "FileSharePermissions"); Assert.Equal(new[] { - "FileShare:ExampleFileShare\texample\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example file share\tINSTALLFOLDER\t\t0", + "FileShare:ExampleFileShare\texample\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tAn example file share\tINSTALLFOLDER\t\t", "FileSharePermissions:ExampleFileShare\tEveryone\t1", }, results.OrderBy(s => s).ToArray()); } diff --git a/src/wixext/Tuples/FileShareTuple.cs b/src/wixext/Tuples/FileShareTuple.cs index 043f24bd..5a31b6fa 100644 --- a/src/wixext/Tuples/FileShareTuple.cs +++ b/src/wixext/Tuples/FileShareTuple.cs @@ -86,9 +86,9 @@ namespace WixToolset.Util.Tuples set => this.Set((int)FileShareTupleFields.User_, value); } - public int Permissions + public int? Permissions { - get => this.Fields[(int)FileShareTupleFields.Permissions].AsNumber(); + get => this.Fields[(int)FileShareTupleFields.Permissions].AsNullableNumber(); set => this.Set((int)FileShareTupleFields.Permissions, value); } } diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs index 5adb5289..cc51733a 100644 --- a/src/wixext/UtilCompiler.cs +++ b/src/wixext/UtilCompiler.cs @@ -505,7 +505,7 @@ namespace WixToolset.Util break; } - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixComponentSearch", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixComponentSearch", id); row.Set(1, guid); row.Set(2, productCode); row.Set(3, (int)attributes); @@ -662,26 +662,26 @@ namespace WixToolset.Util this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); string eventSourceKey = $@"SYSTEM\CurrentControlSet\Services\EventLog\{logName}\{sourceName}"; - Identifier id = this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "EventMessageFile", String.Concat("#%", eventMessageFile), componentId, false); + Identifier id = this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "EventMessageFile", String.Concat("#%", eventMessageFile), componentId, false); if (null != categoryMessageFile) { - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "CategoryMessageFile", String.Concat("#%", categoryMessageFile), componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "CategoryMessageFile", String.Concat("#%", categoryMessageFile), componentId, false); } if (CompilerConstants.IntegerNotSet != categoryCount) { - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "CategoryCount", String.Concat("#", categoryCount), componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "CategoryCount", String.Concat("#", categoryCount), componentId, false); } if (null != parameterMessageFile) { - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "ParameterMessageFile", String.Concat("#%", parameterMessageFile), componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "ParameterMessageFile", String.Concat("#%", parameterMessageFile), componentId, false); } if (0 != typesSupported) { - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "TypesSupported", String.Concat("#", typesSupported), componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "TypesSupported", String.Concat("#", typesSupported), componentId, false); } var componentKeyPath = this.CreateComponentKeyPath(); @@ -845,7 +845,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixCloseApplication", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixCloseApplication", id); row.Set(1, target); row.Set(2, description); row.Set(3, condition); @@ -1087,7 +1087,7 @@ namespace WixToolset.Util /// private void CreateWixFileSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string path, WixFileSearchAttributes attributes) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixFileSearch", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixFileSearch", id); row.Set(1, path); //row.Set(2, minVersion; //row.Set(3, maxVersion; @@ -1108,7 +1108,7 @@ namespace WixToolset.Util /// A condition to test before evaluating the search. private void CreateWixSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string variable, string condition) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixSearch", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixSearch", id); row.Set(1, variable); row.Set(2, condition); } @@ -1122,7 +1122,7 @@ namespace WixToolset.Util /// Further details about the relation between id and parentId. private void CreateWixSearchRelationRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string parentId, int attributes) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixSearchRelation", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixSearchRelation", id); row.Set(1, parentId); row.Set(2, attributes); } @@ -1217,7 +1217,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "FileShare"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "FileShare"); row.Set(0, id); row.Set(1, name); row.Set(2, componentId); @@ -1286,7 +1286,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "FileSharePermissions"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "FileSharePermissions"); row.Set(0, fileShareId); row.Set(1, user); row.Set(2, permission); @@ -1340,7 +1340,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Group"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "Group"); row.Set(0, id); row.Set(1, componentId); row.Set(2, name); @@ -1383,7 +1383,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "UserGroup"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "UserGroup"); row.Set(0, userId); row.Set(1, groupId); } @@ -1504,7 +1504,7 @@ namespace WixToolset.Util // add the appropriate extension based on type of shortcut name = String.Concat(name, InternetShortcutType.Url == type ? ".url" : ".lnk"); - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixInternetShortcut"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixInternetShortcut"); row.Set(0, shortcutId); row.Set(1, componentId); row.Set(2, directoryId); @@ -1530,7 +1530,7 @@ namespace WixToolset.Util this.ParseHelper.EnsureTable(section, sourceLineNumbers, "CreateFolder"); // use built-in MSI functionality to remove the shortcuts rather than doing so via CA - row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "RemoveFile"); + row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "RemoveFile"); row.Set(0, shortcutId); row.Set(1, componentId); row.Set(2, this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name)); @@ -1683,7 +1683,7 @@ namespace WixToolset.Util sbSymbolicConstants.AppendFormat("#define LAST_{0}_COUNTER_OFFSET {1}\r\n", objectName, symbolConstantsCounter); // Add the calculated INI and H strings to the PerformanceCategory table. - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "PerformanceCategory"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "PerformanceCategory"); row.Set(0, id); row.Set(1, componentId); row.Set(2, name); @@ -1695,15 +1695,15 @@ namespace WixToolset.Util string linkageKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Linkage", escapedName); string performanceKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Performance", escapedName); - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, linkageKey, "Export", escapedName, componentId, false); - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "-", null, componentId, false); - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Library", library, componentId, false); - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Open", openEntryPoint, componentId, false); - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Collect", collectEntryPoint, componentId, false); - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Close", closeEntryPoint, componentId, false); - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "IsMultiInstance", YesNoType.Yes == multiInstance ? "#1" : "#0", componentId, false); - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Counter Names", sbCounterNames.ToString(), componentId, false); - this.ParseHelper.CreateRegistryRow(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Counter Types", sbCounterTypes.ToString(), componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, linkageKey, "Export", escapedName, componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "-", null, componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Library", library, componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Open", openEntryPoint, componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Collect", collectEntryPoint, componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Close", closeEntryPoint, componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "IsMultiInstance", YesNoType.Yes == multiInstance ? "#1" : "#0", componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Counter Names", sbCounterNames.ToString(), componentId, false); + this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Counter Types", sbCounterTypes.ToString(), componentId, false); } // Reference InstallPerfCounterData and UninstallPerfCounterData since nothing will happen without them @@ -2188,7 +2188,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Perfmon"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "Perfmon"); row.Set(0, componentId); row.Set(1, $"[#{fileId}]"); row.Set(2, name); @@ -2245,7 +2245,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "PerfmonManifest"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "PerfmonManifest"); row.Set(0, componentId); row.Set(1, $"[#{fileId}]"); row.Set(2, resourceFileDirectory); @@ -2319,7 +2319,7 @@ namespace WixToolset.Util break; } - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixFormatFiles"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixFormatFiles"); row.Set(0, binaryId); row.Set(1, fileId); @@ -2370,13 +2370,13 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "EventManifest"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "EventManifest"); row.Set(0, componentId); row.Set(1, $"[#{fileId}]"); if (null != messageFile) { - var messageRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile"); + var messageRow = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); messageRow.Set(0, String.Concat("Config_", fileId, "MessageFile")); messageRow.Set(1, $"[#{fileId}]"); messageRow.Set(2, "/*/*/*/*[\\[]@messageFileName[\\]]"); @@ -2387,7 +2387,7 @@ namespace WixToolset.Util } if (null != parameterFile) { - var resourceRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile"); + var resourceRow = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); resourceRow.Set(0, String.Concat("Config_", fileId, "ParameterFile")); resourceRow.Set(1, $"[#{fileId}]"); resourceRow.Set(2, "/*/*/*/*[\\[]@parameterFileName[\\]]"); @@ -2398,7 +2398,7 @@ namespace WixToolset.Util } if (null != resourceFile) { - var resourceRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile"); + var resourceRow = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); resourceRow.Set(0, String.Concat("Config_", fileId, "ResourceFile")); resourceRow.Set(1, $"[#{fileId}]"); resourceRow.Set(2, "/*/*/*/*[\\[]@resourceFileName[\\]]"); @@ -2558,7 +2558,7 @@ namespace WixToolset.Util this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects"); } - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "SecureObjects"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "SecureObjects"); row.Set(0, objectId); row.Set(1, tableName); row.Set(2, domain); @@ -2680,7 +2680,7 @@ namespace WixToolset.Util attributes |= WixProductSearchAttributes.UpgradeCode; } - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixProductSearch", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixProductSearch", id); row.Set(1, productCode ?? upgradeCode); row.Set(2, (int)attributes); } @@ -2836,7 +2836,7 @@ namespace WixToolset.Util this.CreateWixSearchRelationRow(section, sourceLineNumbers, id, after, 2); } - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixRegistrySearch", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixRegistrySearch", id); row.Set(1, (int)root); row.Set(2, key); row.Set(3, value); @@ -2919,7 +2919,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixRemoveFolderEx", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixRemoveFolderEx", id); row.Set(1, componentId); row.Set(2, property); row.Set(3, on); @@ -3004,7 +3004,7 @@ namespace WixToolset.Util this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRegisterRestartResources"); } - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixRestartResource", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixRestartResource", id); row.Set(1, componentId); row.Set(2, resource); row.Set(3, attributes); @@ -3104,7 +3104,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "ServiceConfig"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "ServiceConfig"); row.Set(0, serviceName); row.Set(1, componentId); row.Set(2, (newService ? 1 : 0)); @@ -3204,7 +3204,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixTouchFile", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixTouchFile", id); row.Set(1, componentId); row.Set(2, path); row.Set(3, attributes); @@ -3428,7 +3428,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "User", id); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "User", id); row.Set(1, componentId); row.Set(2, name); row.Set(3, domain); @@ -3560,7 +3560,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlFile"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); row.Set(0, id); row.Set(1, file); row.Set(2, elementPath); @@ -3798,7 +3798,7 @@ namespace WixToolset.Util if (!this.Messaging.EncounteredError) { - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "XmlConfig"); + var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlConfig"); row.Set(0, id); row.Set(1, file); row.Set(2, elementId ?? elementPath); diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml index 190b0404..9f491e56 100644 --- a/src/wixext/tables.xml +++ b/src/wixext/tables.xml @@ -57,7 +57,7 @@ + description="Permissions int, as in EXPLICIT_ACCESS.grfAccessPermissions in MSDN"/> + description="Permissions int, as in EXPLICIT_ACCESS.grfAccessPermissions in MSDN"/>