Merge pull request #9935 from sfoslund/XamarinManifest

Adding workload manifests to installers
This commit is contained in:
Sarah Oslund 2021-03-18 15:05:04 -07:00 committed by GitHub
commit afbd4fa212
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 322 additions and 1 deletions

View file

@ -15,6 +15,8 @@
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet6-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json" />
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
<!-- Temporary feed for Xamarin workload manifest -->
<add key="xamarin" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources />
</configuration>

View file

@ -144,6 +144,15 @@
<DotnetDebToolVersion>2.0.0</DotnetDebToolVersion>
<MicrosoftNETTestSdkVersion>16.10.0-preview-20210317-02</MicrosoftNETTestSdkVersion>
</PropertyGroup>
<!-- Workload manifest package versions -->
<PropertyGroup>
<XamarinAndroidWorkloadManifestVersion>11.2.0-ci.d16-9.0</XamarinAndroidWorkloadManifestVersion>
<XamarinIOSWorkloadManifestVersion>14.4.100-ci.pr.gh10849.1206</XamarinIOSWorkloadManifestVersion>
<XamarinMacCatalystWorkloadManifestVersion>14.3.100-ci.pr.gh10849.351</XamarinMacCatalystWorkloadManifestVersion>
<XamarinMacOSWorkloadManifestVersion>11.1.100-ci.pr.gh10849.1259</XamarinMacOSWorkloadManifestVersion>
<XamarinTvOSWorkloadManifestVersion>14.3.100-ci.pr.gh10849.1259</XamarinTvOSWorkloadManifestVersion>
<BlazorWorkloadManifestVersion>6.0.0-preview.3.21161.5</BlazorWorkloadManifestVersion>
</PropertyGroup>
<PropertyGroup>
<!-- pinned dependency. This package is not being produced outside of the 2.0 branch of corefx and should not change. -->
<CLI_NETStandardLibraryNETFrameworkVersion>2.0.1-servicing-26011-01</CLI_NETStandardLibraryNETFrameworkVersion>

View file

@ -31,6 +31,7 @@
<Import Project="targets\Versions.targets" />
<Import Project="targets\Branding.targets" />
<Import Project="targets\BundledTemplates.targets" />
<Import Project="targets\BundledManifests.targets" />
<Import Project="targets\BundledDotnetTools.targets" />
<Import Project="targets\GenerateBundledVersions.targets" />
<Import Project="targets\Crossgen.targets" />

View file

@ -0,0 +1,72 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<BundledManifests Include="Microsoft.NET.Workload.Android" Version="$(XamarinAndroidWorkloadManifestVersion)" WorkloadManifestId="Microsoft.NET.Workload.Android" />
<BundledManifests Include="Microsoft.NET.Workload.iOS" Version="$(XamarinIOSWorkloadManifestVersion)" WorkloadManifestId="Microsoft.NET.Workload.iOS" />
<BundledManifests Include="Microsoft.NET.Workload.MacCatalyst" Version="$(XamarinMacCatalystWorkloadManifestVersion)" WorkloadManifestId="Microsoft.NET.Workload.MacCatalyst" />
<BundledManifests Include="Microsoft.NET.Workload.macOS" Version="$(XamarinMacOSWorkloadManifestVersion)" WorkloadManifestId="Microsoft.NET.Workload.macOS" />
<BundledManifests Include="Microsoft.NET.Workload.tvOS" Version="$(XamarinTvOSWorkloadManifestVersion)" WorkloadManifestId="Microsoft.NET.Workload.tvOS" />
<BundledManifests Include="Microsoft.NET.Sdk.BlazorWebAssembly.AOT" Version="$(BlazorWorkloadManifestVersion)" WorkloadManifestId="Microsoft.NET.Workload.BlazorWebAssembly" />
</ItemGroup>
<!-- Restore workload manifests via PackageReference -->
<ItemGroup>
<BundledManifestsForPackageDownload Include="@(BundledManifests)" >
<Version>[%(Version)]</Version>
</BundledManifestsForPackageDownload>
<PackageDownload Include="@(BundledManifestsForPackageDownload)" />
</ItemGroup>
<Target Name="LayoutManifests"
DependsOnTargets="LayoutManifestsForSDK;LayoutManifestsForMSI" />
<Target Name="LayoutManifestsForSDK"
DependsOnTargets="SetupBundledComponents;GenerateManifestVersions">
<Copy SourceFiles="@(ManifestContent)"
DestinationFolder="$(RedistLayoutPath)sdk-manifests/$(CliProductBandVersion)00/%(DestinationPath)"/>
</Target>
<Target Name="LayoutManifestsForMSI"
DependsOnTargets="SetupBundledComponents;GenerateManifestVersions"
Condition="$(ProductMonikerRid.StartsWith('win')) And '$(Architecture)' != 'arm'">
<Copy SourceFiles="@(ManifestContent)"
DestinationFolder="$(BaseOutputPath)$(Configuration)\sdk-manifests\sdk-manifests/$(CliProductBandVersion)00/%(DestinationPath)"/>
</Target>
<Target Name="GenerateManifestVersions">
<PropertyGroup>
<ManifestsMSIInstallerFile>$(ArtifactsNonShippingPackagesDir)dotnet-sdkmanifests-$(FullNugetVersion)-$(ProductMonikerRid)$(InstallerExtension)</ManifestsMSIInstallerFile>
<ManifestsDependencyKeyName>SDK_Manifests_$([MSBuild]::ValueOrDefault('$(Version)', '').Replace('-', '_'))</ManifestsDependencyKeyName>
<ManifestsBrandName>Microsoft .NET SDK Workload Manifests $(Version)</ManifestsBrandName>
<ManifestsLayoutPath>$(BaseOutputPath)$(Configuration)\sdk-manifests</ManifestsLayoutPath>
</PropertyGroup>
<GenerateMsiVersion BuildNumber="$(CombinedBuildNumberAndRevision)"
Major="$(VersionMajor)"
Minor="$(VersionMinor)"
Patch="$(VersionFeature)">
<Output TaskParameter="MsiVersion" PropertyName="ManifestMsiVersion" />
</GenerateMsiVersion>
<GenerateGuidFromName Name="$(ManifestsMSIInstallerFile)">
<Output TaskParameter="GeneratedGuid"
PropertyName="ManifestsInstallerUpgradeCode" />
</GenerateGuidFromName>
<ItemGroup>
<BundledManifests Update="@(BundledManifests)" >
<RestoredNupkgContentPath>$(NuGetPackageRoot)%(Identity)/%(Version)</RestoredNupkgContentPath>
</BundledManifests>
<ManifestContent Include="%(BundledManifests.RestoredNupkgContentPath)\**\*.json;%(BundledManifests.RestoredNupkgContentPath)\**\*.targets"
DestinationPath="%(WorkloadManifestId)/"/>
</ItemGroup>
</Target>
</Project>

View file

@ -501,6 +501,7 @@
GenerateBundledVersions;
LayoutRuntimeGraph;
LayoutTemplates;
LayoutManifests;
LayoutBundledTools;
RetargetTools;
CrossgenLayout;

View file

@ -97,6 +97,7 @@
<ItemGroup>
<GeneratedInstallers Include="$(SdkMSIInstallerFile);$(CombinedFrameworkSdkHostMSIInstallerFile);$(SdkPlaceholderMSIInstallerFile)" />
<GeneratedInstallers Include="@(TemplatesMsiComponent->'%(MSIInstallerFile)')" />
<GeneratedInstallers Include="@(BundledManifests->'%(MSIInstallerFile)')" />
</ItemGroup>
<GenerateMsiVersion BuildNumber="$(CombinedBuildNumberAndRevision)"
@ -270,8 +271,48 @@
</ItemGroup>
</Target>
<Target Name="GenerateManifestsMsi"
DependsOnTargets="GenerateLayout;AcquireWix;MsiTargetsSetupInputOutputs;SetSdkBrandingInfo"
Condition="$(ProductMonikerRid.StartsWith('win')) And '$(Architecture)' != 'arm'"
Inputs="@(BundledManifests);$(ManifestsGenerateMsiPowershellScript)"
Outputs="$(ManifestsMSIInstallerFile)">
<PropertyGroup>
<ManifestsGenerateMsiPowershellScript>$(MSBuildThisFileDirectory)packaging/windows/clisdk/generatemanifestsmsi.ps1</ManifestsGenerateMsiPowershellScript>
</PropertyGroup>
<Exec Command="powershell -NoProfile -NoLogo $(ManifestsGenerateMsiPowershellScript) ^
'$(ManifestsLayoutPath)' ^
'$(ManifestsMSIInstallerFile)' ^
'$(WixRoot)' ^
'$(ManifestsBrandName)' ^
'$(ManifestMsiVersion)' ^
'$(ManifestMsiVersion)' ^
'$(FullNugetVersion)' ^
'$(ManifestsInstallerUpgradeCode)' ^
'$(ManifestsDependencyKeyName)' ^
'$(Architecture)' ^
-InformationAction Continue" />
<ItemGroup>
<ManifestsMsiWixSrcFiles Include="$(WixRoot)\provider.wixobj" />
<ManifestsMsiWixSrcFiles Include="$(WixRoot)\Manifests.wixobj" />
<ManifestsMsiWixSrcFiles Include="$(WixRoot)\Manifest-install-files.wixobj" />
</ItemGroup>
<CreateLightCommandPackageDrop
LightCommandWorkingDir="$(LightCommandObjDir)"
OutputFolder="$(LightCommandPackagesDir)"
NoLogo="true"
Cultures="en-us"
InstallerFile="$(ArtifactsNonShippingPackagesDir)$(ManifestsMSIInstallerFile)"
WixExtensions="WixUIExtension;WixDependencyExtension;WixUtilExtension"
WixSrcFiles="@(ManifestsMsiWixSrcFiles)">
<Output TaskParameter="OutputFile" PropertyName="_LightCommandPackageNameOutput" />
</CreateLightCommandPackageDrop>
</Target>
<Target Name="GenerateSdkBundle"
DependsOnTargets="GenerateLayout;AcquireWix;MsiTargetsSetupInputOutputs;GenerateSdkMsi;SignSdkMsi;GenerateTemplatesMsis;SignTemplatesMsis"
DependsOnTargets="GenerateLayout;AcquireWix;MsiTargetsSetupInputOutputs;GenerateSdkMsi;SignSdkMsi;GenerateTemplatesMsis;GenerateManifestsMsi;SignTemplatesMsis"
Condition=" '$(OS)' == 'Windows_NT' "
Inputs="$(SdkMSIInstallerFile);
$(DownloadedSharedFrameworkInstallerFile);
@ -305,6 +346,7 @@
'$(DownloadsFolder)$(DownloadedAspNetTargetingPackInstallerFileName)' ^
'$(DownloadsFolder)$(DownloadedWindowsDesktopTargetingPackInstallerFileName)' ^
'$(LatestTemplateMsiInstallerFile)' ^
'$(ManifestsMsiInstallerFile)' ^
'$(CombinedFrameworkSdkHostMSIInstallerFile)' ^
'$(WixRoot)' ^
'$(SdkBrandName)' ^
@ -481,6 +523,7 @@
GenerateSdkMsi;
SignSdkMsi;
GenerateTemplatesMsis;
GenerateManifestsMsi;
SignTemplatesMsis;
GenerateSdkBundle;
SignSdkBundle;

View file

@ -175,6 +175,10 @@
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
<MsiProperty Name="ALLOWMSIINSTALL" Value="True" />
</MsiPackage>
<MsiPackage SourceFile="$(var.ManifestsMsiSourcePath)">
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
<MsiProperty Name="ALLOWMSIINSTALL" Value="True" />
</MsiPackage>
<MsiPackage SourceFile="$(var.CLISDKMsiSourcePath)">
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
<MsiProperty Name="DOTNETHOME_X86" Value="[DOTNETHOME_X86]" />

View file

@ -17,6 +17,7 @@ param(
[Parameter(Mandatory=$true)][string]$AspNetTargetingPackMSIFile,
[Parameter(Mandatory=$true)][string]$WindowsDesktopTargetingPackMSIFile,
[Parameter(Mandatory=$true)][string]$TemplatesMSIFile,
[Parameter(Mandatory=$true)][string]$ManifestsMSIFile,
[Parameter(Mandatory=$true)][string]$DotnetBundleOutput,
[Parameter(Mandatory=$true)][string]$WixRoot,
[Parameter(Mandatory=$true)][string]$ProductMoniker,
@ -63,6 +64,7 @@ function RunCandleForBundle
-dAspNetTargetingPackMsiSourcePath="$AspNetTargetingPackMSIFile" `
-dWindowsDesktopTargetingPackMsiSourcePath="$WindowsDesktopTargetingPackMSIFile" `
-dTemplatesMsiSourcePath="$TemplatesMSIFile" `
-dManifestsMsiSourcePath="$ManifestsMSIFile" `
-dWinFormsAndWpfVersion="$WindowsDesktopVersion" `
-dAdditionalSharedFXMsiSourcePath="$AdditionalSharedFxMSIFile" `
-dAdditionalHostFXRMsiSourcePath="$AdditionalHostFxrMSIFile" `

View file

@ -0,0 +1,151 @@
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
param(
[Parameter(Mandatory=$true)][string]$inputDir,
[Parameter(Mandatory=$true)][string]$DotnetMSIOutput,
[Parameter(Mandatory=$true)][string]$WixRoot,
[Parameter(Mandatory=$true)][string]$ProductMoniker,
[Parameter(Mandatory=$true)][string]$DotnetMSIVersion,
[Parameter(Mandatory=$true)][string]$SDKBundleVersion,
[Parameter(Mandatory=$true)][string]$DotnetCLINugetVersion,
[Parameter(Mandatory=$true)][string]$UpgradeCode,
[Parameter(Mandatory=$true)][string]$DependencyKeyName,
[Parameter(Mandatory=$true)][string]$Architecture
)
$InstallFileswsx = ".\manifest-install-files.wxs"
$InstallFilesWixobj = "manifest-install-files.wixobj"
function RunHeat
{
$result = $true
pushd "$WixRoot"
Write-Information "Running heat.."
$heatOutput = .\heat.exe dir `"$inputDir`" -template fragment `
-sreg -ag `
-var var.DotnetSrc `
-cg InstallFiles `
-srd `
-dr DOTNETHOME `
-out manifest-install-files.wxs
Write-Information "Heat output: $heatOutput"
if($LastExitCode -ne 0)
{
$result = $false
Write-Information "Heat failed with exit code $LastExitCode."
}
popd
Write-Information "RunHeat result: $result"
return $result
}
function RunCandle
{
$result = $true
pushd "$WixRoot"
Write-Information "Running candle.."
$candleOutput = .\candle.exe -nologo `
-dDotnetSrc="$inputDir" `
-dMicrosoftEula="$PSScriptRoot\dummyeula.rtf" `
-dProductMoniker="$ProductMoniker" `
-dBuildVersion="$DotnetMSIVersion" `
-dSDKBundleVersion="$SDKBundleVersion" `
-dNugetVersion="$DotnetCLINugetVersion" `
-dUpgradeCode="$UpgradeCode" `
-dDependencyKeyName="$DependencyKeyName" `
-arch "$Architecture" `
-ext WixDependencyExtension.dll `
"$PSScriptRoot\manifests.wxs" `
"$PSScriptRoot\provider.wxs" `
$InstallFileswsx
Write-Information "Candle output: $candleOutput"
if($LastExitCode -ne 0)
{
$result = $false
Write-Information "Candle failed with exit code $LastExitCode."
}
popd
return $result
}
function RunLight
{
$result = $true
pushd "$WixRoot"
Write-Information "Running light.."
$CabCache = Join-Path $WixRoot "cabcache"
$lightOutput = .\light.exe -nologo -ext WixUIExtension -ext WixDependencyExtension -ext WixUtilExtension `
-cultures:en-us `
manifests.wixobj `
provider.wixobj `
$InstallFilesWixobj `
-b "$inputDir" `
-b "$PSScriptRoot" `
-reusecab `
-cc "$CabCache" `
-out $DotnetMSIOutput
Write-Information "Light output: $lightOutput"
if($LastExitCode -ne 0)
{
$result = $false
Write-Information "Light failed with exit code $LastExitCode."
}
popd
return $result
}
if(!(Test-Path $inputDir))
{
throw "$inputDir not found"
}
Write-Information "Creating manifests MSI at $DotnetMSIOutput"
if([string]::IsNullOrEmpty($WixRoot))
{
Exit -1
}
if(-Not (RunHeat))
{
Write-Information "Heat failed"
Exit -1
}
if(-Not (RunCandle))
{
Write-Information "Candle failed"
Exit -1
}
if(-Not (RunLight))
{
Write-Information "Light failed"
Exit -1
}
if(!(Test-Path $DotnetMSIOutput))
{
throw "Unable to create the manifests MSI."
Exit -1
}
Write-Information "Successfully created manifests MSI - $DotnetMSIOutput"
exit $LastExitCode

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include "Variables.wxi" ?>
<Product Id="*" Name="$(var.ProductName)" Language="$(var.ProductLanguage)" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package Compressed="yes" InstallScope="perMachine" InstallerVersion="$(var.InstallerVersion)" />
<Condition Message="$(var.ProductName) must be installed as part of a coordinated SDK installation.">
Installed OR ALLOWMSIINSTALL
</Condition>
<MajorUpgrade DowngradeErrorMessage="$(var.DowngradeErrorMessage)" Schedule="afterInstallInitialize"/>
<MediaTemplate CompressionLevel="high" EmbedCab="yes" />
<Feature Id="MainFeature" Title="Main Feature" Level="1">
<ComponentGroupRef Id="InstallFiles" />
</Feature>
<Feature Id="Provider" Absent="disallow" AllowAdvertise="no" Description="Used for Ref Counting" Display="hidden" Level="1" InstallDefault="local" Title="RefCounting" TypicalDefault="install">
<ComponentRef Id="$(var.DependencyKeyId)" />
</Feature>
<Property Id="ProductFamily" Value="$(var.ProductFamily)" />
<Property Id="ProductEdition" Value="$(var.ProductEdition)" />
<Property Id="ProductCPU" Value="$(var.Platform)" />
<Property Id="RTM_ProductVersion" Value="$(var.Dotnet_ProductVersion)" />
<Property Id="MSIFASTINSTALL" Value="7" />
<Property Id="NUGETVERSION" Value="$(var.NugetVersion)" />
<WixVariable Id="WixUILicenseRtf" Value="$(var.MicrosoftEula)" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.Program_Files)">
<Directory Id="DOTNETHOME" Name="dotnet"/>
</Directory>
</Directory>
</Fragment>
</Wix>