Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux compatibility #217

Open
BinToss opened this issue Oct 23, 2021 · 0 comments
Open

Linux compatibility #217

BinToss opened this issue Oct 23, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request p:LOW Low Priority

Comments

@BinToss
Copy link
Member

BinToss commented Oct 23, 2021

See HaloSPV3/Gemini#54 for planning and discussion.

KEY ISSUES

Native Interop

More often than not, this involves DllImport attribute on functions/methods marked with the extern keyword.
Wherever we call one of these methods, the caller should wrap this in a try-catch statement.
https://stackoverflow.com/a/970134/14894786

HXE.HCE.Registry

This class is used to discover an existing ProductID of either Retail (halo) or Custom Edition (haloce). If one if found, we use the same patch Chimera uses to skip redundant product activation checks when the game runs.

HXE/src/HCE/Registry.cs

Lines 109 to 146 in d1b27dc

public static bool GameActivated(Game game)
{
/** Select a registry subkey based on the Game parameter */
string subkey;
switch (game)
{
case Game.Retail:
subkey = Path.Combine(WoWCheck(), Retail);
break;
case Game.Custom:
subkey = Path.Combine(WoWCheck(), Custom);
break;
default:
throw new ArgumentException("The specified game does not need activation.");
}
/** Open the subkey and read the PID entry */
bool keyIsValid;
bool subkeyIsValid = false;
try
{
RegistryKey key = WinReg.LocalMachine.OpenSubKey(subkey);
keyIsValid = key != null;
if (keyIsValid)
subkeyIsValid = !string.IsNullOrEmpty(key.GetValue("PID").ToString());
}
catch (Exception e)
{
var file = (File) Paths.Exception;
file.AppendAllText($"Error -- {e}");
throw;
}
return keyIsValid && subkeyIsValid;
}

GUI windows

  • Settings
  • Positions
    Both of these windows use WPF which is Windows-only. This dependency could be replaced with UNO, Blazor (web app) or MAUI (not Linux-compatible) more easily than in the case of SPV3-Loader.

Runtime-Specific AppHosts

This is going to be interesting (read as 'aggravating') depending on whether we compile for Windows with some compatibility logic or compile separate apps for Windows and Linux hosts.

If we compile separate apps for each platform/runtime, there will be one less headache to deal with.
Otherwise, we'll have to work around Runtime and OS behavior being unexpectedly different from DotNet on Windows.

In either case, we will need to introduce platform-specific code paths.

I hope HXE.SFX won't become an issue...

@BinToss BinToss changed the title feat: Linux compatibility [Feature] Linux compatibility Oct 23, 2021
@BinToss BinToss self-assigned this Oct 23, 2021
@BinToss BinToss added the enhancement New feature or request label Oct 23, 2021
@BinToss BinToss changed the title [Feature] Linux compatibility feat: Linux compatibility Nov 11, 2021
@BinToss BinToss added the p:LOW Low Priority label Mar 18, 2022
@BinToss BinToss changed the title feat: Linux compatibility Linux compatibility Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p:LOW Low Priority
Projects
None yet
Development

No branches or pull requests

1 participant