diff --git a/source/Reloaded.Mod.Launcher.Lib/Static/Resources.cs b/source/Reloaded.Mod.Launcher.Lib/Static/Resources.cs index 9bf81232..fb849863 100644 --- a/source/Reloaded.Mod.Launcher.Lib/Static/Resources.cs +++ b/source/Reloaded.Mod.Launcher.Lib/Static/Resources.cs @@ -212,4 +212,6 @@ public static void Init(IDictionaryResourceProvider provider) // Update 1.28.6: Problematic Path Warnings public static IDictionaryResource ProblematicPathTitle { get; set; } public static IDictionaryResource ProblematicPathAppDescription { get; set; } + public static IDictionaryResource ProblematicPathReloadedDescription { get; set; } + public static IDictionaryResource ProblematicPathModsDescription { get; set; } } \ No newline at end of file diff --git a/source/Reloaded.Mod.Launcher/App.xaml.cs b/source/Reloaded.Mod.Launcher/App.xaml.cs index c7062ed5..3478489d 100644 --- a/source/Reloaded.Mod.Launcher/App.xaml.cs +++ b/source/Reloaded.Mod.Launcher/App.xaml.cs @@ -39,13 +39,43 @@ private void OnStartup(object sender, StartupEventArgs e) StartProfileOptimization(); PrepareWebRequests(); + // Need to construct MainWindow before invoking any dialog, otherwise Shutdown will be called on closing the dialog var window = new MainWindow(); + + // Warn if OneDrive or NonAsciiChars detected in Reloaded-II directory + bool reloadedPathHasNonAsciiChars = AppContext.BaseDirectory.Any(c => c > 127); + if (AppContext.BaseDirectory.Contains("OneDrive") || reloadedPathHasNonAsciiChars) + { + Actions.DisplayMessagebox.Invoke(Lib.Static.Resources.ProblematicPathTitle.Get(), Lib.Static.Resources.ProblematicPathReloadedDescription.Get(), new Actions.DisplayMessageBoxParams() + { + StartupLocation = Actions.WindowStartupLocation.CenterScreen, + Type = Actions.MessageBoxType.Ok + }); + } + else // We only do this check if the Reloaded-II directory check passed + { + // Warn if OneDrive or NonAsciiChars detected in Mods directory + var modsDirectory = Lib.IoC.Get().GetModConfigDirectory(); + if (modsDirectory != null) + { + bool modsDirectoryPathHasNonAsciiChars = modsDirectory.Any(c => c > 127); + if (modsDirectory.Contains("OneDrive") || modsDirectoryPathHasNonAsciiChars) + { + Actions.DisplayMessagebox.Invoke(Lib.Static.Resources.ProblematicPathTitle.Get(), Lib.Static.Resources.ProblematicPathModsDescription.Get(), new Actions.DisplayMessageBoxParams() + { + StartupLocation = Actions.WindowStartupLocation.CenterScreen, + Type = Actions.MessageBoxType.Ok + }); + } + } + } + window.ShowDialog(); } private void SetupResources() { - var launcherFolder= AppContext.BaseDirectory; + var launcherFolder = AppContext.BaseDirectory; var languageSelector = new XamlFileSelector($"{launcherFolder}\\Assets\\Languages"); var themeSelector = new XamlFileSelector($"{launcherFolder}\\Theme"); diff --git a/source/Reloaded.Mod.Launcher/Assets/Languages/en-GB.xaml b/source/Reloaded.Mod.Launcher/Assets/Languages/en-GB.xaml index 9ce97518..d2dc9542 100644 --- a/source/Reloaded.Mod.Launcher/Assets/Languages/en-GB.xaml +++ b/source/Reloaded.Mod.Launcher/Assets/Languages/en-GB.xaml @@ -723,5 +723,7 @@ For more info, refer to the tutorial. Don't forget to set correct Publish target Potentially Problematic Path Detected The application you selected is in a folder that is managed by OneDrive or contains non-ASCII (special) characters. It is recommended to move the application to a different path, such as "C:\Games\". Using the application in an unsupported path may result in mods not working. Press OK to add the application anyway. + Reloaded-II has detected it is installed in a folder that is managed by OneDrive or contains non-ASCII (special) characters. It is recommended to move your Reloaded-II folder to a different path, such as "C:\Reloaded-II\". Keeping Reloaded-II in an unsupported path may result in mods not working. + Reloaded-II has detected your mods folder is managed by OneDrive or contains non-ASCII (special) characters. It is recommended to move your mods folder to a different path. Keeping mods in an unsupported path may result in problems running mods. \ No newline at end of file