diff --git a/src/Packages/Passport/Runtime/Scripts/Private/Helpers/WindowsDeepLink.cs b/src/Packages/Passport/Runtime/Scripts/Private/Helpers/WindowsDeepLink.cs index 1a6c948f2..6b2b29c5b 100644 --- a/src/Packages/Passport/Runtime/Scripts/Private/Helpers/WindowsDeepLink.cs +++ b/src/Packages/Passport/Runtime/Scripts/Private/Helpers/WindowsDeepLink.cs @@ -275,6 +275,8 @@ private static string GetGameExecutablePath(string suffix) if (suffix == ".exe") { // Get the path of the currently running executable +#if !ENABLE_IL2CPP + // Process.MainModule is only supported in Mono builds, not in IL2CPP, and will cause a crash try { var process = System.Diagnostics.Process.GetCurrentProcess(); @@ -291,6 +293,7 @@ private static string GetGameExecutablePath(string suffix) { PassportLogger.Warn($"Process inaccessible: {ex.Message}. Using fallback method."); } +#endif // Fallback: Use command line args var args = System.Environment.GetCommandLineArgs();