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

ModOrganizer 2: Add option to Select Custom Installer Executable #935

Merged
merged 14 commits into from
Dec 8, 2023

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Oct 14, 2023

Overview

This PR adds an option on the Global Menu under ModOrganizer 2 options, to specify a custom installer executable. This is useful if there is a custom/unofficial build that a user wants to install, such as a build that was rumoured to be floating around on a Discord server with Starfield support. A user could also build MO2 from source and this option would allow them to install it.

image

This option is gated behind a checkbox on the Global Menu, so that it is not accidentally enabled. Also, if the file does not exist, we will fall back to downloading MO2 from GitHub.


Right now, this change is entirely untested, as I am using MO2 on my PC right now, and I don't mod on my Steam Deck. I'll need to dig out my laptop+charge/update etc, so it may be a while before I can test.

It would be great if someone could test this and see if it works!

Future Work

I'm hoping in future to apply a very similar change to Vortex. I had originally wanted to do this for Vortex (#810), but went with MO2 first because I actually like and use MO2, and it was a slightly more straightforward change compared to Vortex (as with Vortex we would have to work into the logic to ignore the version/channel etc).


TODO:

  • Update commandline usage to allow passing this option to install command (will be a delicate operation no doubt
  • Do some testing (ensure existing functionality still works without interruption+make sure this option actually works too)
  • Update helpscreen with custom executable usage
  • Update wiki to document this new feature
  • Update langfiles

@sonic2kk
Copy link
Owner Author

Commandline usage added.

@sonic2kk
Copy link
Owner Author

Helpscreen updated.

@sonic2kk
Copy link
Owner Author

Langfiles updated.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Oct 14, 2023

The main remaining work on this PR now is testing, and then writing up the wiki updates. Once this is confirmed to be working, I'll update the wiki.

It may be a while before I can test, so I'd appreciate any community testing.

@sonic2kk sonic2kk changed the title ModOrganizer 2: Initial Logic for Selecting Custom Executable ModOrganizer 2: Add option to Select Custom Installer Executable Oct 14, 2023
@sonic2kk
Copy link
Owner Author

Should also more on the wiki that this option could be particularly useful if using two ModOrganizer compatdatas and that you could swap between versions this way.

@sonic2kk
Copy link
Owner Author

May have to change the UI element type, think I got it wrong...

@sonic2kk
Copy link
Owner Author

Fixed exe file picker element type and resolved conflicts.

@sonic2kk
Copy link
Owner Author

Hoping to test and merge this over the weekend.

@sonic2kk
Copy link
Owner Author

sonic2kk commented Dec 8, 2023

Okay, did some fixups and testing here. It works as expected. Tested this PR with using ModOrganizer 2.5.0 and ModOrganizer 2.4.2 (2.5.0 does not install but I used it as a test executable that was not 2.4.4).

  • ModOrganizer 2 download and install works correctly when USEMO2CUSTOMINSTALLER -eq 0
  • Same as above when USEMO2CUSTOMINSTALLER -eq 0 and a custom MO2 EXE is selected on the global menu, so the custom EXE is correctly ignored if we don't enable the option to use it.
  • ModOrganizer 2 custom executable from Global Menu is used if USEMO2CUSTOMINSTALLER -eq 1 and we have a valid game EXE
  • ModOrganizer 2 custom executable from commandline is correctly used if we pass it and if it is a valid file (USEMO2CUSTOMINSTALLER is forced on in this case for that run only)
  • If ModOrganizer 2 custom executable from Global Menu or Commandline is invalid file we correctly ignore it
  • ModOrganizer 2 custom executable from commandline correctly takes precedence over one on Global Menu
  • ModOrganizer 2 custom executable commandline usage works even if nothing is set on Global Menu
  • When none of these options are set (all of the work in this PR is OFF by default) there is no impact, so there is no impact to existing functionality.

I'll do a quick ShellCheck on this and make any required changes, then update the wiki and merge this. Finally, this PR is out of development hell!

@sonic2kk
Copy link
Owner Author

sonic2kk commented Dec 8, 2023

No changes required for ShellCheck. Will do a final glance over the code, bump the version and merge once the wiki is updated.

@sonic2kk sonic2kk force-pushed the mo2-custom-installer branch from 2a82bcd to 8aaf71c Compare December 8, 2023 19:41
@sonic2kk
Copy link
Owner Author

sonic2kk commented Dec 8, 2023

Code looks good, ShellCheck is green, wiki is updated (Commandline Usage updated, Global Menu configuration section added), version is bumped. This is ready to merge!

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.

1 participant