diff options
| author | Bevan Weiss <bevan.weiss@gmail.com> | 2024-06-18 19:03:40 +1000 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2025-02-11 23:14:49 -0800 |
| commit | 7b1bb025dea1d1e9e144cce0dcbba2d86f053b8f (patch) | |
| tree | c2fc969615d858ee40f54cfba406648e9c2743c3 /src/test/msi | |
| parent | 040e50ec2859c1de70cd8e9f957474321774f293 (diff) | |
| download | wix-7b1bb025dea1d1e9e144cce0dcbba2d86f053b8f.tar.gz wix-7b1bb025dea1d1e9e144cce0dcbba2d86f053b8f.tar.bz2 wix-7b1bb025dea1d1e9e144cce0dcbba2d86f053b8f.zip | |
CreateGroups additions
Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
Diffstat (limited to 'src/test/msi')
23 files changed, 663 insertions, 0 deletions
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductA/ProductA.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductA/ProductA.wixproj new file mode 100644 index 00000000..3895b853 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductA/ProductA.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{A3E0B539-63F9-4B43-9E34-F33AE1C6E06D}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> \ No newline at end of file | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductA/product.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductA/product.wxs new file mode 100644 index 00000000..e3c143e6 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductA/product.wxs | |||
| @@ -0,0 +1,25 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | |||
| 10 | <Property Id="TEMPDOMAIN" Secure="yes" /> | ||
| 11 | <Property Id="TEMPGROUPNAME" Secure="yes" /> | ||
| 12 | </Fragment> | ||
| 13 | |||
| 14 | <Fragment> | ||
| 15 | <Component Id="Component1" Guid="09624A9A-4BBC-4126-BBF9-0713C5217DB1" Directory="INSTALLFOLDER"> | ||
| 16 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 17 | |||
| 18 | <util:Group Id="TEST_GROUP1" Name="testName1" Comment="Group1" CreateGroup="yes" RemoveOnUninstall="yes" /> | ||
| 19 | |||
| 20 | <util:Group Id="TEST_GROUP2" Name="testName2" Comment="Group2" RemoveOnUninstall="no" UpdateIfExists="yes" /> | ||
| 21 | |||
| 22 | <util:Group Id="TEST_GROUP3" Name="testName3" Comment="Group3" CreateGroup="no" /> | ||
| 23 | </Component> | ||
| 24 | </Fragment> | ||
| 25 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductAddCommentToExistingGroup/ProductAddCommentToExistingGroup.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductAddCommentToExistingGroup/ProductAddCommentToExistingGroup.wixproj new file mode 100644 index 00000000..5938e525 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductAddCommentToExistingGroup/ProductAddCommentToExistingGroup.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{B33D3140-4AA5-469D-9DEE-AAF8F0C626DA}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductAddCommentToExistingGroup/product.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductAddCommentToExistingGroup/product.wxs new file mode 100644 index 00000000..e0170746 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductAddCommentToExistingGroup/product.wxs | |||
| @@ -0,0 +1,23 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | </Fragment> | ||
| 10 | |||
| 11 | <Fragment> | ||
| 12 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
| 13 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 14 | |||
| 15 | <util:Group Id="TEST_GROUP1" | ||
| 16 | Name="testName1" | ||
| 17 | CreateGroup="yes" | ||
| 18 | UpdateIfExists="yes" | ||
| 19 | RemoveOnUninstall="yes" | ||
| 20 | Comment="testComment1"/> | ||
| 21 | </Component> | ||
| 22 | </Fragment> | ||
| 23 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentDelete/ProductCommentDelete.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentDelete/ProductCommentDelete.wixproj new file mode 100644 index 00000000..63bb2370 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentDelete/ProductCommentDelete.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{9E4C301E-5F36-4A86-85BE-776E067D929D}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentDelete/product.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentDelete/product.wxs new file mode 100644 index 00000000..d1824890 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentDelete/product.wxs | |||
| @@ -0,0 +1,18 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | </Fragment> | ||
| 10 | |||
| 11 | <Fragment> | ||
| 12 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
| 13 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 14 | |||
| 15 | <util:Group Id="TEST_GROUP1" Name="testName1" UpdateIfExists="yes" RemoveOnUninstall="yes" RemoveComment="yes"/> | ||
| 16 | </Component> | ||
| 17 | </Fragment> | ||
| 18 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentFail/ProductCommentFail.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentFail/ProductCommentFail.wixproj new file mode 100644 index 00000000..66f308ae --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentFail/ProductCommentFail.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{85F698E0-F542-4CB4-80A1-6630D2DEB647}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentFail/product_fail.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentFail/product_fail.wxs new file mode 100644 index 00000000..29b908da --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductCommentFail/product_fail.wxs | |||
| @@ -0,0 +1,22 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | |||
| 10 | <InstallExecuteSequence> | ||
| 11 | <Custom Action="CaFail" After="Wix4ConfigureGroups_X86" /> | ||
| 12 | </InstallExecuteSequence> | ||
| 13 | </Fragment> | ||
| 14 | |||
| 15 | <Fragment> | ||
| 16 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
| 17 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 18 | |||
| 19 | <util:Group Id="TEST_GROUP1" Name="testName1" CreateGroup="yes" RemoveOnUninstall="yes" Comment="testComment1"/> | ||
| 20 | </Component> | ||
| 21 | </Fragment> | ||
| 22 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductFail/ProductFail.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductFail/ProductFail.wixproj new file mode 100644 index 00000000..e2fe3aa8 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductFail/ProductFail.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{91D27DAC-04C1-4160-914E-343676D36CAA}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> \ No newline at end of file | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductFail/product_fail.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductFail/product_fail.wxs new file mode 100644 index 00000000..fb35bc1e --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductFail/product_fail.wxs | |||
| @@ -0,0 +1,29 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | |||
| 10 | <Property Id="TEMPDOMAIN" Secure="yes" /> | ||
| 11 | <Property Id="TEMPUSERNAME" Secure="yes" /> | ||
| 12 | |||
| 13 | <InstallExecuteSequence> | ||
| 14 | <Custom Action="CaFail" After="Wix4ConfigureGroups_X86" /> | ||
| 15 | </InstallExecuteSequence> | ||
| 16 | </Fragment> | ||
| 17 | |||
| 18 | <Fragment> | ||
| 19 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
| 20 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 21 | |||
| 22 | <util:Group Id="TEST_GROUP1" Name="testName1" /> | ||
| 23 | |||
| 24 | <util:Group Id="TEST_GROUP2" Name="testName2" RemoveOnUninstall="no" UpdateIfExists="yes" /> | ||
| 25 | |||
| 26 | <util:Group Id="TEST_GROUP3" Name="testName3" CreateGroup="no" /> | ||
| 27 | </Component> | ||
| 28 | </Fragment> | ||
| 29 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductFailIfExists/FailIfExists.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductFailIfExists/FailIfExists.wxs new file mode 100644 index 00000000..00f8e12d --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductFailIfExists/FailIfExists.wxs | |||
| @@ -0,0 +1,18 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | </Fragment> | ||
| 10 | |||
| 11 | <Fragment> | ||
| 12 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
| 13 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 14 | |||
| 15 | <util:Group Id="TEST_USER4" Name="existinggroup" FailIfExists="yes" RemoveOnUninstall="yes" /> | ||
| 16 | </Component> | ||
| 17 | </Fragment> | ||
| 18 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductFailIfExists/ProductFailIfExists.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductFailIfExists/ProductFailIfExists.wixproj new file mode 100644 index 00000000..9e1a836f --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductFailIfExists/ProductFailIfExists.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{BC803822-929E-47DA-AB3A-3A62EEEA2BFB}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> \ No newline at end of file | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/ProductNestedGroups.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/ProductNestedGroups.wixproj new file mode 100644 index 00000000..3b2e3942 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/ProductNestedGroups.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{8B6C2900-44C4-42C9-879F-82F551B10C15}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/product.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/product.wxs new file mode 100644 index 00000000..191d605c --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNestedGroups/product.wxs | |||
| @@ -0,0 +1,33 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | |||
| 10 | <Property Id="TEMPDOMAIN" Secure="yes" /> | ||
| 11 | <Property Id="TEMPGROUPNAME" Secure="yes" /> | ||
| 12 | </Fragment> | ||
| 13 | |||
| 14 | <Fragment> | ||
| 15 | <util:Group Id="ADMIN" Name="Administrators" > | ||
| 16 | <util:GroupRef Id="TEST_GROUP1" /> | ||
| 17 | <util:GroupRef Id="TEST_GROUP2" /> | ||
| 18 | </util:Group> | ||
| 19 | <util:Group Id="POWER_USERS" Name="Power Users" > | ||
| 20 | <util:GroupRef Id="TEST_GROUP1" /> | ||
| 21 | </util:Group> | ||
| 22 | |||
| 23 | <Component Id="Component1" Guid="09624A9A-4BBC-4126-BBF9-0713C5217DB1" Directory="INSTALLFOLDER"> | ||
| 24 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 25 | |||
| 26 | <util:Group Id="TEST_GROUP1" Name="testName1" Comment="Group1" CreateGroup="yes" RemoveOnUninstall="yes" /> | ||
| 27 | |||
| 28 | <util:Group Id="TEST_GROUP2" Name="testName2" Comment="Group2" RemoveOnUninstall="no" UpdateIfExists="yes" /> | ||
| 29 | |||
| 30 | <util:Group Id="TEST_GROUP3" Name="testName3" Comment="Group3" /> | ||
| 31 | </Component> | ||
| 32 | </Fragment> | ||
| 33 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductNewGroupWithComment/ProductNewGroupWithComment.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNewGroupWithComment/ProductNewGroupWithComment.wixproj new file mode 100644 index 00000000..aeac903a --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNewGroupWithComment/ProductNewGroupWithComment.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{549E1829-BBDE-42E1-968A-BEB8FC12BFC7}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductNewGroupWithComment/product.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNewGroupWithComment/product.wxs new file mode 100644 index 00000000..2d012b23 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNewGroupWithComment/product.wxs | |||
| @@ -0,0 +1,23 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | </Fragment> | ||
| 10 | |||
| 11 | <Fragment> | ||
| 12 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
| 13 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 14 | <util:Group | ||
| 15 | Id="TEST_GROUP1" | ||
| 16 | Name="testName1" | ||
| 17 | CreateGroup="yes" | ||
| 18 | UpdateIfExists="yes" | ||
| 19 | RemoveOnUninstall="yes" | ||
| 20 | Comment="testComment1" /> | ||
| 21 | </Component> | ||
| 22 | </Fragment> | ||
| 23 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductNonVitalGroup/NonVitalUserGroup.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNonVitalGroup/NonVitalUserGroup.wxs new file mode 100644 index 00000000..a834c76b --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNonVitalGroup/NonVitalUserGroup.wxs | |||
| @@ -0,0 +1,19 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | </Fragment> | ||
| 10 | |||
| 11 | <Fragment> | ||
| 12 | |||
| 13 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
| 14 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 15 | |||
| 16 | <util:Group Id="CurrentGroup" Name="[LogonUser]" Domain="[%USERDOMAIN]" RemoveOnUninstall="no" Vital="no" /> | ||
| 17 | </Component> | ||
| 18 | </Fragment> | ||
| 19 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductNonVitalGroup/ProductNonVitalUserGroup.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNonVitalGroup/ProductNonVitalUserGroup.wixproj new file mode 100644 index 00000000..8734224d --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductNonVitalGroup/ProductNonVitalUserGroup.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{455C8D4F-6D59-405C-AD51-0ACC7FB91A26}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> \ No newline at end of file | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductRestrictedDomain/ProductRestrictedDomain.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductRestrictedDomain/ProductRestrictedDomain.wixproj new file mode 100644 index 00000000..e4a01a3a --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductRestrictedDomain/ProductRestrictedDomain.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{50CF526C-A862-4327-9EA3-C96AAB6FABCE}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> \ No newline at end of file | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductRestrictedDomain/RestrictedDomain.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductRestrictedDomain/RestrictedDomain.wxs new file mode 100644 index 00000000..edb3387c --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductRestrictedDomain/RestrictedDomain.wxs | |||
| @@ -0,0 +1,20 @@ | |||
| 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 | |||
| 3 | |||
| 4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="ProductComponents"> | ||
| 7 | <ComponentRef Id="Component1" /> | ||
| 8 | </ComponentGroup> | ||
| 9 | |||
| 10 | <Property Id="TEMPDOMAIN" Secure="yes" /> | ||
| 11 | </Fragment> | ||
| 12 | |||
| 13 | <Fragment> | ||
| 14 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
| 15 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
| 16 | |||
| 17 | <util:Group Id="TEST_GROUP_test" Name="testName1" Domain="[TEMPDOMAIN]" /> | ||
| 18 | </Component> | ||
| 19 | </Fragment> | ||
| 20 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductWithCommandLineParameters/ProductWithCommandLineParameters.wixproj b/src/test/msi/TestData/UtilExtensionGroupTests/ProductWithCommandLineParameters/ProductWithCommandLineParameters.wixproj new file mode 100644 index 00000000..93a56216 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductWithCommandLineParameters/ProductWithCommandLineParameters.wixproj | |||
| @@ -0,0 +1,13 @@ | |||
| 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 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <PropertyGroup> | ||
| 4 | <UpgradeCode>{79F2CB65-1E71-42EB-AA30-51BD70C29B23}</UpgradeCode> | ||
| 5 | <ProductComponentsRef>true</ProductComponentsRef> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Product.wxs" Link="Product.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | <ItemGroup> | ||
| 11 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 12 | </ItemGroup> | ||
| 13 | </Project> | ||
diff --git a/src/test/msi/TestData/UtilExtensionGroupTests/ProductWithCommandLineParameters/ProductWithCommandLineParameters.wxs b/src/test/msi/TestData/UtilExtensionGroupTests/ProductWithCommandLineParameters/ProductWithCommandLineParameters.wxs new file mode 100644 index 00000000..059ecee8 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionGroupTests/ProductWithCommandLineParameters/ProductWithCommandLineParameters.wxs | |||
| @@ -0,0 +1,19 @@ | |||
| 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 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
| 3 | <Fragment> | ||
| 4 | <ComponentGroup Id="ProductComponents"> | ||
| 5 | <ComponentRef Id="Component1" /> | ||
| 6 | </ComponentGroup> | ||
| 7 | </Fragment> | ||
| 8 | |||
| 9 | <Fragment> | ||
| 10 | <Component Id="Component1" | ||
| 11 | Guid="1FDC6C4D-7741-4BF1-A4F0-4231879CEC45" | ||
| 12 | Directory="INSTALLFOLDER"> | ||
| 13 | <util:Group Id="TEST_GROUP1" | ||
| 14 | Name="[TESTPARAMETER1]" | ||
| 15 | CreateGroup="yes" | ||
| 16 | RemoveOnUninstall="yes" /> | ||
| 17 | </Component> | ||
| 18 | </Fragment> | ||
| 19 | </Wix> | ||
diff --git a/src/test/msi/WixToolsetTest.MsiE2E/UtilExtensionGroupTests.cs b/src/test/msi/WixToolsetTest.MsiE2E/UtilExtensionGroupTests.cs new file mode 100644 index 00000000..796c4ecd --- /dev/null +++ b/src/test/msi/WixToolsetTest.MsiE2E/UtilExtensionGroupTests.cs | |||
| @@ -0,0 +1,271 @@ | |||
| 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 | |||
| 3 | namespace WixToolsetTest.MsiE2E | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using WixTestTools; | ||
| 7 | using Xunit; | ||
| 8 | using Xunit.Abstractions; | ||
| 9 | |||
| 10 | public class UtilExtensionGroupTests : MsiE2ETests | ||
| 11 | { | ||
| 12 | public UtilExtensionGroupTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } | ||
| 13 | |||
| 14 | // Verify that the users specified in the authoring are created as expected. | ||
| 15 | [RuntimeFact] | ||
| 16 | public void CanInstallAndUninstallGroups() | ||
| 17 | { | ||
| 18 | UserGroupVerifier.CreateLocalGroup("testName3"); | ||
| 19 | var productA = this.CreatePackageInstaller("ProductA"); | ||
| 20 | |||
| 21 | productA.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); | ||
| 22 | |||
| 23 | // Validate New User Information. | ||
| 24 | Assert.True(UserGroupVerifier.GroupExists(String.Empty, "testName1"), String.Format("Group '{0}' was not created on Install", "testName1")); | ||
| 25 | Assert.True(UserGroupVerifier.GroupExists(String.Empty, "testName2"), String.Format("Group '{0}' was not created on Install", "testName2")); | ||
| 26 | Assert.True(UserGroupVerifier.GroupExists(String.Empty, "testName3"), String.Format("Group '{0}' was not created on Install", "testName3")); | ||
| 27 | |||
| 28 | productA.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); | ||
| 29 | |||
| 30 | // Verify Users marked as RemoveOnUninstall were removed. | ||
| 31 | Assert.False(UserGroupVerifier.GroupExists(String.Empty, "testName1"), String.Format("Group '{0}' was not removed on Uninstall", "testName1")); | ||
| 32 | Assert.True(UserGroupVerifier.GroupExists(String.Empty, "testName2"), String.Format("Group '{0}' was removed on Uninstall", "testName2")); | ||
| 33 | |||
| 34 | // clean up | ||
| 35 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 36 | UserGroupVerifier.DeleteLocalGroup("testName2"); | ||
| 37 | UserGroupVerifier.DeleteLocalGroup("testName3"); | ||
| 38 | } | ||
| 39 | |||
| 40 | // Verify the rollback action reverts all Users changes. | ||
| 41 | [RuntimeFact] | ||
| 42 | public void CanRollbackGroups() | ||
| 43 | { | ||
| 44 | UserGroupVerifier.CreateLocalGroup("testName3"); | ||
| 45 | var productFail = this.CreatePackageInstaller("ProductFail"); | ||
| 46 | |||
| 47 | // make sure the user accounts are deleted before we start | ||
| 48 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 49 | UserGroupVerifier.DeleteLocalGroup("testName2"); | ||
| 50 | |||
| 51 | productFail.InstallProduct(MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); | ||
| 52 | |||
| 53 | // Verify added Users were removed on rollback. | ||
| 54 | Assert.False(UserGroupVerifier.GroupExists(String.Empty, "testName1"), String.Format("Group '{0}' was not removed on Rollback", "testName1")); | ||
| 55 | Assert.False(UserGroupVerifier.GroupExists(String.Empty, "testName2"), String.Format("Group '{0}' was not removed on Rollback", "testName2")); | ||
| 56 | |||
| 57 | // clean up | ||
| 58 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 59 | UserGroupVerifier.DeleteLocalGroup("testName2"); | ||
| 60 | UserGroupVerifier.DeleteLocalGroup("testName3"); | ||
| 61 | } | ||
| 62 | |||
| 63 | |||
| 64 | // Verify that command-line parameters aer not blocked by repair switches. | ||
| 65 | // Original code signalled repair mode by using "-f ", which silently | ||
| 66 | // terminated the command-line parsing, ignoring any parameters that followed. | ||
| 67 | [RuntimeFact()] | ||
| 68 | public void CanRepairGroupsWithCommandLineParameters() | ||
| 69 | { | ||
| 70 | var arguments = new string[] | ||
| 71 | { | ||
| 72 | "TESTPARAMETER1=testName1", | ||
| 73 | }; | ||
| 74 | var productWithCommandLineParameters = this.CreatePackageInstaller("ProductWithCommandLineParameters"); | ||
| 75 | |||
| 76 | // Make sure that the user doesn't exist when we start the test. | ||
| 77 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 78 | |||
| 79 | // Install | ||
| 80 | productWithCommandLineParameters.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS, arguments); | ||
| 81 | |||
| 82 | // Repair | ||
| 83 | productWithCommandLineParameters.RepairProduct(MSIExec.MSIExecReturnCode.SUCCESS, arguments); | ||
| 84 | |||
| 85 | // Clean up | ||
| 86 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 87 | } | ||
| 88 | |||
| 89 | |||
| 90 | // Verify that the groups specified in the authoring are created as expected on repair. | ||
| 91 | [RuntimeFact()] | ||
| 92 | public void CanRepairGroups() | ||
| 93 | { | ||
| 94 | UserGroupVerifier.CreateLocalGroup("testName3"); | ||
| 95 | var productA = this.CreatePackageInstaller("ProductA"); | ||
| 96 | |||
| 97 | productA.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); | ||
| 98 | |||
| 99 | // Validate New User Information. | ||
| 100 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 101 | |||
| 102 | productA.RepairProduct(MSIExec.MSIExecReturnCode.SUCCESS); | ||
| 103 | |||
| 104 | // Validate New User Information. | ||
| 105 | Assert.True(UserGroupVerifier.GroupExists(String.Empty, "testName1"), String.Format("User '{0}' was not installed on Repair", "testName1")); | ||
| 106 | Assert.True(UserGroupVerifier.GroupExists(String.Empty, "testName2"), String.Format("User '{0}' was not installed after Repair", "testName2")); | ||
| 107 | |||
| 108 | productA.UninstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); | ||
| 109 | |||
| 110 | // Verify Users marked as RemoveOnUninstall were removed. | ||
| 111 | Assert.False(UserGroupVerifier.GroupExists(String.Empty, "testName1"), String.Format("User '{0}' was not removed on Uninstall", "testName1")); | ||
| 112 | Assert.True(UserGroupVerifier.GroupExists(String.Empty, "testName2"), String.Format("User '{0}' was removed on Uninstall", "testName2")); | ||
| 113 | |||
| 114 | // clean up | ||
| 115 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 116 | UserGroupVerifier.DeleteLocalGroup("testName2"); | ||
| 117 | UserGroupVerifier.DeleteLocalGroup("testName3"); | ||
| 118 | } | ||
| 119 | |||
| 120 | // Verify that Installation fails if FailIfExists is set. | ||
| 121 | [RuntimeFact] | ||
| 122 | public void FailsIfGroupExists() | ||
| 123 | { | ||
| 124 | var productFailIfExists = this.CreatePackageInstaller("ProductFailIfExists"); | ||
| 125 | |||
| 126 | // Create 'existinggroup' | ||
| 127 | UserGroupVerifier.CreateLocalGroup("existinggroup"); | ||
| 128 | |||
| 129 | try | ||
| 130 | { | ||
| 131 | productFailIfExists.InstallProduct(MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); | ||
| 132 | |||
| 133 | // Verify User still exists. | ||
| 134 | bool userExists = UserGroupVerifier.GroupExists(String.Empty, "existinggroup"); | ||
| 135 | |||
| 136 | Assert.True(userExists, String.Format("Group '{0}' was removed on Rollback", "existinggroup")); | ||
| 137 | } | ||
| 138 | finally | ||
| 139 | { | ||
| 140 | // clean up | ||
| 141 | UserGroupVerifier.DeleteLocalGroup("existinggroup"); | ||
| 142 | } | ||
| 143 | } | ||
| 144 | |||
| 145 | // Verify that a group cannot be created on a domain on which you don't have create user permission. | ||
| 146 | [RuntimeFact] | ||
| 147 | public void FailsIfRestrictedDomain() | ||
| 148 | { | ||
| 149 | var productRestrictedDomain = this.CreatePackageInstaller("ProductRestrictedDomain"); | ||
| 150 | |||
| 151 | string logFile = productRestrictedDomain.InstallProduct(MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE, "TEMPDOMAIN=DOESNOTEXIST"); | ||
| 152 | |||
| 153 | // Verify expected error message in the log file | ||
| 154 | Assert.True(LogVerifier.MessageInLogFile(logFile, "CreateGroup: Error 0x8007054b: failed to find Domain DOESNOTEXIST.")); | ||
| 155 | } | ||
| 156 | |||
| 157 | // Verify that a group can be created with a group comment | ||
| 158 | [RuntimeFact] | ||
| 159 | public void CanCreateNewGroupWithComment() | ||
| 160 | { | ||
| 161 | var productNewUserWithComment = this.CreatePackageInstaller("ProductNewGroupWithComment"); | ||
| 162 | |||
| 163 | productNewUserWithComment.InstallProduct(); | ||
| 164 | UserGroupVerifier.VerifyGroupComment(String.Empty, "testName1", "testComment1"); | ||
| 165 | |||
| 166 | // clean up | ||
| 167 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 168 | } | ||
| 169 | |||
| 170 | // Verify that a comment can be added to an existing group | ||
| 171 | [RuntimeFact] | ||
| 172 | public void CanAddCommentToExistingGroup() | ||
| 173 | { | ||
| 174 | UserGroupVerifier.CreateLocalGroup("testName1"); | ||
| 175 | var productAddCommentToExistingUser = this.CreatePackageInstaller("ProductAddCommentToExistingGroup"); | ||
| 176 | |||
| 177 | productAddCommentToExistingUser.InstallProduct(); | ||
| 178 | |||
| 179 | UserGroupVerifier.VerifyGroupComment(String.Empty, "testName1", "testComment1"); | ||
| 180 | |||
| 181 | // clean up | ||
| 182 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 183 | } | ||
| 184 | |||
| 185 | // Verify that a comment can be repaired for a new group | ||
| 186 | [RuntimeFact] | ||
| 187 | public void CanRepairCommentOfNewGroup() | ||
| 188 | { | ||
| 189 | var productNewUserWithComment = this.CreatePackageInstaller("ProductNewGroupWithComment"); | ||
| 190 | |||
| 191 | productNewUserWithComment.InstallProduct(); | ||
| 192 | UserGroupVerifier.SetGroupComment(String.Empty, "testName1", ""); | ||
| 193 | |||
| 194 | productNewUserWithComment.RepairProduct(); | ||
| 195 | UserGroupVerifier.VerifyGroupComment(String.Empty, "testName1", "testComment1"); | ||
| 196 | |||
| 197 | // clean up | ||
| 198 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 199 | } | ||
| 200 | |||
| 201 | // Verify that a comment can be changed for an existing group | ||
| 202 | [RuntimeFact] | ||
| 203 | public void CanChangeCommentOfExistingGroup() | ||
| 204 | { | ||
| 205 | UserGroupVerifier.CreateLocalGroup("testName1"); | ||
| 206 | UserGroupVerifier.SetGroupComment(String.Empty, "testName1", "initialTestComment1"); | ||
| 207 | var productNewUserWithComment = this.CreatePackageInstaller("ProductNewGroupWithComment"); | ||
| 208 | |||
| 209 | productNewUserWithComment.InstallProduct(); | ||
| 210 | UserGroupVerifier.VerifyGroupComment(String.Empty, "testName1", "testComment1"); | ||
| 211 | |||
| 212 | // clean up | ||
| 213 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 214 | } | ||
| 215 | |||
| 216 | // Verify that a comment can be rolled back for an existing group | ||
| 217 | [RuntimeFact] | ||
| 218 | public void CanRollbackCommentOfExistingGroup() | ||
| 219 | { | ||
| 220 | UserGroupVerifier.CreateLocalGroup("testName1"); | ||
| 221 | UserGroupVerifier.SetGroupComment(String.Empty, "testName1", "initialTestComment1"); | ||
| 222 | var productCommentFail = this.CreatePackageInstaller("ProductCommentFail"); | ||
| 223 | |||
| 224 | productCommentFail.InstallProduct(MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); | ||
| 225 | |||
| 226 | // Verify that comment change was rolled back. | ||
| 227 | UserGroupVerifier.VerifyGroupComment(String.Empty, "testName1", "initialTestComment1"); | ||
| 228 | |||
| 229 | // clean up | ||
| 230 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 231 | } | ||
| 232 | |||
| 233 | // Verify that a comment can be deleted for an existing group | ||
| 234 | [RuntimeFact] | ||
| 235 | public void CanDeleteCommentOfExistingGroup() | ||
| 236 | { | ||
| 237 | UserGroupVerifier.CreateLocalGroup("testName1"); | ||
| 238 | UserGroupVerifier.SetGroupComment(String.Empty, "testName1", "testComment1"); | ||
| 239 | var productCommentDelete = this.CreatePackageInstaller("ProductCommentDelete"); | ||
| 240 | |||
| 241 | productCommentDelete.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); | ||
| 242 | |||
| 243 | // Verify that comment was removed. | ||
| 244 | UserGroupVerifier.VerifyGroupComment(String.Empty, "testName1", ""); | ||
| 245 | |||
| 246 | // clean up | ||
| 247 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 248 | } | ||
| 249 | |||
| 250 | // Verify that a comment can be deleted for an existing group | ||
| 251 | [RuntimeFact] | ||
| 252 | public void CanNestGroups() | ||
| 253 | { | ||
| 254 | var productNestedGroups = this.CreatePackageInstaller("ProductNestedGroups"); | ||
| 255 | |||
| 256 | productNestedGroups.InstallProduct(MSIExec.MSIExecReturnCode.SUCCESS); | ||
| 257 | |||
| 258 | // Verify group nested membership | ||
| 259 | UserGroupVerifier.VerifyIsMemberOf(String.Empty, "Administrators", new string[] { "testName1", "testName2" }); | ||
| 260 | UserGroupVerifier.VerifyIsMemberOf(String.Empty, "Power Users", new string[] { "testName1" }); | ||
| 261 | |||
| 262 | UserGroupVerifier.VerifyIsNotMemberOf(String.Empty, "Administrators", new string[] { "testName3" }); | ||
| 263 | UserGroupVerifier.VerifyIsNotMemberOf(String.Empty, "Power Users", new string[] { "testName2", "testName3" }); | ||
| 264 | |||
| 265 | // clean up | ||
| 266 | UserGroupVerifier.DeleteLocalGroup("testName1"); | ||
| 267 | UserGroupVerifier.DeleteLocalGroup("testName2"); | ||
| 268 | UserGroupVerifier.DeleteLocalGroup("testName3"); | ||
| 269 | } | ||
| 270 | } | ||
| 271 | } | ||
