Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workload pack tasks #7614

Merged
merged 7 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
{
"version": "6.0.0-preview.7.21358.4",
"depends-on": {
"Microsoft.NET.Workload.Emscripten": "6.0.0-preview.7.21330.1"
},
"workloads": {
"microsoft-net-sdk-blazorwebassembly-aot": {
"description": "Browser Runtime native performance tools",
"packs": [
"Microsoft.NET.Runtime.WebAssembly.Sdk",
"Microsoft.NETCore.App.Runtime.Mono.browser-wasm",
"Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm",
"Microsoft.NET.Runtime.Emscripten.Node",
"Microsoft.NET.Runtime.Emscripten.Python",
"Microsoft.NET.Runtime.Emscripten.Sdk"
],
"extends": [ "microsoft-net-runtime-mono-tooling", "microsoft-net-sdk-emscripten" ],
"platforms": [ "win-x64", "linux-x64", "osx-x64", "osx-arm64" ]
},
"microsoft-net-runtime-android": {
"abstract": true,
"description": "Android Mono Runtime",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.android-arm",
"Microsoft.NETCore.App.Runtime.Mono.android-arm64",
"Microsoft.NETCore.App.Runtime.Mono.android-x64",
"Microsoft.NETCore.App.Runtime.Mono.android-x86"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "win-x64", "linux-x64", "osx-x64", "osx-arm64" ]
},
"microsoft-net-runtime-android-aot": {
"abstract": true,
"description": "Android Mono AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-x86",
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-x64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm",
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm64"
],
"extends": [ "microsoft-net-runtime-android" ],
"platforms": [ "win-x64", "linux-x64", "osx-x64", "osx-arm64" ]
},
"microsoft-net-runtime-ios": {
"abstract": true,
"description": "iOS Mono Runtime and AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.ios-arm",
"Microsoft.NETCore.App.Runtime.Mono.ios-arm64",
"Microsoft.NETCore.App.Runtime.Mono.iossimulator",
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86",
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm",
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator",
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x86"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "osx-arm64", "osx-x64" ]
},
"microsoft-net-runtime-maccatalyst": {
"abstract": true,
"description": "MacCatalyst Mono Runtime and AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst",
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "osx-arm64", "osx-x64" ]
},
"microsoft-net-runtime-tvos": {
"abstract": true,
"description": "tvOS Mono Runtime and AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.tvos-arm64",
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator",
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvos-arm64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "osx-arm64", "osx-x64" ]
},
"microsoft-net-runtime-mono-tooling": {
"abstract": true,
"description": "Shared native build tooling for Mono runtime",
"packs": [
"Microsoft.NET.Runtime.MonoAOTCompiler.Task",
"Microsoft.NET.Runtime.MonoTargets.Sdk",
],
}
},
"packs": {
"Microsoft.NET.Runtime.MonoAOTCompiler.Task": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NET.Runtime.MonoTargets.Sdk": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NET.Runtime.WebAssembly.Sdk": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.android-arm": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.android-arm64": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.android-x64": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.android-x86": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-x86": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-x86",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x86",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-x86",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-x86"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-x64": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-x64",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-x64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-arm",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-arm"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm64": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm64",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-arm64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-arm64"
}
},
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.maccatalyst-x64"
}
},
"Microsoft.NETCore.App.Runtime.Mono.ios-arm" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.ios-arm64" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.iossimulator" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.Mono.iossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.iossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvos-arm64": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvos-arm64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvos-arm64",
}
},
"Microsoft.NETCore.App.Runtime.Mono.tvos-arm64" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.Mono.tvossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.tvossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm",
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64",
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x86": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-x86"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.browser-wasm",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.browser-wasm",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.browser-wasm"
}
},
"Microsoft.NETCore.App.Runtime.Mono.browser-wasm" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public override bool Execute()
MsiProperties msiProps = new MsiProperties
{
InstallSize = MsiUtils.GetInstallSize(msiPath),
Language = Convert.ToInt32(MsiUtils.GetProperty(msiPath, "ProductLanguage")),
Payload = Path.GetFileName(msiPath),
ProductCode = MsiUtils.GetProperty(msiPath, "ProductCode"),
ProductVersion = MsiUtils.GetProperty(msiPath, "ProductVersion"),
Expand Down Expand Up @@ -326,7 +327,6 @@ private string GeneratePackageProject(string msiPath, string msiJsonPath, string
writer.WriteStartElement("ItemGroup");
WriteItem(writer, "None", msiPath, @"\data");
WriteItem(writer, "None", msiJsonPath, @"\data\msi.json");
WriteItem(writer, "None", iconFileName, string.Empty);
WriteItem(writer, "None", licenseFileName, @"\");
writer.WriteEndElement();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ protected IEnumerable<ITaskItem> Generate(string sourcePackage, string swixPacka
MsiProperties msiProps = new MsiProperties
{
InstallSize = MsiUtils.GetInstallSize(msiPath),
Language = Convert.ToInt32(MsiUtils.GetProperty(msiPath, "ProductLanguage")),
Payload = Path.GetFileName(msiPath),
ProductCode = MsiUtils.GetProperty(msiPath, "ProductCode"),
ProductVersion = MsiUtils.GetProperty(msiPath, "ProductVersion"),
Expand Down Expand Up @@ -352,7 +353,6 @@ private string GeneratePackageProject(string msiPath, string msiJsonPath, string
writer.WriteStartElement("ItemGroup");
WriteItem(writer, "None", msiPath, @"\data");
WriteItem(writer, "None", msiJsonPath, @"\data\msi.json");
WriteItem(writer, "None", iconFileName, string.Empty);
joeloff marked this conversation as resolved.
Show resolved Hide resolved
WriteItem(writer, "None", licenseFileName, @"\");
writer.WriteEndElement();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public long InstallSize
set;
}

public int Language
{
get;
set;
}

public string Payload
{
get;
Expand Down Expand Up @@ -45,6 +51,6 @@ public string UpgradeCode
{
get;
set;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include Variables.wxi?>
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)"
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="$(var.ProductLanguage)" Version="$(var.ProductVersion)"
Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">

<Package InstallerVersion="$(var.InstallerVersion)" Compressed="yes" InstallScope="perMachine" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include Variables.wxi?>
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)"
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="$(var.ProductLanguage)" Version="$(var.ProductVersion)"
Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">

<Package InstallerVersion="$(var.InstallerVersion)" Compressed="yes" InstallScope="perMachine" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<RegistryValue Name="ProductCode" Type="string" Value="$(var.ProductCode)"/>
<RegistryValue Name="UpgradeCode" Type="string" Value="$(var.UpgradeCode)"/>
<RegistryValue Name="ProductVersion" Type="string" Value="$(var.ProductVersion)" />
<RegistryValue Name="ProductLanguage" Type="integer" Value="$(var.ProductLanguage)" />
</RegistryKey>
</Component>
</Feature>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<?error Unknown platform: $(var.Platform)?>
<?endif?>

<?ifndef ProductLanguage?>
<?define ProductLanguage=1033?>
<?endif?>

<!-- Default dependency provider key for packs. -->
<?ifndef DependencyProviderKeyName?>
<?define DependencyProviderKeyName=$(var.PackageId),$(var.PackageVersion),$(var.Platform)?>
Expand Down
8 changes: 7 additions & 1 deletion src/Microsoft.DotNet.Build.Tasks.Workloads/src/MsiUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ public static IEnumerable<FileRow> GetAllFiles(string packagePath)
return files;
}

/// <summary>
/// Extracts the specified property from the MSI's Property table.
/// </summary>
/// <param name="packagePath">The path to the MSI package.</param>
/// <param name="property">The name of the property to extract.</param>
/// <returns>The value of the property.</returns>
public static string GetProperty(string packagePath, string property)
{
using InstallPackage ip = new(packagePath, DatabaseOpenMode.ReadOnly);
return ip.Property[property];

}

/// <summary>
/// Calculate the number of bytes a Windows Installer Package would consume on disk. The function assumes that all files will be installed.
/// </summary>
Expand Down
Loading