From 644276562dcadd65fcb0e9a7c06c704cdda36423 Mon Sep 17 00:00:00 2001 From: Bevan Weiss Date: Sat, 6 Jul 2024 21:03:57 +1000 Subject: Group Add/Remove working. Local group membership Add/Remove working, however with BUILTIN local system groups .NET doesn't appear to locate them as either groups nor basic security Principals. Still needs work to fix the test for nested groups. Ideally with some way to test for domain groups. Signed-off-by: Bevan Weiss --- src/ext/Util/wixext/UtilDecompiler.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/ext/Util/wixext/UtilDecompiler.cs') diff --git a/src/ext/Util/wixext/UtilDecompiler.cs b/src/ext/Util/wixext/UtilDecompiler.cs index 53b75b8d..a236ece9 100644 --- a/src/ext/Util/wixext/UtilDecompiler.cs +++ b/src/ext/Util/wixext/UtilDecompiler.cs @@ -478,14 +478,26 @@ namespace WixToolset.Util { foreach (var row in table.Rows) { + var parentId = row.FieldAsString(0); + var parentExists = this.DecompilerHelper.TryGetIndexedElement("Group", parentId, out var parentGroup); + var childId = row.FieldAsString(1); - if (this.DecompilerHelper.TryGetIndexedElement("Group", childId, out var group)) + var childExists = this.DecompilerHelper.TryGetIndexedElement("Group", childId, out var childGroup); + + if (parentExists && childExists) { - group.Add(new XElement(UtilConstants.GroupRefName, new XAttribute("Id", row.FieldAsString(0)))); + childGroup.Add(new XElement(UtilConstants.GroupRefName, new XAttribute("Id", parentId))); } else { - this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(), "Parent_", childId, "Group")); + if(!parentExists) + { + this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(), "Parent_", parentId, "Group")); + } + if (!childExists) + { + this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(), "Child_", childId, "Group")); + } } } } -- cgit v1.2.3-55-g6feb