Skip to content

Commit

Permalink
Create manifest installers and VS manifests (#56308) (#56350)
Browse files Browse the repository at this point in the history
Co-authored-by: Jo Shields <directhex@apebox.org>
  • Loading branch information
steveisok and directhex authored Jul 27, 2021
1 parent 501a7ef commit 0b40759
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/workloads/workloads.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
<MicrosoftDotNetBuildTasksInstallersTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.installers\$(MicrosoftDotNetBuildTasksInstallersVersion)\tools\$(MicrosoftDotNetBuildTasksInstallersTaskTargetFramework)\Microsoft.DotNet.Build.Tasks.Installers.dll</MicrosoftDotNetBuildTasksInstallersTaskAssembly>
</PropertyGroup>

<UsingTask AssemblyFile="$(PkgMicrosoft_DotNet_Build_Tasks_Workloads)\tools\net472\Microsoft.DotNet.Build.Tasks.Workloads.dll" TaskName="GenerateManifestMsi" />
<UsingTask AssemblyFile="$(PkgMicrosoft_DotNet_Build_Tasks_Workloads)\tools\net472\Microsoft.DotNet.Build.Tasks.Workloads.dll" TaskName="GenerateVisualStudioWorkload" />

<UsingTask TaskName="GenerateMsiVersion" AssemblyFile="$(MicrosoftDotNetBuildTasksInstallersTaskAssembly)" />
<UsingTask TaskName="CreateLightCommandPackageDrop" AssemblyFile="$(MicrosoftDotNetBuildTasksInstallersTaskAssembly)" />

<PropertyGroup>
Expand Down Expand Up @@ -90,6 +91,23 @@
<ManifestPackages Include="$(PackageSource)Microsoft.NET.Workload.Mono.ToolChain.Manifest-*.nupkg" />
</ItemGroup>

<GenerateMsiVersion
Major="$([System.Version]::Parse('$(SDKBundleVersion)').Major)"
Minor="$([System.Version]::Parse('$(SDKBundleVersion)').Minor)"
Patch="$([System.Version]::Parse('$(SDKBundleVersion)').Build)"
BuildNumber="$([System.Version]::Parse('$(SDKBundleVersion)').Revision)" >
<Output TaskParameter="MsiVersion" PropertyName="MsiVersion" />
</GenerateMsiVersion>

<GenerateManifestMsi
IntermediateBaseOutputPath="$(IntermediateOutputPath)"
OutputPath="$(OutputPath)"
MsiVersion="$(MsiVersion)"
WixToolsetPath="$(WixToolsetPath)"
WorkloadManifestPackage="%(ManifestPackages.Identity)" >
<Output TaskParameter="Msis" ItemName="ManifestMsis" />
</GenerateManifestMsi>

<GenerateVisualStudioWorkload IntermediateBaseOutputPath="$(WorkloadIntermediateOutputPath)"
WixToolsetPath="$(WixToolsetPath)"
GenerateMsis="true"
Expand All @@ -103,9 +121,11 @@
</GenerateVisualStudioWorkload>

<!-- Build all the SWIX projects. This requires full framework MSBuild-->
<MSBuild Projects="%(ManifestMsis.SwixProject)" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=$(VersionedVisualStudioSetupInsertionPath)" />
<MSBuild Projects="@(SwixProjects)" Properties="SwixBuildTargets=$(SwixBuildTargets);ManifestOutputPath=$(VersionedVisualStudioSetupInsertionPath)" />

<!-- Gather .wixobj files for post-build signing. We'll have to batch since we generated multiple MSIs in the previous step. -->
<MSBuild Projects="$(MSBuildProjectFile)" Properties="_WixObjDir=%(ManifestMsis.WixObj);_Msi=%(ManifestMsis.Identity)" Targets="CreateWixPack" />
<MSBuild Projects="$(MSBuildProjectFile)" Properties="_WixObjDir=%(Msis.WixObj);_Msi=%(Msis.Identity)" Targets="CreateWixPack" />

<!-- Build the Visual Studio manifest project. -->
Expand All @@ -117,6 +137,7 @@

<!-- Build all the MSI payload packages for NuGet. -->
<ItemGroup>
<MsiPackageProjects Include="%(ManifestMsis.PackageProject)" />
<MsiPackageProjects Include="%(Msis.PackageProject)" />
</ItemGroup>

Expand Down

0 comments on commit 0b40759

Please sign in to comment.