stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.59k stars 951 forks source link

Stride Launcher Directs Users to Runtime Install When SDK is Missing #1753

Open MeharDT opened 1 year ago

MeharDT commented 1 year ago

Release Type: Official Release

Version: Stride Launcher 5.0.6 Stride 4.1.0.1838

Describe the bug In a development environment without the .NET 6.0 SDK installed, the user is prompted to install the SDK when launching Stride 4.1.x. The prompt will direct them to the download page for the .NET 6.0 Desktop Runtime and not the SDK.

Subsequent launches will no longer warn that the SDK isn't installed, the user will only be notified when attempt to build their project.

To Reproduce Steps to reproduce the behavior:

  1. Launch Stride Launcher 5.0.6 on a PC without the .NET 6.0 SDK installed
  2. When the Launcher prompts about a required .NET install or update, press "Yes"
  3. Your default browser should launch and direct you to the download page for the Runtime

Expected behavior The Launcher prompt should direct users to the latest version of the .NET 6.0 SDK

NicusorN5 commented 1 year ago

I tried to reproduce this issue, but Stride opened a link to download the SDK. image The opened URL was https://dotnet.microsoft.com/en-us/download from clicking the .NET 6 SDK label.

I don't see the problem here.

MeharDT commented 1 year ago

Hmm, that's a different error.

stride_error

Clicking Yes will take you here,

https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-6.0.22-windows-x64-installer?cid=getdotnetcore

If you install the .NET 6.0 SDK separately, the above prompt no longer appears in subsequent launches.

NicusorN5 commented 1 year ago

This error is hardcoded into NET 6 applications. I've seen this exact same error in other NET 6 applications.

Doprez commented 1 year ago

ahhh I dont think that's managed by Stride I think thats just the default runtime exception for .NET apps, in this case the GameStudio app.

MeharDT commented 1 year ago

Ah, interesting! Is there any reason why @NicusorN5 and I would receive different warnings for not having .NET 6 installed?

Doprez commented 1 year ago

There may be a silly overlooked component in the engine lol https://github.com/stride3d/stride/blob/896eedbb55d0cb0a4251e5bdf3d4edba83983568/sources/editor/Stride.GameStudio/Program.cs#L234 this code is what looks for the installed SDK but its run within the .NET app so I wonder if this needs to be rethought?

NicusorN5 commented 1 year ago

Is there any reason why @NicusorN5 and I would receive different warnings for not having .NET 6 installed?

Because you need both the runtime and SDK to use Stride. Applications made with .NET 6 only require the runtime, hence the error message.

In my case, I uninstalled the SDK, and not the runtime.


@Doprez Stride requires both .NET 6 SDK and MSBuild.

MeharDT commented 1 year ago

Is there any reason why @NicusorN5 and I would receive different warnings for not having .NET 6 installed?

Because you need both the runtime and SDK to use Stride. Applications made with .NET 6 only require the runtime, hence the error message.

That hasn't been the case in my tests so far (Launcher -> Stride 4.1 -> New Blank Project), I think a rare bug or misconfiguration might be slipping through the cracks here. A quick summary of my tests,

Of course when only the Runtime is installed, projects will fail to generate or build. I haven't noticed any issues when only the SDK is installed. In my main development environment I've only ever had the SDK installed.

Doprez commented 1 year ago

I think the mistake is checking with Gamestudio code itself. It should be moved to the Installer from what I can tell.

This wont solve the issue for people manually downloading stride but I honestly dont think thats an issue for any average user since no one seems to do that.

MeharDT commented 1 year ago

I think @Doprez might have figured it out. My current dev environment only has the .NET 5 SDK installed, I'm guessing that's enough for Startup() to run in Program.cs but not enough for the MSBuild exception to trigger. If I remove both the .NET 5 and 6 SDKs, I get the MSBuild exception.

I imagine this will be a bigger problem with .NET 8 in Stride 4.2 due to the greater likelyhood of .NET 6 or 7 SDKs being present.