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

Don't redirect when redirector launches itself #642

Merged
merged 4 commits into from
May 12, 2024

Conversation

rockerbacon
Copy link
Owner

What it does

Fixes #387 by using a new environment variable NO_REDIRECT.

When NO_REDIRECT is set, the redirector will run the original game launcher instead of MO2. The redirector will add NO_REDIRECT to the environment before launching MO2, ensuring that all further executions within the environment will launch the game launcher.

The solution works perfectly for the specific issue it aims to solve. There are small caveats that might be encountered in the future:

  • Processes launched by MO2 may unset NO_REDIRECT. The likelihood of a process doing this is near 0.
  • The current argument forwarding logic was left unchanged, which could break processes attempting to pass more than 1 argument to the game launcher. There's currently no known process that attempts to launch the game's launcher with arguments.

Additionally Includes

  • Fix for wide character strings not being properly logged under Windows/Wine
  • Debug binary's terminal will now wait for user input before closing, allowing developers to more easily read crash logs

@rockerbacon rockerbacon merged commit 212fa41 into master May 12, 2024
1 check passed
@rockerbacon rockerbacon deleted the conditional-redirection branch May 12, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"An Instance of Mod Organizer is already running" for Fallout New Vegas mod organizer
1 participant