diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-06-09 11:30:46 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-06-09 13:47:53 -0500 |
| commit | 56105916271ff9a7c0bfa237b45b9b3fab9c570b (patch) | |
| tree | 828aff9543e541b42ed45198e6bd3e0aa065c137 /src/test | |
| parent | d47c73dbcd0a314cf3346b9b1294063ed4a124c4 (diff) | |
| download | wix-56105916271ff9a7c0bfa237b45b9b3fab9c570b.tar.gz wix-56105916271ff9a7c0bfa237b45b9b3fab9c570b.tar.bz2 wix-56105916271ff9a7c0bfa237b45b9b3fab9c570b.zip | |
Fix building and perf for bundles with 1000s of package and BA payloads
Fixes other half of #5300
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/burn/TestData/Manual/BundleB/Bundle.wxs | 56 | ||||
| -rw-r--r-- | src/test/burn/TestData/Manual/BundleB/BundleB.wixproj | 32 | ||||
| -rw-r--r-- | src/test/burn/TestData/Manual/BundleB/BundleB.wxs | 15 | ||||
| -rw-r--r-- | src/test/burn/TestData/Manual/BundleB/ba.xslt | 21 | ||||
| -rw-r--r-- | src/test/burn/TestData/Manual/BundleB/package.xslt | 21 | ||||
| -rw-r--r-- | src/test/burn/TestExe/Task.cs | 22 |
6 files changed, 167 insertions, 0 deletions
diff --git a/src/test/burn/TestData/Manual/BundleB/Bundle.wxs b/src/test/burn/TestData/Manual/BundleB/Bundle.wxs new file mode 100644 index 00000000..615d4b1d --- /dev/null +++ b/src/test/burn/TestData/Manual/BundleB/Bundle.wxs | |||
| @@ -0,0 +1,56 @@ | |||
| 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 | <?ifndef Version?> | ||
| 4 | <?define Version = 1.0.0.0?> | ||
| 5 | <?endif?> | ||
| 6 | |||
| 7 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
| 8 | <!-- The only difference from the template should be the SplashScreen --> | ||
| 9 | <Bundle Name="~$(var.TestGroupName) - $(var.BundleName)" Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)" Compressed="yes" SplashScreenSourceFile="..\BafThmutilTesting\theme\star_transparent.bmp"> | ||
| 10 | <Log Prefix="~$(var.TestGroupName)_$(var.BundleName)" /> | ||
| 11 | |||
| 12 | <Variable Name="TestGroupName" Value="$(var.TestGroupName)" /> | ||
| 13 | |||
| 14 | <?ifdef SoftwareTag?> | ||
| 15 | <SoftwareTag Regid="regid.1995-08.com.example" InstallPath="[CommonAppDataFolder]regid.1995-08.com.example" /> | ||
| 16 | <?endif?> | ||
| 17 | |||
| 18 | <?ifndef BA?> | ||
| 19 | <!-- pulled in through the PackageGroupRef below --> | ||
| 20 | <?elseif $(var.BA) = "TestBAdnc"?> | ||
| 21 | <!-- pulled in through the PackageGroupRef below --> | ||
| 22 | <?elseif $(var.BA) = "TestBA_x64"?> | ||
| 23 | <!-- pulled in through the PackageGroupRef below --> | ||
| 24 | <?elseif $(var.BA) = "TestBAdnc_x64"?> | ||
| 25 | <!-- pulled in through the PackageGroupRef below --> | ||
| 26 | <?elseif $(var.BA) = "WixBA"?> | ||
| 27 | <!-- pulled in through the PackageGroupRef below --> | ||
| 28 | <?elseif $(var.BA) = "WixBAdnc_x64"?> | ||
| 29 | <!-- pulled in through the PackageGroupRef below --> | ||
| 30 | <?elseif $(var.BA) = "hyperlinkLicense"?> | ||
| 31 | <BootstrapperApplication> | ||
| 32 | <bal:WixStandardBootstrapperApplication LicenseUrl="" Theme="hyperlinkLicense" /> | ||
| 33 | </BootstrapperApplication> | ||
| 34 | <?else?> | ||
| 35 | <BootstrapperApplicationRef Id="$(var.BA)" /> | ||
| 36 | <?endif?> | ||
| 37 | |||
| 38 | <Chain> | ||
| 39 | <?ifndef BA?> | ||
| 40 | <PackageGroupRef Id="TestBA" /> | ||
| 41 | <?elseif $(var.BA) = "TestBAdnc"?> | ||
| 42 | <PackageGroupRef Id="TestBAdnc" /> | ||
| 43 | <?elseif $(var.BA) = "TestBA_x64"?> | ||
| 44 | <PackageGroupRef Id="TestBA_x64" /> | ||
| 45 | <?elseif $(var.BA) = "TestBAdnc_x64"?> | ||
| 46 | <PackageGroupRef Id="TestBAdnc_x64" /> | ||
| 47 | <?elseif $(var.BA) = "WixBA"?> | ||
| 48 | <PackageGroupRef Id="WixBA" /> | ||
| 49 | <?elseif $(var.BA) = "WixBAdnc_x64"?> | ||
| 50 | <PackageGroupRef Id="WixBAdnc_x64" /> | ||
| 51 | <?endif?> | ||
| 52 | |||
| 53 | <PackageGroupRef Id="BundlePackages" /> | ||
| 54 | </Chain> | ||
| 55 | </Bundle> | ||
| 56 | </Wix> | ||
diff --git a/src/test/burn/TestData/Manual/BundleB/BundleB.wixproj b/src/test/burn/TestData/Manual/BundleB/BundleB.wixproj new file mode 100644 index 00000000..35c92246 --- /dev/null +++ b/src/test/burn/TestData/Manual/BundleB/BundleB.wixproj | |||
| @@ -0,0 +1,32 @@ | |||
| 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 | <OutputType>Bundle</OutputType> | ||
| 5 | <BA>hyperlinkLicense</BA> | ||
| 6 | <UpgradeCode>{5DE2F206-3C37-4265-81F7-095284E16B08}</UpgradeCode> | ||
| 7 | <HarvestDirectoryAdditionalOptions>-generate payloadgroup</HarvestDirectoryAdditionalOptions> | ||
| 8 | </PropertyGroup> | ||
| 9 | <ItemGroup> | ||
| 10 | <HarvestDirectory Include="BAPayloads"> | ||
| 11 | <ComponentGroupName>BAPayloads</ComponentGroupName> | ||
| 12 | <DirectoryRefId>BAPayloads</DirectoryRefId> | ||
| 13 | <Transforms>ba.xslt</Transforms> | ||
| 14 | </HarvestDirectory> | ||
| 15 | <HarvestDirectory Include="PackagePayloads"> | ||
| 16 | <ComponentGroupName>PackagePayloads</ComponentGroupName> | ||
| 17 | <DirectoryRefId>PackagePayloads</DirectoryRefId> | ||
| 18 | <Transforms>package.xslt</Transforms> | ||
| 19 | </HarvestDirectory> | ||
| 20 | </ItemGroup> | ||
| 21 | <ItemGroup> | ||
| 22 | <ProjectReference Include="..\PackageA\PackageA.wixproj" /> | ||
| 23 | </ItemGroup> | ||
| 24 | <ItemGroup> | ||
| 25 | <PackageReference Include="WixToolset.Bal.wixext" /> | ||
| 26 | </ItemGroup> | ||
| 27 | <!-- We do this dynamically to avoid committing so many files to source control. --> | ||
| 28 | <Target Name="CreateThousandsOfFiles" AfterTargets="BeforeBuild"> | ||
| 29 | <Exec Command='"$(BaseOutputPath)$(Configuration)\netcoreapp3.1\win-x86\testexe.exe" /gf "BAPayloads|10000' WorkingDirectory="$(MSBuildProjectDirectory)" /> | ||
| 30 | <Exec Command='"$(BaseOutputPath)$(Configuration)\netcoreapp3.1\win-x86\testexe.exe" /gf "PackagePayloads|10000' WorkingDirectory="$(MSBuildProjectDirectory)" /> | ||
| 31 | </Target> | ||
| 32 | </Project> \ No newline at end of file | ||
diff --git a/src/test/burn/TestData/Manual/BundleB/BundleB.wxs b/src/test/burn/TestData/Manual/BundleB/BundleB.wxs new file mode 100644 index 00000000..3b189b15 --- /dev/null +++ b/src/test/burn/TestData/Manual/BundleB/BundleB.wxs | |||
| @@ -0,0 +1,15 @@ | |||
| 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:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
| 5 | <Fragment> | ||
| 6 | <BootstrapperApplication> | ||
| 7 | <PayloadGroupRef Id="BAPayloads" /> | ||
| 8 | </BootstrapperApplication> | ||
| 9 | <PackageGroup Id="BundlePackages"> | ||
| 10 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)"> | ||
| 11 | <PayloadGroupRef Id="PackagePayloads" /> | ||
| 12 | </MsiPackage> | ||
| 13 | </PackageGroup> | ||
| 14 | </Fragment> | ||
| 15 | </Wix> | ||
diff --git a/src/test/burn/TestData/Manual/BundleB/ba.xslt b/src/test/burn/TestData/Manual/BundleB/ba.xslt new file mode 100644 index 00000000..54bc7fe6 --- /dev/null +++ b/src/test/burn/TestData/Manual/BundleB/ba.xslt | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| 3 | xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" | ||
| 4 | xmlns:wix="http://wixtoolset.org/schemas/v4/wxs" | ||
| 5 | > | ||
| 6 | <xsl:output method="xml" indent="yes"/> | ||
| 7 | |||
| 8 | <xsl:template match="@* | node()"> | ||
| 9 | <xsl:copy> | ||
| 10 | <xsl:apply-templates select="@* | node()"/> | ||
| 11 | </xsl:copy> | ||
| 12 | </xsl:template> | ||
| 13 | |||
| 14 | <xsl:template match="wix:Payload" > | ||
| 15 | <xsl:copy> | ||
| 16 | <xsl:apply-templates select="@* | node()"/> | ||
| 17 | <xsl:attribute name="Id">ba_<xsl:value-of select="substring(@SourceFile, 11)" /></xsl:attribute> | ||
| 18 | <xsl:attribute name="SourceFile">BAPayloads<xsl:value-of select="substring(@SourceFile, 10)" /></xsl:attribute> | ||
| 19 | </xsl:copy> | ||
| 20 | </xsl:template> | ||
| 21 | </xsl:stylesheet> | ||
diff --git a/src/test/burn/TestData/Manual/BundleB/package.xslt b/src/test/burn/TestData/Manual/BundleB/package.xslt new file mode 100644 index 00000000..304ff78b --- /dev/null +++ b/src/test/burn/TestData/Manual/BundleB/package.xslt | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| 3 | xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" | ||
| 4 | xmlns:wix="http://wixtoolset.org/schemas/v4/wxs" | ||
| 5 | > | ||
| 6 | <xsl:output method="xml" indent="yes"/> | ||
| 7 | |||
| 8 | <xsl:template match="@* | node()"> | ||
| 9 | <xsl:copy> | ||
| 10 | <xsl:apply-templates select="@* | node()"/> | ||
| 11 | </xsl:copy> | ||
| 12 | </xsl:template> | ||
| 13 | |||
| 14 | <xsl:template match="wix:Payload" > | ||
| 15 | <xsl:copy> | ||
| 16 | <xsl:apply-templates select="@* | node()"/> | ||
| 17 | <xsl:attribute name="Id">package_<xsl:value-of select="substring(@SourceFile, 11)" /></xsl:attribute> | ||
| 18 | <xsl:attribute name="SourceFile">PackagePayloads<xsl:value-of select="substring(@SourceFile, 10)" /></xsl:attribute> | ||
| 19 | </xsl:copy> | ||
| 20 | </xsl:template> | ||
| 21 | </xsl:stylesheet> | ||
diff --git a/src/test/burn/TestExe/Task.cs b/src/test/burn/TestExe/Task.cs index 7d39bfd9..59f774fb 100644 --- a/src/test/burn/TestExe/Task.cs +++ b/src/test/burn/TestExe/Task.cs | |||
| @@ -59,6 +59,24 @@ namespace TestExe | |||
| 59 | } | 59 | } |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | public class GenerateFilesTask : Task | ||
| 63 | { | ||
| 64 | public GenerateFilesTask(string Data) : base(Data) { } | ||
| 65 | |||
| 66 | public override void RunTask() | ||
| 67 | { | ||
| 68 | string[] tokens = this.data.Split(new char[] { '|' }, 2); | ||
| 69 | string folderPath = System.Environment.ExpandEnvironmentVariables(tokens[0]); | ||
| 70 | long size = long.Parse(tokens[1]); | ||
| 71 | Directory.CreateDirectory(folderPath); | ||
| 72 | var bytes = new byte[0]; | ||
| 73 | for (long i = 1; i <= size; i++) | ||
| 74 | { | ||
| 75 | File.WriteAllBytes(Path.Combine(folderPath, $"{i}.txt"), bytes); | ||
| 76 | } | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 62 | public class LargeFileTask : Task | 80 | public class LargeFileTask : Task |
| 63 | { | 81 | { |
| 64 | public LargeFileTask(string Data) : base(Data) { } | 82 | public LargeFileTask(string Data) : base(Data) { } |
| @@ -163,6 +181,10 @@ namespace TestExe | |||
| 163 | t = new SleepRandomTask(args[i + 1]); | 181 | t = new SleepRandomTask(args[i + 1]); |
| 164 | tasks.Add(t); | 182 | tasks.Add(t); |
| 165 | break; | 183 | break; |
| 184 | case "/gf": | ||
| 185 | t = new GenerateFilesTask(args[i + 1]); | ||
| 186 | tasks.Add(t); | ||
| 187 | break; | ||
| 166 | case "/lf": | 188 | case "/lf": |
| 167 | t = new LargeFileTask(args[i + 1]); | 189 | t = new LargeFileTask(args[i + 1]); |
| 168 | tasks.Add(t); | 190 | tasks.Add(t); |
