Skip to content

Docs: The Main Flow

Marvin1099 edited this page Jul 13, 2024 · 8 revisions

The main flow is a simple part of the wemod-launcher.
The wemod-launcher is in its core is just a fancy argument parser.
Here is the main flow of the script:

  1. The script makes a python venv.
  2. It checks for updates.
  3. It checks if running inside a flatpak.
  4. if any of 1-3 are true rerun in venv / outside of fatpak.
  5. Then we are at the main execution block at the bottom.
  6. There we run function run().
  7. There we get all args.
  8. Find the proton tool.
  9. We now know where proton is in the args.
  10. Behind the proton tool argument the next argument is a verb and the game (or if external runner just the game).
  11. We make shure that the prefix is set up, that is probably the most complex task,
    its not relevant after wemod is installed. The explanation of that is here:
    Docs: The Launcher Installs Wemod.
  12. We create a file named early.tmp that gets deleted after 60 secs,
    so we can detect if the game has closed to fast.
    This is then used in the bat file (docs on next line).
  13. We change the args to run the bat instead of the game and add the game exe behind the bat.
    So the game exe path is send to the bat as a argument. The info on the bat file is here:
    Docs: The BAT Start File.
  14. We run the bat with the wine tool (proton in steam) and send in the game and the game args in.
  15. The bat starts the game that is send in as well as wemod.
  16. At this point the bat finished executing.
  17. All we do now is bring up a simple troubleshooter,
    that can do common things, that help to fix the problem that wemod is not getting started.
  18. After the troubleshooter is done we exit the wemod-launcher script.