ModOrganizer2 / modorganizer

Mod manager for various PC games. Discord Server: https://discord.gg/ewUVAqyrQX if you would like to be more involved
http://www.nexusmods.com/skyrimspecialedition/mods/6194
GNU General Public License v3.0
2.08k stars 157 forks source link

Don't throw "failed to run {EXE}. The logs might have more information." error when launching Root Builder executable via CLI. #1931

Open DefinitelyNotSade opened 7 months ago

DefinitelyNotSade commented 7 months ago

Is your feature request related to a problem? Please describe.

When launching an executable managed with Root Builder via MO2's CLI, the game launches and performs as expected with mods functioning properly.

i.e.

& "PATH TO MO2\Mod Organizer.exe" -i "Skyrim SE - GOG" -p "Some Profile" run -e "SKSE"

However, on game exit, an error is thrown that states "Failed to run {EXECUTABLE}. The logs might have more information." As seen below:

Screenshot 2023-11-28 105454

In the above context, I have Skyrim Script Extender 64 installed to this path, which corresponds to an action in MO2 called SKSE:

D:\Modding\MO2 Instances\Skyrim SE - GOG\mods\Skyrim Script Extender (SKSE64)\

Structured with skse_loader.exe and skse64_1_6_659.dll in the extracted mod's Root sub-folder.

With the corresponding action set up in MO2:

Screenshot 2023-11-28 1103452222

This error is not thrown when launching that executable via MO2's GUI, even after game exit.

Describe the solution you'd like

Either don't throw the error, or somehow articulate a more appropriate solution. As the mods and the game performs as expected on game launch, this error doesn't seem to be need in this specific context.

Describe alternatives you've considered

I've considered leaving skse_loader.exe in the game's root folder and pointing MO2 to that executable, it works and successfully exits as expected, however this still leaves the game's root folder populated with non-vanilla files.

Additional context I've observed this behaviour in both 2.4.4 and 2.5.0.

I do not believe this is an error with Root Builder, as this error being thrown is dependent on how the executable managed via MO2 is launched (i.e. launched via CLI or GUI), not the fact that it is a mod structured to be used with Root Builder.

Silarn commented 7 months ago

Do you know if this happens if SKSE is installed manually? I can only guess that there's either some kind of error output during run or the return code indicates there was an error or something to that effect. But I don't know why that would only happen when using a shortcut.

DefinitelyNotSade commented 7 months ago

If skse_loader.exe is installed in the game's root folder and MO2 pointed to it, and launched via CLI, then the error is not thrown when exiting the game.

If skse_loader.exe is installed in the game's root folder, and MO2 is still instead pointing to the skse_loader.exe in the mod's Root sub-folder, then this error is still thrown on game exit when launched via CLI.

This error, from my experience, is only thrown when launching via CLI to an executable managed with Root Builder.

Even with Root Builder's default options of Redirect enabled and the Mode being Copy.

Since the error mentions the logs containing relevant information, I've attached the following two.

Here is mo_interface.log:

mo_interface.log

And the most recent usvfs-*.log:

usvfs-2023-11-30_16-40-29.log

The crashDumps folder is empty.

EDIT: I should also mention that this is not exclusive to Skyrim, I've seen this exact behaviour with Root Builder across all other Script Extender executables in BGS games I've tried.

Kezyma commented 7 months ago

I assume the warning that the executable didn't run is a new error that MO2 displays as of v2.5?

When RB runs using redirect, it triggers a new launch from the game location and then returns false for the original launch from the root folder.

I'm guessing that MO2 now throws this error if someone returns false during the onAboutToRun function, not sure if there's anything I can really do about it within RB though, unless there's another way to prevent the launch without throwing any error.

DefinitelyNotSade commented 7 months ago

I assume the warning that the executable didn't run is a new error that MO2 displays as of v2.5?

No, I've been experiencing this error for a while, regardless of which version of MO2 or RB I use.