Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[release/3.1] Include .NET Core Runtime in WindowsDesktop bundle #8508

Merged
merged 1 commit into from Oct 15, 2019

Conversation

dagood
Copy link
Member

@dagood dagood commented Oct 9, 2019

Description

https://github.com/dotnet/core-setup/issues/8504: Includes the .NET Core Runtime MSIs inside the .NET Core Desktop Bundle (WindowsDesktop).

Customer Impact

The current state of 3.0+ is that you need to install both the .NET Core Runtime Bundle and the .NET Core Desktop Bundle in order to run a WinForms or WPF FDE/FDD app. This causes a lot of confusion, because:

  1. It seems normal to assume that the Desktop Bundle will give you all you need to run .NET Core Desktop apps, but it doesn't.
  2. There is text on the dot.net site that tells you you also need to install .NET Core Runtime, but it is very easy to miss. https://github.com/dotnet/core-setup/issues/8368

These are solved by including .NET Core Runtime inside the .NET Core Desktop Bundle. The user still needs to select the correct architecture(s) to install, but this will be mitigated by creating an improved download page specific to the .NET Core Desktop Runtime Bundle. https://github.com/dotnet/core-setup/issues/7763 tracks also combining the architectures.

  1. When you try to launch an FDE WPF/WinForms app without .NET Core Runtime installed, it fails, but doesn't inform the user (only writes to the event log). https://github.com/dotnet/core-setup/issues/8222

This becomes harder to hit because it won't be possible to run the .NET Core Desktop Bundle without also getting the .NET Core Runtime. However, the lack of feedback will still occur if the user tries to launch an FDE app without the prereq runtimes installed, so this is still an important issue.

Regression?

No.

Risk

Low. We have not fully tested and considered the effects of including the .NET Core Runtime with the .NET Core Desktop Bundle, however this is same approach as the SDK Bundle: the general principle is known and has worked for a long time. (Edit: The comments explore some interesting scenarios, and they don't raise any concerns.)

Tested by running dotnet new winforms and dotnet new wpf FDE apps on a VM with only the .NET Core Desktop Bundle installed, and both worked.

/cc @KathleenDollard @rowanmiller @vatsan-madhavan @richlander

@dagood dagood added this to the 3.1 milestone Oct 9, 2019
@dagood dagood self-assigned this Oct 9, 2019
@vatsan-madhavan
Copy link
Member

vatsan-madhavan commented Oct 9, 2019

What happens if the bundled .NET Core runtime is already installed?

  • Does that portion of the setup become a no-op and the WindowsDesktop portion continue as before?
  • Does the bundled .NET Core runtime setup run again, and overwrite or repair the previous installation...
  • Something else?

@vatsan-madhavan
Copy link
Member

What happens if the WindowsDesktop runtime is already installed (say, using the dotnet install script, not the installer), but the bundled .NET Core runtime is not installed yet ?

  • Will the bundled .NET Core runtime get installed, but the WindowsDesktop runtime installer no-op and yield to the previously installed copy of the same version of WindowsDesktop runtime?
  • Will neither .NET Core runtime (bundled) nor the WindowsDesktop runtime be installed (the whole setup will yield to the fact that the exact same version of WindowsDesktop runtime is already installed)
  • Both the bundled .NET Core runtime and the WindowsDesktop runtime will be installed. WindowsDesktop runtime will overwrite the one previously installed by dotnet install script.
  • Something else?

@vatsan-madhavan
Copy link
Member

/cc @rladuca

@rladuca
Copy link
Member

rladuca commented Oct 9, 2019

What are the implications (if any) of this with respect to building WindowsDesktop in the separate repo? Do we not build installers there? Does the runtime installer have to flow to the WindowsDesktop repo in some sort of loop?

@vatsan-madhavan
Copy link
Member

What are the implications (if any) of this with respect to building WindowsDesktop in the separate repo? Do we not build installers there? Does the runtime installer have to flow to the WindowsDesktop repo in some sort of loop?

@dagood, am I correct in thinking that the the same core-setup build used to produce both WindowsDesktop and .NET Core installers previously, and now you are simply chaining two of those build artifacts together ?

@dagood
Copy link
Member Author

dagood commented Oct 9, 2019

What happens if the bundled .NET Core runtime is already installed?

  • Does that portion of the setup become a no-op and the WindowsDesktop portion continue as before?

Yep, the way this works is that each MSI has its own identity and dependencies on each one are ref-counted. The .NET Core Runtime Bundle has one reference to it, and installing the .NET Core Desktop Bundle will add its own reference to those specific component MSIs.

This does have the consequence that if you upgrade WindowsDekstop but not .NET Core Runtime, then you end up with both the old and new one installed SxS. (This is the same as having an old Runtime Bundle present and installing a new SDK Bundle.)

What happens if the WindowsDesktop runtime is already installed (say, using the dotnet install script, not the installer), but the bundled .NET Core runtime is not installed yet ?

The dotnet install script, to my knowledge, always writes to some user-writable dir (a repo, user profile, ...) and never interacts with the global install. I don't think this exact situation can happen. But I think it's similar if someone has, say, 3.1.0-alpha1 installed without this change and upgrades to 3.1.0-preview2 that does have this change.

  • Will the bundled .NET Core runtime get installed, but the WindowsDesktop runtime installer no-op and yield to the previously installed copy of the same version of WindowsDesktop runtime?

Yes, ref counting should sort this out fine in general.

@dagood, am I correct in thinking that the the same core-setup build used to produce both WindowsDesktop and .NET Core installers previously, and now you are simply chaining two of those build artifacts together ?

That's right, I need to file an issue to reimplement this for 5.0+ where WindowsDesktop is split out. (EDIT: Oh, right, already did this: dotnet/windowsdesktop#20. 😄)

Does the runtime installer have to flow to the WindowsDesktop repo in some sort of loop?

There must be a flow from Core-Setup => WindowsDesktop, but this shouldn't cause a loop. This dependency is already required for other reasons anyway, like making sure the reference closure is valid.

@dagood
Copy link
Member Author

dagood commented Oct 9, 2019

[...] if someone has, say, 3.1.0-alpha1 installed without this change and upgrades to 3.1.0-preview2 that does have this change.

This is the situation we'll be in if we port this to release/3.0, (3.0.0 doesn't have this change, 3.0.1 would) (edit: or if we have it in 3.1.0-p2 but not p1) so I tested it.

  1. I built a bundle without this PR and another with it.
  2. When I install the first one, I only have on disk the WindowsDesktop runtime.
  3. When I then upgrade to the newer bundle, it installs the new version of both the .NET Core Runtime and WindowsDesktop, and uninstalls the old WindowsDesktop. (Per ref counts.)
    • We never ship multiple MSIs that contain the same runtime, which keeps ref counting reliable. On top of that, we always produce a new version of the runtimes in new builds, so I don't expect edge cases like mismatching runtime versions in a bundle anyway.

Copy link
Member

@leecow leecow left a comment

Choose a reason for hiding this comment

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

LGTM and sent to Tactic

@leecow
Copy link
Member

leecow commented Oct 15, 2019

Tactics approved

@dagood dagood merged commit e48a918 into dotnet:release/3.1 Oct 15, 2019
@dagood dagood deleted the wd-include-nca-3.1 branch October 15, 2019 17:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants