From 1213ecce62de9cc46171bb6be0f939a33d908589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Wed, 11 Sep 2024 23:44:04 -0400 Subject: [PATCH] chore: Adjust preview --- src/Uno.UI.Runtime.Skia.Wpf/Builder/WpfHostBuilder.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Uno.UI.Runtime.Skia.Wpf/Builder/WpfHostBuilder.cs b/src/Uno.UI.Runtime.Skia.Wpf/Builder/WpfHostBuilder.cs index eabca85208..879106050d 100644 --- a/src/Uno.UI.Runtime.Skia.Wpf/Builder/WpfHostBuilder.cs +++ b/src/Uno.UI.Runtime.Skia.Wpf/Builder/WpfHostBuilder.cs @@ -34,8 +34,13 @@ internal class WpfHostBuilder : IPlatformHostBuilder, IWindowsSkiaHostBuilder // ASP.NET Core Runtime 9.0.0-preview.4.24267.6 //.NET Desktop Runtime 9.0.0-preview.4.24267.11 // This is a quite hacky to get to the right path where we don't exactly know the version beforehand. - var indexOfPreview = runtimeVersion.IndexOf("-preview", StringComparison.Ordinal) - || runtimeVersion.IndexOf("-rc", StringComparison.Ordinal); + var indexOfPreview = runtimeVersion.IndexOf("-preview", StringComparison.Ordinal); + + if(indexOfPreview == -1) + { + indexOfPreview = runtimeVersion.IndexOf("-rc", StringComparison.Ordinal); + } + if (indexOfPreview > -1) { var mainVersion = runtimeVersion.Substring(0, indexOfPreview); @@ -45,7 +50,7 @@ internal class WpfHostBuilder : IPlatformHostBuilder, IWindowsSkiaHostBuilder var possibleVersion = Path.GetFileName(directory); var possibleIndexOfPreview = possibleVersion?.IndexOf("-preview", StringComparison.Ordinal) ?? -1; - if(possibleIndexOfPreview > -1) + if(possibleIndexOfPreview == -1) { possibleIndexOfPreview = possibleVersion?.IndexOf("-rc", StringComparison.Ordinal) ?? -1; }