diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-04-28 21:02:23 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-04-29 00:23:14 -0500 |
commit | 5b04bce6567855325810bc4e6bcd2f6e05b329c7 (patch) | |
tree | a36e140d36c83a2ef7e81a88d941dd792bef3f55 /src/test/msi/TestData | |
parent | 681da11cfc9a266304b47b88843cb8a365015c63 (diff) | |
download | wix-5b04bce6567855325810bc4e6bcd2f6e05b329c7.tar.gz wix-5b04bce6567855325810bc4e6bcd2f6e05b329c7.tar.bz2 wix-5b04bce6567855325810bc4e6bcd2f6e05b329c7.zip |
Port UtilExtension.UserTests from wix3.
Diffstat (limited to 'src/test/msi/TestData')
13 files changed, 268 insertions, 0 deletions
diff --git a/src/test/msi/TestData/Templates/CustomActionFail.exe b/src/test/msi/TestData/Templates/CustomActionFail.exe new file mode 100644 index 00000000..cceffe91 --- /dev/null +++ b/src/test/msi/TestData/Templates/CustomActionFail.exe | |||
Binary files differ | |||
diff --git a/src/test/msi/TestData/Templates/Product.wxs b/src/test/msi/TestData/Templates/Product.wxs new file mode 100644 index 00000000..c7604c1b --- /dev/null +++ b/src/test/msi/TestData/Templates/Product.wxs | |||
@@ -0,0 +1,47 @@ | |||
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 | |||
5 | <?ifndef Version?> | ||
6 | <?define Version = 1.0.0.0?> | ||
7 | <?endif?> | ||
8 | |||
9 | <?ifndef ProductCode?> | ||
10 | <?define ProductCode = *?> | ||
11 | <?endif?> | ||
12 | |||
13 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
14 | <Package Name="~$(var.TestGroupName) - $(var.PackageName)" Language="1033" Version="$(var.Version)" Manufacturer="WixToolset" UpgradeCode="$(var.UpgradeCode)" Compressed="yes" ProductCode="$(var.ProductCode)"> | ||
15 | <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | ||
16 | <?ifndef CabPrefix?> | ||
17 | <MediaTemplate EmbedCab="yes" /> | ||
18 | <?else?> | ||
19 | <MediaTemplate CabinetTemplate="{0}$(var.CabPrefix).cab" /> | ||
20 | <?endif?> | ||
21 | |||
22 | <Feature Id="Complete" Level="1"> | ||
23 | <ComponentRef Id="FileComponent" /> | ||
24 | <?ifdef var.ProductComponents?> | ||
25 | <ComponentGroupRef Id="ProductComponents" /> | ||
26 | <?endif?> | ||
27 | </Feature> | ||
28 | </Package> | ||
29 | |||
30 | <Fragment> | ||
31 | <StandardDirectory Id="ProgramFiles6432Folder"> | ||
32 | <Directory Id="WixDir" Name="~Test WiX"> | ||
33 | <Directory Id="TestDir" Name="$(var.TestGroupName)"> | ||
34 | <Directory Id="INSTALLFOLDER" Name="$(var.PackageName)" /> | ||
35 | </Directory> | ||
36 | </Directory> | ||
37 | </StandardDirectory> | ||
38 | </Fragment> | ||
39 | |||
40 | <Fragment> | ||
41 | <Component Id="FileComponent" Guid="12345678-9ABC-DEF0-1234-567890000000" Directory="INSTALLFOLDER"> | ||
42 | <File Id="CAFile" Name="CustomActionFail.exe" Source="$(sys.SOURCEFILEDIR)\CustomActionFail.exe" /> | ||
43 | </Component> | ||
44 | |||
45 | <CustomAction Id="CaFail" FileRef="CAFile" Execute="immediate" Return="check" ExeCommand="" /> | ||
46 | </Fragment> | ||
47 | </Wix> | ||
diff --git a/src/test/msi/TestData/TestData.proj b/src/test/msi/TestData/TestData.proj new file mode 100644 index 00000000..9e130987 --- /dev/null +++ b/src/test/msi/TestData/TestData.proj | |||
@@ -0,0 +1,16 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- 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. --> | ||
3 | |||
4 | <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
5 | <ItemGroup> | ||
6 | <TestDataProject Include="**\*.wixproj" /> | ||
7 | </ItemGroup> | ||
8 | |||
9 | <Target Name="Build"> | ||
10 | <MSBuild Projects="%(TestDataProject.Identity)" /> | ||
11 | </Target> | ||
12 | |||
13 | <Target Name="Restore"> | ||
14 | <MSBuild Projects="%(TestDataProject.Identity)" Targets="Restore" /> | ||
15 | </Target> | ||
16 | </Project> | ||
diff --git a/src/test/msi/TestData/UtilExtensionUserTests/ProductA/ProductA.wixproj b/src/test/msi/TestData/UtilExtensionUserTests/ProductA/ProductA.wixproj new file mode 100644 index 00000000..fbc6f292 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/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>{1A1795A6-87C0-4A9A-ABD5-DF9BED697037}</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/UtilExtensionUserTests/ProductA/product.wxs b/src/test/msi/TestData/UtilExtensionUserTests/ProductA/product.wxs new file mode 100644 index 00000000..a7bec54e --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/ProductA/product.wxs | |||
@@ -0,0 +1,35 @@ | |||
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 | </Fragment> | ||
13 | |||
14 | <Fragment> | ||
15 | <util:Group Id="ADMIN" Name="Administrators" /> | ||
16 | <util:Group Id="POWER_USER" Name="Power Users" /> | ||
17 | |||
18 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
19 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
20 | |||
21 | <util:User Id="TEST_USER1" Name="testName1" Password="test123!@#" PasswordExpired="yes"> | ||
22 | <util:GroupRef Id="ADMIN" /> | ||
23 | <util:GroupRef Id="POWER_USER" /> | ||
24 | </util:User> | ||
25 | |||
26 | <util:User Id="TEST_USER2" Name="testName2" Password="test123!@#" Disabled="yes" RemoveOnUninstall="no" PasswordNeverExpires="yes" UpdateIfExists="yes"> | ||
27 | <util:GroupRef Id="POWER_USER" /> | ||
28 | </util:User> | ||
29 | |||
30 | <util:User Id="TEST_USER3" Name="[TEMPUSERNAME]" Domain="[TEMPDOMAIN]" CreateUser="no"> | ||
31 | <util:GroupRef Id="POWER_USER" /> | ||
32 | </util:User> | ||
33 | </Component> | ||
34 | </Fragment> | ||
35 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionUserTests/ProductFail/ProductFail.wixproj b/src/test/msi/TestData/UtilExtensionUserTests/ProductFail/ProductFail.wixproj new file mode 100644 index 00000000..e2fe3aa8 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/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/UtilExtensionUserTests/ProductFail/product_fail.wxs b/src/test/msi/TestData/UtilExtensionUserTests/ProductFail/product_fail.wxs new file mode 100644 index 00000000..c5da862c --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/ProductFail/product_fail.wxs | |||
@@ -0,0 +1,39 @@ | |||
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="Wix4ConfigureUsers_X86" /> | ||
15 | </InstallExecuteSequence> | ||
16 | </Fragment> | ||
17 | |||
18 | <Fragment> | ||
19 | <util:Group Id="ADMIN" Name="Administrators" /> | ||
20 | <util:Group Id="POWER_USER" Name="Power Users" /> | ||
21 | |||
22 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
23 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
24 | |||
25 | <util:User Id="TEST_USER1" Name="testName1" Password="test123!@#" PasswordExpired="yes"> | ||
26 | <util:GroupRef Id="ADMIN" /> | ||
27 | <util:GroupRef Id="POWER_USER" /> | ||
28 | </util:User> | ||
29 | |||
30 | <util:User Id="TEST_USER2" Name="testName2" Password="test123!@#" Disabled="yes" RemoveOnUninstall="no" PasswordNeverExpires="yes" UpdateIfExists="yes"> | ||
31 | <util:GroupRef Id="POWER_USER" /> | ||
32 | </util:User> | ||
33 | |||
34 | <util:User Id="TEST_USER3" Name="[TEMPUSERNAME]" Domain="[TEMPDOMAIN]" CreateUser="no"> | ||
35 | <util:GroupRef Id="POWER_USER" /> | ||
36 | </util:User> | ||
37 | </Component> | ||
38 | </Fragment> | ||
39 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionUserTests/ProductFailIfExists/FailIfExists.wxs b/src/test/msi/TestData/UtilExtensionUserTests/ProductFailIfExists/FailIfExists.wxs new file mode 100644 index 00000000..0da4f2b9 --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/ProductFailIfExists/FailIfExists.wxs | |||
@@ -0,0 +1,24 @@ | |||
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 | <util:Group Id="ADMIN" Name="Administrators" /> | ||
13 | <util:Group Id="POWER_USER" Name="Power Users" /> | ||
14 | |||
15 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
16 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
17 | |||
18 | <util:User Id="TEST_USER4" Name="existinguser" Password="test123!@#" LogonAsService="yes" FailIfExists="yes" RemoveOnUninstall="yes"> | ||
19 | <util:GroupRef Id="ADMIN" /> | ||
20 | <util:GroupRef Id="POWER_USER" /> | ||
21 | </util:User> | ||
22 | </Component> | ||
23 | </Fragment> | ||
24 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionUserTests/ProductFailIfExists/ProductFailIfExists.wixproj b/src/test/msi/TestData/UtilExtensionUserTests/ProductFailIfExists/ProductFailIfExists.wixproj new file mode 100644 index 00000000..9e1a836f --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/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/UtilExtensionUserTests/ProductNonVitalUserGroup/NonVitalUserGroup.wxs b/src/test/msi/TestData/UtilExtensionUserTests/ProductNonVitalUserGroup/NonVitalUserGroup.wxs new file mode 100644 index 00000000..461648ee --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/ProductNonVitalUserGroup/NonVitalUserGroup.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 | </Fragment> | ||
10 | |||
11 | <Fragment> | ||
12 | <util:Group Id="ShouldNotExist" Name="Should Not Exist" /> | ||
13 | |||
14 | <Component Id="Component1" Guid="00030829-0000-0000-C000-000000000046" Directory="INSTALLFOLDER"> | ||
15 | <File Source="$(sys.SOURCEFILEPATH)" KeyPath="yes" /> | ||
16 | |||
17 | <util:User Id="CurrentUser" Name="[LogonUser]" Domain="[%USERDOMAIN]" RemoveOnUninstall="no" Vital="no"> | ||
18 | <util:GroupRef Id="ShouldNotExist" /> | ||
19 | </util:User> | ||
20 | </Component> | ||
21 | </Fragment> | ||
22 | </Wix> | ||
diff --git a/src/test/msi/TestData/UtilExtensionUserTests/ProductNonVitalUserGroup/ProductNonVitalUserGroup.wixproj b/src/test/msi/TestData/UtilExtensionUserTests/ProductNonVitalUserGroup/ProductNonVitalUserGroup.wixproj new file mode 100644 index 00000000..8734224d --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/ProductNonVitalUserGroup/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/UtilExtensionUserTests/ProductRestrictedDomain/ProductRestrictedDomain.wixproj b/src/test/msi/TestData/UtilExtensionUserTests/ProductRestrictedDomain/ProductRestrictedDomain.wixproj new file mode 100644 index 00000000..e4a01a3a --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/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/UtilExtensionUserTests/ProductRestrictedDomain/RestrictedDomain.wxs b/src/test/msi/TestData/UtilExtensionUserTests/ProductRestrictedDomain/RestrictedDomain.wxs new file mode 100644 index 00000000..f200a06a --- /dev/null +++ b/src/test/msi/TestData/UtilExtensionUserTests/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:User Id="TEST_USER_test" Name="testName1" Domain="[TEMPDOMAIN]" Password="test123!@#" PasswordExpired="no" /> | ||
18 | </Component> | ||
19 | </Fragment> | ||
20 | </Wix> | ||