Skip to content

[One .NET] temporary Windows & macOS installers for .NET 6 #5225

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

Merged
merged 2 commits into from
Oct 27, 2020

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Oct 19, 2020

For .NET 6 Preview 1, we will need to provide our own installers for
the Android workload. This will also unblock the Xamarin.Forms / MAUI
team as they build on top of the iOS and Android workloads for .NET 6.

We will eventually do some kind of "insertion" process to provide our
.nupkg files to the dotnet/installer repo, so these installers will
go away completely at some point.

For now, this creates two new installers:

  • Microsoft.Android.Workload.msi - installs to C:\Program Files\dotnet\
  • Microsoft.Android.Workload.pkg - installs to /usr/local/share/dotnet/

Both installers have the following file structure underneath the root
directory:

  • sdk\5.0.100-rtm.20509.5\EnableWorkloadResolver.sentinel
  • sdk-manifests\5.0.100\Microsoft.Android.Workload**
  • packs\Microsoft.Android.Ref**
  • packs\Microsoft.Android.Sdk**

The installers will have a hard dependency on .NET
5.0.100-rtm.20509.5, so we will need to have clear instructions for
installing the correct version of .NET for the Android workload.

The Windows installer is made using WIX, to mirror what
dotnet/installer is using:

The .msi will need to be built on Windows and the .pkg will need
to be built on macOS. create-dotnet-msi.csproj will download the WIX
toolset to ~\android-toolchain\wix and call candle.exe and
light.exe appropriately. create-dotnet-pkg.csproj is based on
create-pkg.csproj, and no additional tooling is needed.

Changes to CI:

  • The create-installers make target now creates the .NET 6 .pkg
    installer. The mac_build stage creates one additional installer.
  • Any subsequent stages that download the installers artifact, now
    use a wildcard for the installer they need. This will improve some
    of the test stages that were downloading both the .vsix and .pkg
    installers before.
  • A .NET 6 Preview Installers Github status will appear that
    contains public download links for the new installers.
  • A Build Results - .NET 6 Preview Installers artifact will contain
    additional build logs.

@jonathanpeppers jonathanpeppers force-pushed the dotnet-workload-installers branch 9 times, most recently from 27de15b to 3c5705d Compare October 21, 2020 20:04
@jonathanpeppers jonathanpeppers changed the title [WIP] .NET 6 Preview Installers [One .NET] temporary Windows & macOS installers for .NET 6 Oct 21, 2020
@jonathanpeppers jonathanpeppers force-pushed the dotnet-workload-installers branch 5 times, most recently from bd4bf60 to 5d50755 Compare October 23, 2020 03:31
@jonathanpeppers jonathanpeppers force-pushed the dotnet-workload-installers branch 3 times, most recently from 8dc9a8b to ce824db Compare October 23, 2020 16:23
@jonathanpeppers jonathanpeppers marked this pull request as ready for review October 23, 2020 18:12
@jonpryor
Copy link
Contributor

The create-installers make target now creates the .NET 6 .pkg
installer. The mac_build stage creates one additional installer.

Why? Why not "extend" create-installers to make all the installers: Windows .vsix, "classic" macOS .pkg, and .NET 6 .pkg?

@jonathanpeppers
Copy link
Member Author

Why? Why not "extend" create-installers to make all the installers: Windows .vsix, "classic" macOS .pkg, and .NET 6 .pkg?

Yes, it builds all three now. We can only build the .msi on Windows, though. We are also using some .yaml templates that are Windows only to upload to Azure storage for public download URLs.

Language="1033"
Version="@MSIVERSION@"
Manufacturer="Microsoft"
UpgradeCode="86a83cc9-6b75-489f-be10-27988df907c6">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where'd this value come from, if anywhere? What's it used for?

We might need links to relevant WiX docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a Guid that is a unique identifier for the MSI, best docs I can find:

https://docs.microsoft.com/windows/win32/msi/upgradecode

I created this file originally from a File -> New WIX Setup Project in Visual Studio, and it generates a Guid for you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add an XML comment to the .wix.in file mentioning this, or leave it in the commit message?

<!--
    DO NOT CHANGE UpgradeCode; see https://docs.microsoft.com/windows/win32/msi/upgradecode
  -->
<Product Name=…

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the commit message is fine, I doubt we will change .wix.in much once it is working?

Manufacturer="Microsoft"
UpgradeCode="86a83cc9-6b75-489f-be10-27988df907c6">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ProductName]? Is that replaced by WiX?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ProductName] should get replaced by the Name we have here:

<Product Name="Microsoft.NET.Workload.Android"

This message came from the File -> New template. I'm not sure how to get it to display this error message, though.

On reinstall I get this popup:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathanpeppers Right now you're using AndroidMSIVersion for the MSI version but this will be problematic for MSI upgrades the way you have it right now since Windows installer only takes the first three parts of a version number into account (https://docs.microsoft.com/en-us/windows/win32/msi/upgrade-table):

Note that Windows Installer uses only the first three fields of the product version. If you include a fourth field in your product version, the installer ignores the fourth field.

If you want to support upgrading to an .msi where only the fourth field changed then you need to set AllowSameVersionUpgrades="yes" on the <MajorUpgrade> node in the Wix source: https://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And to answer the initial question, yes this placeholder gets replaced by the MSI product name and shows in an error message when you try to downgrade from a later version to an earlier version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akoeplinger adding AllowSameVersionUpgrades="yes" causes a warning during the build now:

warning LGHT1076: ICE61: This product should remove only older versions of itself. The Maximum version is not less than the current product. (11.0.100.205 11.0.100.205)

Is there some other "maximum version" I should also set?

It's kind of hard to find info on WIX, but some are saying you will always get this warning?

https://stackoverflow.com/questions/37941133/ice61-this-product-should-remove-only-older-versions-of-itself

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After more reading, I think AllowSameVersionUpgrades="yes" and suppressing the ICE61 warning is the way to go.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathanpeppers jonathanpeppers force-pushed the dotnet-workload-installers branch from 3d4a0ed to 3c75253 Compare October 23, 2020 19:56
@jonathanpeppers jonathanpeppers force-pushed the dotnet-workload-installers branch 4 times, most recently from c2c76cb to 43eef00 Compare October 26, 2020 13:50
Depends on: dotnet#5195

For .NET 6 Preview 1, we will need to provide our own installers for
the Android workload. This will also unblock the Xamarin.Forms / MAUI
team as they build on top of the iOS and Android workloads for .NET 6.

We will eventually do some kind of "insertion" process to provide our
`.nupkg` files to the dotnet/installer repo, so these installers will
go away completely at some point.

For now, this creates two new installers:

* Microsoft.Android.Workload.msi - installs to `C:\Program Files\dotnet\`
* Microsoft.Android.Workload.pkg - installs to `/usr/local/share/dotnet/`

Both installers have the following file structure underneath the root
directory:

* sdk\5.0.100-rtm.20509.5\EnableWorkloadResolver.sentinel
* sdk-manifests\5.0.100\Microsoft.Android.Workload\**
* packs\Microsoft.Android.Ref\**
* packs\Microsoft.Android.Sdk\**

The installers will have a hard dependency on .NET
5.0.100-rtm.20509.5, so we will need to have clear instructions for
installing the correct version of .NET for the Android workload.

The Windows installer is made using WIX, to mirror what
dotnet/installer is using:

* https://wixtoolset.org/
* https://github.com/dotnet/installer/blob/861a1dd12cb80bd834d0e51442d46ee7d1a4023f/src/redist/targets/GenerateMSIs.targets

The `.msi` will need to be built on Windows and the `.pkg` will need
to be built on macOS. `create-dotnet-msi.csproj` will download the WIX
toolset to `~\android-toolchain\wix` and call `candle.exe` and
`light.exe` appropriately. `create-dotnet-pkg.csproj` is based on
`create-pkg.csproj`, and no additional tooling is needed.

Changes to CI:

* The `create-installers` make target now creates the .NET 6 `.pkg`
  installer. The `mac_build` stage creates one additional installer.
* Any subsequent stages that download the `installers` artifact, now
  use a wildcard for the installer they need. This will improve some
  of the test stages that were downloading both the `.vsix` and `.pkg`
  installers before.
* A `.NET 6 Preview Installers` Github status will appear that
  contains public download links for the new installers.
* A `Build Results - .NET 6 Preview Installers` artifact will contain
  additional build logs.
@jonathanpeppers jonathanpeppers force-pushed the dotnet-workload-installers branch from 43eef00 to efe88a5 Compare October 26, 2020 13:54
@@ -103,8 +103,8 @@ stages:
displayName: make jenkins

- script: >
echo "make create-installers V=1 CONFIGURATION=$(XA.Build.Configuration)" &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to continue calling make create-installers, so that the new make create-workload-installers target is executed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…or do we not want to create a Workload installer for the OSS pipeline?

Copy link
Member Author

@jonathanpeppers jonathanpeppers Oct 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would have to add commands to create the .nupkg files for create-installers to work on the OSS pipeline. I would also have to make a Windows stage to create the .msi.

I thought it was simpler to not create these installers on the OSS pipeline for now. But if we have a need, we could?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also have to make a Windows stage to create the .msi.

We don't have a Windows stage OSS build (but perhaps we should?), so I don't think this would be needed.

I'm largely "just pondering" the community engagement angle. Is there a reason to not provide "OSS-blessed" packages, and/or ensure that the OSS tree can produce the .nupkg files?

That said, it might very well fail now, as the .nupkg files likely pulls in proprietary files, so this should be done as a separate PR, if ever.

@jonpryor jonpryor merged commit 68be8d8 into dotnet:master Oct 27, 2020
@jonathanpeppers jonathanpeppers deleted the dotnet-workload-installers branch October 27, 2020 16:31
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants