aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBevan Weiss <bevan.weiss@gmail.com>2024-07-20 13:40:22 +1000
committerRob Mensching <rob@firegiant.com>2025-02-11 23:14:49 -0800
commit2c5bb89424b12de812498d568bc1aae2d4098e60 (patch)
treebc70e7e27de504d8ad76e47de28051d4edd86a1e
parent155eae032ff92a2fb6e58b5f7d1668195b725ada (diff)
downloadwix-2c5bb89424b12de812498d568bc1aae2d4098e60.tar.gz
wix-2c5bb89424b12de812498d568bc1aae2d4098e60.tar.bz2
wix-2c5bb89424b12de812498d568bc1aae2d4098e60.zip
Split into domain vs local CAs
-rw-r--r--src/ext/Util/ca/scagroup.cpp55
-rw-r--r--src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs3
-rw-r--r--src/ext/Util/wixlib/UtilExtension.wxs2
-rw-r--r--src/ext/Util/wixlib/UtilExtension_Platform.wxi13
-rw-r--r--src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/product.wxs5
5 files changed, 66 insertions, 12 deletions
diff --git a/src/ext/Util/ca/scagroup.cpp b/src/ext/Util/ca/scagroup.cpp
index 3d2c3beb..699d9db7 100644
--- a/src/ext/Util/ca/scagroup.cpp
+++ b/src/ext/Util/ca/scagroup.cpp
@@ -553,7 +553,14 @@ HRESULT ScaGroupExecute(
553 // 553 //
554 // Schedule the creation now. 554 // Schedule the creation now.
555 // 555 //
556 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"CreateGroup"), pwzActionData, COST_GROUP_ADD); 556 if (psg->wzDomain && *psg->wzDomain)
557 {
558 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"CreateDomainGroup"), pwzActionData, COST_GROUP_ADD);
559 }
560 else
561 {
562 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"CreateGroup"), pwzActionData, COST_GROUP_ADD);
563 }
557 ExitOnFailure(hr, "failed to schedule CreateGroup"); 564 ExitOnFailure(hr, "failed to schedule CreateGroup");
558 } 565 }
559 else if (((GROUP_EXISTS_YES == geGroupExists) 566 else if (((GROUP_EXISTS_YES == geGroupExists)
@@ -569,7 +576,14 @@ HRESULT ScaGroupExecute(
569 // 576 //
570 // Note: We can't rollback the removal of a group which is why RemoveGroup is a commit 577 // Note: We can't rollback the removal of a group which is why RemoveGroup is a commit
571 // CustomAction. 578 // CustomAction.
572 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroup"), pwzActionData, COST_GROUP_DELETE); 579 if (psg->wzDomain && *psg->wzDomain)
580 {
581 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveDomainGroup"), pwzActionData, COST_GROUP_DELETE);
582 }
583 else
584 {
585 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroup"), pwzActionData, COST_GROUP_DELETE);
586 }
573 ExitOnFailure(hr, "failed to schedule RemoveGroup"); 587 ExitOnFailure(hr, "failed to schedule RemoveGroup");
574 } 588 }
575 589
@@ -641,7 +655,15 @@ HRESULT ScaGroupMembershipRemoveParentsExecute(
641 ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psg->wzDomain); 655 ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psg->wzDomain);
642 hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); 656 hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData);
643 ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); 657 ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes);
644 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE); 658
659 if (psgp->wzDomain && *psgp->wzDomain)
660 {
661 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveDomainGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE);
662 }
663 else
664 {
665 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE);
666 }
645 667
646 LExit: 668 LExit:
647 ReleaseNullStr(pwzActionData); 669 ReleaseNullStr(pwzActionData);
@@ -680,7 +702,14 @@ HRESULT ScaGroupMembershipRemoveChildrenExecute(
680 ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psgc->wzDomain); 702 ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psgc->wzDomain);
681 hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); 703 hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData);
682 ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); 704 ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes);
683 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE); 705 if (psg->wzDomain && *psg->wzDomain)
706 {
707 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveDomainGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE);
708 }
709 else
710 {
711 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"RemoveGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_DELETE);
712 }
684 713
685 LExit: 714 LExit:
686 ReleaseNullStr(pwzActionData); 715 ReleaseNullStr(pwzActionData);
@@ -748,7 +777,14 @@ HRESULT ScaGroupMembershipAddParentsExecute(
748 ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psg->wzDomain); 777 ExitOnFailure(hr, "Failed to add child group domain to custom action data: %ls", psg->wzDomain);
749 hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); 778 hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData);
750 ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); 779 ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes);
751 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD); 780 if (psgp->wzDomain&&* psgp->wzDomain)
781 {
782 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddDomainGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD);
783 }
784 else
785 {
786 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD);
787 }
752 788
753 LExit: 789 LExit:
754 ReleaseNullStr(pwzActionData); 790 ReleaseNullStr(pwzActionData);
@@ -790,7 +826,14 @@ HRESULT ScaGroupMembershipAddChildrenExecute(
790 ExitOnFailure(hr, "Failed to add parent group domain to custom action data: %ls", psgc->wzDomain); 826 ExitOnFailure(hr, "Failed to add parent group domain to custom action data: %ls", psgc->wzDomain);
791 hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData); 827 hr = WcaWriteIntegerToCaData(psg->iAttributes, &pwzActionData);
792 ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes); 828 ExitOnFailure(hr, "Failed to add group attributes to custom action data: %i", psg->iAttributes);
793 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD); 829 if (psg->wzDomain && *psg->wzDomain)
830 {
831 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddDomainGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD);
832 }
833 else
834 {
835 hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION6(L"AddGroupMembership"), pwzActionData, COST_GROUPMEMBERSHIP_ADD);
836 }
794 837
795 LExit: 838 LExit:
796 ReleaseNullStr(pwzActionData); 839 ReleaseNullStr(pwzActionData);
diff --git a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs
index c9a184ab..ad56a32d 100644
--- a/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs
+++ b/src/ext/Util/test/WixToolsetTest.Util/UtilExtensionFixture.cs
@@ -405,8 +405,11 @@ namespace WixToolsetTest.Util
405 { 405 {
406 "Binary:Wix4UtilCA_X64\t[Binary data]", 406 "Binary:Wix4UtilCA_X64\t[Binary data]",
407 "CustomAction:Wix6ConfigureGroups_X64\t1\tWix4UtilCA_X64\tConfigureGroups\t", 407 "CustomAction:Wix6ConfigureGroups_X64\t1\tWix4UtilCA_X64\tConfigureGroups\t",
408 "CustomAction:Wix6CreateDomainGroup_X64\t1025\tWix4UtilCA_X64\tCreateGroup\t",
409 "CustomAction:Wix6CreateDomainGroupRollback_X64\t1281\tWix4UtilCA_X64\tCreateGroupRollback\t",
408 "CustomAction:Wix6CreateGroup_X64\t3073\tWix4UtilCA_X64\tCreateGroup\t", 410 "CustomAction:Wix6CreateGroup_X64\t3073\tWix4UtilCA_X64\tCreateGroup\t",
409 "CustomAction:Wix6CreateGroupRollback_X64\t3329\tWix4UtilCA_X64\tCreateGroupRollback\t", 411 "CustomAction:Wix6CreateGroupRollback_X64\t3329\tWix4UtilCA_X64\tCreateGroupRollback\t",
412 "CustomAction:Wix6RemoveDomainGroup_X64\t1601\tWix4UtilCA_X64\tRemoveGroup\t",
410 "CustomAction:Wix6RemoveGroup_X64\t3649\tWix4UtilCA_X64\tRemoveGroup\t", 413 "CustomAction:Wix6RemoveGroup_X64\t3649\tWix4UtilCA_X64\tRemoveGroup\t",
411 "Wix4Group:TEST_GROUP00\tComponent1\ttestName00\t", 414 "Wix4Group:TEST_GROUP00\tComponent1\ttestName00\t",
412 "Wix4Group:TEST_GROUP01\tComponent1\ttestName01\t", 415 "Wix4Group:TEST_GROUP01\tComponent1\ttestName01\t",
diff --git a/src/ext/Util/wixlib/UtilExtension.wxs b/src/ext/Util/wixlib/UtilExtension.wxs
index aa262eca..6f9e07e8 100644
--- a/src/ext/Util/wixlib/UtilExtension.wxs
+++ b/src/ext/Util/wixlib/UtilExtension.wxs
@@ -22,7 +22,7 @@
22 </Fragment> 22 </Fragment>
23 23
24 <Fragment> 24 <Fragment>
25 <UI Id="ConfigureGroupGroupsErrorText"> 25 <UI Id="ConfigureGroupMembershipErrorText">
26 <Error Id="$(var.msierrGRPFailedGroupGroupAdd)" Message="!(loc.msierrGRPFailedGroupGroupAdd)" /> 26 <Error Id="$(var.msierrGRPFailedGroupGroupAdd)" Message="!(loc.msierrGRPFailedGroupGroupAdd)" />
27 </UI> 27 </UI>
28 </Fragment> 28 </Fragment>
diff --git a/src/ext/Util/wixlib/UtilExtension_Platform.wxi b/src/ext/Util/wixlib/UtilExtension_Platform.wxi
index 71166d4f..d28c8df9 100644
--- a/src/ext/Util/wixlib/UtilExtension_Platform.wxi
+++ b/src/ext/Util/wixlib/UtilExtension_Platform.wxi
@@ -1,4 +1,4 @@
1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> 1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 2
3 3
4<Include xmlns="http://wixtoolset.org/schemas/v4/wxs"> 4<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
@@ -139,17 +139,26 @@
139 <CustomAction Id="$(var.Prefix6)CreateGroupRollback$(var.Suffix)" DllEntry="CreateGroupRollback" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" /> 139 <CustomAction Id="$(var.Prefix6)CreateGroupRollback$(var.Suffix)" DllEntry="CreateGroupRollback" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
140 <!-- RemoveGroup is a type commit action because it is not possible to rollback the removal of a group --> 140 <!-- RemoveGroup is a type commit action because it is not possible to rollback the removal of a group -->
141 <CustomAction Id="$(var.Prefix6)RemoveGroup$(var.Suffix)" DllEntry="RemoveGroup" Impersonate="no" Execute="commit" Return="ignore" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" /> 141 <CustomAction Id="$(var.Prefix6)RemoveGroup$(var.Suffix)" DllEntry="RemoveGroup" Impersonate="no" Execute="commit" Return="ignore" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
142
143 <CustomAction Id="$(var.Prefix6)CreateDomainGroup$(var.Suffix)" DllEntry="CreateGroup" Impersonate="yes" Execute="deferred" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
144 <CustomAction Id="$(var.Prefix6)CreateDomainGroupRollback$(var.Suffix)" DllEntry="CreateGroupRollback" Impersonate="yes" Execute="rollback" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
145 <!-- RemoveGroup is a type commit action because it is not possible to rollback the removal of a group -->
146 <CustomAction Id="$(var.Prefix6)RemoveDomainGroup$(var.Suffix)" DllEntry="RemoveGroup" Impersonate="yes" Execute="commit" Return="ignore" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
142 <InstallExecuteSequence> 147 <InstallExecuteSequence>
143 <Custom Action="virtual $(var.Prefix6)ConfigureGroups$(var.Suffix)" Before="InstallFiles" Condition="VersionNT &gt; 400" /> 148 <Custom Action="virtual $(var.Prefix6)ConfigureGroups$(var.Suffix)" Before="InstallFiles" Condition="VersionNT &gt; 400" />
144 </InstallExecuteSequence> 149 </InstallExecuteSequence>
145 </Fragment> 150 </Fragment>
146 151
147 <Fragment> 152 <Fragment>
148 <UIRef Id="ConfigureGroupGroupsErrorText" /> 153 <UIRef Id="ConfigureGroupMembershipErrorText" />
149 <CustomAction Id="$(var.Prefix6)AddGroupMembership$(var.Suffix)" DllEntry="AddGroupMembership" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" /> 154 <CustomAction Id="$(var.Prefix6)AddGroupMembership$(var.Suffix)" DllEntry="AddGroupMembership" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
150 <CustomAction Id="$(var.Prefix6)AddGroupMembershipRollback$(var.Suffix)" DllEntry="AddGroupMembershipRollback" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" /> 155 <CustomAction Id="$(var.Prefix6)AddGroupMembershipRollback$(var.Suffix)" DllEntry="AddGroupMembershipRollback" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
151 <CustomAction Id="$(var.Prefix6)RemoveGroupMembership$(var.Suffix)" DllEntry="RemoveGroupMembership" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" /> 156 <CustomAction Id="$(var.Prefix6)RemoveGroupMembership$(var.Suffix)" DllEntry="RemoveGroupMembership" Impersonate="no" Execute="deferred" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
152 <CustomAction Id="$(var.Prefix6)RemoveGroupMembershipRollback$(var.Suffix)" DllEntry="RemoveGroupMembershipRollback" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" /> 157 <CustomAction Id="$(var.Prefix6)RemoveGroupMembershipRollback$(var.Suffix)" DllEntry="RemoveGroupMembershipRollback" Impersonate="no" Execute="rollback" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
158 <CustomAction Id="$(var.Prefix6)AddDomainGroupMembership$(var.Suffix)" DllEntry="AddGroupMembership" Impersonate="yes" Execute="deferred" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
159 <CustomAction Id="$(var.Prefix6)AddDomainGroupMembershipRollback$(var.Suffix)" DllEntry="AddGroupMembershipRollback" Impersonate="yes" Execute="rollback" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
160 <CustomAction Id="$(var.Prefix6)RemoveDomainGroupMembership$(var.Suffix)" DllEntry="RemoveGroupMembership" Impersonate="yes" Execute="deferred" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
161 <CustomAction Id="$(var.Prefix6)RemoveDomainGroupMembershipRollback$(var.Suffix)" DllEntry="RemoveGroupMembershipRollback" Impersonate="yes" Execute="rollback" Return="check" SuppressModularization="yes" BinaryRef="$(var.Prefix)UtilCA$(var.Suffix)" />
153 </Fragment> 162 </Fragment>
154 163
155 <Fragment> 164 <Fragment>
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/product.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/product.wxs
index 15328cb3..c27eb27a 100644
--- a/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/product.wxs
+++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/product.wxs
@@ -7,12 +7,11 @@
7 <ComponentRef Id="Component1" /> 7 <ComponentRef Id="Component1" />
8 </ComponentGroup> 8 </ComponentGroup>
9 9
10 <Property Id="TEMPDOMAIN" Secure="yes" /> 10 <Property Id="TEMPDOMAIN" Secure="yes" Value="TESTDOMAIN" />
11 <Property Id="TEMPGROUPNAME" Secure="yes" />
12 </Fragment> 11 </Fragment>
13 12
14 <Fragment> 13 <Fragment>
15 <util:Group Id="AUTH_USERS" Name="Authenticated Users" > 14 <util:Group Id="AUTH_USERS" Name="Authenticated Users" Domain="[TEMPDOMAIN]" >
16 <util:GroupRef Id="TEST_GROUP1" /> 15 <util:GroupRef Id="TEST_GROUP1" />
17 <util:GroupRef Id="TEST_GROUP2" /> 16 <util:GroupRef Id="TEST_GROUP2" />
18 </util:Group> 17 </util:Group>