Make config filename changable for releases & Log to Ryujinx directory if application directory is not writable (#4707)
* Remove GetBaseApplicationDirectory() & Move logs directory to user base path We should assume the application directory might be write-protected. * Use Ryujinx.sh in Ryujinx.desktop This desktop file isn't really used right now, so this changes effectively nothing. * Use properties in ReleaseInformation.cs and add ConfigName property * Configure config filename in Github workflows * Add a separate config step for macOS Because they use BSD sed instead of GNU sed * Keep log directory at the old location for dev environments * Add FileSystemUtils since Directory.Move() doesn't work across filesystems Steal CopyDirectory code from https://learn.microsoft.com/en-us/dotnet/standard/io/how-to-copy-directories * Fix "Open Logs folder" button pointing to the wrong directory * Add execute permissions to Ryujinx.sh * Fix missing newlines * AppDataManager: Use FileSystemUtils.MoveDirectory() * Make dotnet format happy * Add a fallback for the logging directory
This commit is contained in:
parent
7795b662a9
commit
70fcba39de
22 changed files with 209 additions and 117 deletions
|
@ -1,6 +1,7 @@
|
|||
using Gdk;
|
||||
using Gtk;
|
||||
using Ryujinx.Common;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Ui;
|
||||
using Ryujinx.Ui.Common.Configuration;
|
||||
using Ryujinx.Ui.Common.Helper;
|
||||
|
@ -52,7 +53,7 @@ namespace Ryujinx.Modules
|
|||
ProcessStartInfo processStart = new(ryuName)
|
||||
{
|
||||
UseShellExecute = true,
|
||||
WorkingDirectory = ReleaseInformation.GetBaseApplicationDirectory(),
|
||||
WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory
|
||||
};
|
||||
|
||||
foreach (string argument in CommandLineState.Arguments)
|
||||
|
|
|
@ -532,7 +532,7 @@ namespace Ryujinx.Modules
|
|||
return false;
|
||||
}
|
||||
|
||||
if (Program.Version.Contains("dirty") || !ReleaseInformation.IsValid())
|
||||
if (Program.Version.Contains("dirty") || !ReleaseInformation.IsValid)
|
||||
{
|
||||
if (showWarnings)
|
||||
{
|
||||
|
@ -546,7 +546,7 @@ namespace Ryujinx.Modules
|
|||
#else
|
||||
if (showWarnings)
|
||||
{
|
||||
if (ReleaseInformation.IsFlatHubBuild())
|
||||
if (ReleaseInformation.IsFlatHubBuild)
|
||||
{
|
||||
GtkDialog.CreateWarningDialog("Updater Disabled!", "Please update Ryujinx via FlatHub.");
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace Ryujinx
|
|||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Version = ReleaseInformation.GetVersion();
|
||||
Version = ReleaseInformation.Version;
|
||||
|
||||
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134))
|
||||
{
|
||||
|
@ -167,8 +167,8 @@ namespace Ryujinx
|
|||
Quality = 100,
|
||||
});
|
||||
|
||||
string localConfigurationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json");
|
||||
string appDataConfigurationPath = Path.Combine(AppDataManager.BaseDirPath, "Config.json");
|
||||
string localConfigurationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ReleaseInformation.ConfigName);
|
||||
string appDataConfigurationPath = Path.Combine(AppDataManager.BaseDirPath, ReleaseInformation.ConfigName);
|
||||
|
||||
// Now load the configuration as the other subsystems are now registered
|
||||
ConfigurationPath = File.Exists(localConfigurationPath)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Gtk;
|
||||
using Ryujinx.Common;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Ui.Common.Configuration;
|
||||
using System.IO;
|
||||
|
@ -24,7 +25,7 @@ namespace Ryujinx.Ui.Helper
|
|||
}
|
||||
else
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.Application, $"The \"custom_theme_path\" section in \"Config.json\" contains an invalid path: \"{ConfigurationState.Instance.Ui.CustomThemePath}\".");
|
||||
Logger.Warning?.Print(LogClass.Application, $"The \"custom_theme_path\" section in \"{ReleaseInformation.ConfigName}\" contains an invalid path: \"{ConfigurationState.Instance.Ui.CustomThemePath}\".");
|
||||
|
||||
ConfigurationState.Instance.Ui.CustomThemePath.Value = "";
|
||||
ConfigurationState.Instance.Ui.EnableCustomTheme.Value = false;
|
||||
|
|
|
@ -1376,7 +1376,12 @@ namespace Ryujinx.Ui
|
|||
|
||||
private void OpenLogsFolder_Pressed(object sender, EventArgs args)
|
||||
{
|
||||
string logPath = System.IO.Path.Combine(ReleaseInformation.GetBaseApplicationDirectory(), "Logs");
|
||||
string logPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");
|
||||
|
||||
if (ReleaseInformation.IsValid)
|
||||
{
|
||||
logPath = System.IO.Path.Combine(AppDataManager.BaseDirPath, "Logs");
|
||||
}
|
||||
|
||||
new DirectoryInfo(logPath).Create();
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace Ryujinx.Ui.Widgets
|
|||
_extractExeFsMenuItem.Sensitive = hasNca;
|
||||
_extractLogoMenuItem.Sensitive = hasNca;
|
||||
|
||||
_createShortcutMenuItem.Sensitive = !ReleaseInformation.IsFlatHubBuild();
|
||||
_createShortcutMenuItem.Sensitive = !ReleaseInformation.IsFlatHubBuild;
|
||||
|
||||
PopupAtPointer(null);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue