Skip to content

Commit

Permalink
Fix homebrew loading. Fixes #109, #107
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Nov 1, 2024
1 parent bdb9222 commit d7e17ab
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/Ryujinx.UI.Common/Helper/SetupValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,11 @@ public static class SetupValidator
{
public static bool IsFirmwareValid(ContentManager contentManager, out UserError error)
{
bool hasFirmware = contentManager.GetCurrentFirmwareVersion() != null;
error = contentManager.GetCurrentFirmwareVersion() != null
? UserError.Success
: UserError.NoFirmware;

if (hasFirmware)
{
error = UserError.Success;

return true;
}

error = UserError.NoFirmware;

return false;
return error is UserError.Success;
}

public static bool CanFixStartApplication(ContentManager contentManager, string baseApplicationPath, UserError error, out SystemVersion firmwareVersion)
Expand Down Expand Up @@ -95,14 +88,18 @@ public static bool CanStartApplication(ContentManager contentManager, string bas
string baseApplicationExtension = Path.GetExtension(baseApplicationPath).ToLowerInvariant();

// NOTE: We don't force homebrew developers to install a system firmware.
if (baseApplicationExtension is not (".nro" or ".nso"))
return IsFirmwareValid(contentManager, out error);

if (baseApplicationExtension is ".nro" or ".nso")
{
error = UserError.Success;
return true;
}

return IsFirmwareValid(contentManager, out error);
}

error = UserError.ApplicationNotFound;

return error is UserError.Success;
return false;
}
}
}

0 comments on commit d7e17ab

Please sign in to comment.