Installer mod-organizer-2-10

files:
- dialog: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.0-utils/dialog.sh
- find_library_for_appid: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.0-utils/find-library-for-appid.sh
- gamesinfo: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.5-gamesinfo/gamesinfo.tar.gz
- proton_launcher: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/proton-launcher.sh
- wine_launcher: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/wine-launcher.sh
- nxm_broker: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/modorganizer2-nxm-broker.sh
- nxm_mime_handler: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/modorganizer2-nxm-handler.desktop
- openjdk: https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jre_x64_windows_8u252b09.zip
- fose: https://www.fose.silverlock.org/download/fose_v1_2_beta2.7z
- f4se: https://f4se.silverlock.org/beta/f4se_0_06_21.7z
- nvse: http://nvse.silverlock.org/download/nvse_5_1_beta4.7z
- mwse: https://github.com/MWSE/MWSE/releases/download/build-automatic/mwse.zip
- obse: http://obse.silverlock.org/download/obse_0021.zip
- skse: https://skse.silverlock.org/beta/skse_1_07_03.7z
- skse64: https://skse.silverlock.org/beta/skse64_2_00_17.7z
- mo_archive: https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.2.1/Mod.Organizer-2.2.2.1.7z
game:
  exe: $GAMEDIR/run.sh
install_complete_text: "Installation completed successfully!\n\nIt is recommended\
  \ to rename this instance so it's easier to tell which game it manages.\nYou can\
  \ do so by right clicking it on Lutris > Configure > Game Info.\n\nA few things\
  \ to keep in mind before using Mod Organizer 2:\n\n* Mod Organizer 2 cannot open\
  \ a browser. In order to login to Nexus, you must manually\n  add the API key you\
  \ generated at https://www.nexusmods.com/users/myaccount?tab=api\n\n* The script\
  \ extender for the game you selected is already installed and ready to use\n\n*\
  \ If you need to run Proc Patchers, a Java binary is available at C:\\java\\bin\\\
  java.exe\n\nIn case of questions or issues visit https://github.com/rockerbacon/lutris-skyrimse-installers"
installer:
- input_menu:
    description: 'Welcome to the Mod Organizer 2 installer!


      This installer only allows Mod Organizer 2 to manage a single game.

      Install one instance of Mod Organizer 2 for each game you want to manage.

      It is recommended to configure a cache path in "Lutris > Preferences > Lutris
      Preferences" to avoid re-downloading files.


      Which game would you like to manage with this installation?'
    id: NEXUS_GAME_ID
    options:
    - fallout3: Fallout 3
    - fallout4: Fallout 4
    - newvegas: Fallout New Vegas
    - morrowind: Morrowind
    - oblivion: Oblivion
    - skyrim: Skyrim
    - skyrimspecialedition: Skyrim Special Edition
    preselect: fallout3
- input_menu:
    description: "Do you play this game through Steam Play (Proton)?\n\nIf yes, ensure\
      \ the following before continuing:\n    * The game was run at least once on\
      \ Steam\n    * The game is configured to use Proton 5. On Steam: right click\
      \ the game > Properties > tab \"General\" > Force the use of a specific Steam\
      \ Play compatibility tool"
    id: RUNNER
    options:
    - proton: Yes, I use Steam Play and everything is set up
    - wine: No, I use pure Wine
    preselect: proton
- copy:
    dst: $CACHE/utils/
    src: dialog
- chmodx: $CACHE/utils/dialog.sh
- copy:
    dst: $CACHE/utils/
    src: find_library_for_appid
- chmodx: $CACHE/utils/find-library-for-appid.sh
- extract:
    dst: $CACHE/gamesinfo/
    file: gamesinfo
- copy:
    dst: $HOME/.local/share/modorganizer2/
    src: wine_launcher
- chmodx: $HOME/.local/share/modorganizer2/wine-launcher.sh
- copy:
    dst: $HOME/.local/share/modorganizer2/
    src: proton_launcher
- chmodx: $HOME/.local/share/modorganizer2/proton-launcher.sh
- copy:
    dst: $HOME/.local/bin
    src: nxm_broker
- chmodx: $HOME/.local/bin/modorganizer2-nxm-broker.sh
- copy:
    dst: $HOME/.local/share/applications
    src: nxm_mime_handler
- execute:
    command: xdg-mime default modorganizer2-nxm-handler.desktop x-scheme-handler/nxm
- extract:
    dst: $CACHE/extracted-openjdk/
    file: openjdk
- extract:
    dst: $CACHE/fallout3-script-extender/
    file: fose
- extract:
    dst: $CACHE/fallout4-script-extender/
    file: f4se
- extract:
    dst: $CACHE/newvegas-script-extender/
    file: nvse
- extract:
    dst: $CACHE/morrowind-script-extender/
    file: mwse
- extract:
    dst: $CACHE/oblivion-script-extender/
    file: obse
- execute:
    command: printf '\x90\x90\x90' | dd conv=notrunc of='$CACHE/oblivion-script-extender/obse_loader.exe'
      bs=1 seek=$((0x14cb))
- extract:
    dst: $CACHE/skyrim-script-extender/
    file: skse
- extract:
    dst: $CACHE/skyrimspecialedition-script-extender/
    file: skse64
- execute:
    command: "# clear envs set by Lutris\nexport LD_LIBRARY_PATH=\"\"\n\nnexus_game_id=$INPUT_NEXUS_GAME_ID\n\
      runner=$INPUT_RUNNER\n\nif [ ! -f \"$CACHE/gamesinfo/$nexus_game_id.sh\" ];\
      \ then\n    \"$CACHE/utils/dialog.sh\" errorbox \\\n        \"Could not find\
      \ gameinfo for '$nexus_game_id', remove Lutris cache and try again\"\n    exit\
      \ 1\nfi\n\nsource \"$CACHE/gamesinfo/$nexus_game_id.sh\"\n\nif [ -z \"$game_appid\"\
      \ ]; then\n    echo \"ERROR: empty game_appid\" >&2\n    exit 1\nelif [ -z \"\
      $game_steam_subdirectory\" ]; then\n    echo \"ERROR: empty steam_subdirectory\"\
      \ >&2\n    exit 1\nfi\n\nshared=\"$HOME/.local/share/modorganizer2\"\n\ncase\
      \ \"$runner\" in\n    proton)\n        mo2_tricks=\"vcrun2019\"\n        mo2_options=\"\
      \"\n\n        if [ -z \"$steam_library\" ]; then\n            steam_library=$(\"\
      $CACHE/utils/find-library-for-appid.sh\" $game_appid)\n        fi\n\n      \
      \  if [ ! -d \"$steam_library\" ]; then\n            \"$CACHE/utils/dialog.sh\"\
      \ errorbox \\\n                \"Could not find '$game_steam_subdirectory' in\
      \ your Steam library\"\n            exit 1\n        fi\n\n        game_prefix=\"\
      $steam_library/steamapps/compatdata/$game_appid/pfx\"\n        game_installation=\"\
      $steam_library/steamapps/common/$game_steam_subdirectory\"\n        game_tricks=\"\
      $game_protontricks\"\n\n        echo -e \\\n        \"#!/bin/bash\\n\\n'$shared/proton-launcher.sh'\
      \ $mo2_options $game_proton_options \\\"\\$@\\\" $game_appid '$GAMEDIR/ModOrganizer2/ModOrganizer.exe'\"\
      \ \\\n        > \"$GAMEDIR/run.sh\"\n\n        echo -e \\\n        \"#!/bin/bash\\\
      n\\n'$shared/proton-launcher.sh' $mo2_options $game_proton_options $game_appid\
      \ '$GAMEDIR/ModOrganizer2/nxmhandler.exe' \\\"\\$1\\\"\" \\\n        > \"$GAMEDIR/download.sh\"\
      \n        ;;\n\n    wine)\n        mo2_tricks=\"vcrun2019 dotnet40\"\n     \
      \   mo2_options=\"--proton-wine --winever 5.*\"\n\n        \"$CACHE/utils/dialog.sh\"\
      \ warnbox \\\n            \"As of version 5.7, Wine still does not fully support\
      \ Mod Organizer 2.2.1 and later.\\nFor this reason this installer uses the Wine\
      \ version bundled with Proton 5.0.\\nMake sure you have Steam and Proton 5.0\
      \ installed on your system\"\n\n        game_prefix=$( \\\n            \"$CACHE/utils/dialog.sh\"\
      \ directorypicker \\\n                \"Inform the path to your wineprefix\"\
      \ \\\n        )\n        if [ -z \"$game_prefix\" ]; then\n            echo\
      \ \"ERROR: Installation canceled by user\" >&2\n            exit 1\n       \
      \ fi\n\n        game_tricks=\"$game_winetricks\"\n\n        install_path_candidates=(\
      \ \\\n            \"$game_prefix/drive_c/Program Files (x86)/Steam/steamapps/common/$game_steam_subdirectory\"\
      \ \\\n            \"$game_prefix/drive_c/GOG Games/$game_steam_subdirectory\"\
      \ \\\n        )\n        if [ -n \"$game_gog_subdirectory\" ]; then\n      \
      \      install_path_candidates+=( \\\n                \"$game_prefix/drive_c/GOG\
      \ Games/$game_gog_subdirectory\" \\\n            )\n        fi\n        if [\
      \ \"$nexus_game_id\" == \"fallout3\" ]; then\n            install_path_candidates+=(\
      \ \\\n                \"$game_prefix/drive_c/Program Files (x86)/Steam/steamapps/common/Fallout\
      \ 3\" \\\n                \"$game_prefix/drive_c/GOG Games/Fallout 3\" \\\n\
      \            )\n        fi\n\n        for path in \"${install_path_candidates[@]}\"\
      ; do\n            echo \"Searching for game at '$path'\"\n            if [ -d\
      \ \"$path\" ]; then\n                echo \"Found game\"\n                game_installation=\"\
      $path\"\n                break\n            fi\n        done\n\n        if [\
      \ -z \"$game_installation\" ]; then\n            game_installation=$( \\\n \
      \               \"$CACHE/utils/dialog.sh\" directorypicker \\\n            \
      \        \"Could not automatically find the game.\\nPlease inform the path where\
      \ the game is installed\" \\\n            )\n            if [ -z \"$game_installation\"\
      \ ]; then\n                echo \"ERROR: installation canceled by user\" >&2\n\
      \                exit 1\n            fi\n        fi\n\n        # TODO: uncomment\
      \ once Wine fixes issues with VC2019\n        # winever=$( \\\n        #   \
      \  \"$CACHE/utils/dialog.sh\" textentry \\\n        #         \"Inform which\
      \ version of Wine you're using\\nLeave as * to use the latest version available\
      \ on Lutris\" \\\n        #         \"*\" \\\n        # )\n        # if [ -z\
      \ \"$winever\" ]; then\n        #     echo \"ERROR: Installation canceled by\
      \ user\" >&2\n        #     exit 1\n        # fi\n\n        echo -e \\\n   \
      \     \"#!/bin/bash\\n\\nWINEPREFIX='$game_prefix' '$shared/wine-launcher.sh'\
      \ $mo2_options $game_wine_options \\\"\\$@\\\" '$GAMEDIR/ModOrganizer2/ModOrganizer.exe'\"\
      \ \\\n        > \"$GAMEDIR/run.sh\"\n\n        echo -e \\\n        \"#!/bin/bash\\\
      n\\nWINEPREFIX='$game_prefix' '$shared/wine-launcher.sh' $mo2_options $game_wine_options\
      \ '$GAMEDIR/ModOrganizer2/nxmhandler.exe' \\\"\\$1\\\"\" \\\n        > \"$GAMEDIR/download.sh\"\
      \n        ;;\nesac\n\nif [ -d \"$CACHE/${nexus_game_id}-script-extender\" ];\
      \ then\n    echo \"Installing script extender...\"\n\n    output=$( \\\n   \
      \     cp -af \\\n        \"$CACHE/${nexus_game_id}-script-extender/.\" \\\n\
      \        \"$game_installation/\" 2>&1 \\\n    )\n    if [ \"$?\" != \"0\" ];\
      \ then\n        \"$CACHE/utils/dialog.sh\" errorbox \\\n            \"Error\
      \ while installing script extender: $output\"\n        exit 1\n    fi\nfi\n\n\
      mkdir -p \"$game_prefix/drive_c/java\"\noutput=$( \\\n    cp -af \\\n    \"\
      $CACHE/extracted-openjdk/.\" \\\n    \"$game_prefix/drive_c/java/\" 2>&1 \\\n\
      )\nif [ \"$?\" != \"0\" ]; then\n    \"$CACHE/utils/dialog.sh\" errorbox \\\n\
      \        \"Error while installing OpenJDK: $output\"\n    exit 1\nfi\n\nWINEPREFIX=\"\
      $game_prefix\" \\\n\"$HOME/.local/share/lutris/runtime/winetricks/winetricks\"\
      \ -q $mo2_tricks $game_tricks\nif [ \"$?\" != \"0\" ]; then\n    \"$CACHE/utils/dialog.sh\"\
      \ errorbox \\\n        \"Error while installing winetricks, please run Lutris\
      \ from a terminal and check the logs\"\n    exit 1\nfi\n\n# workaround to stop\
      \ installation if command fails\necho \"success\" > '$CACHE/successful-prefix-preparation'\n"
    env:
      CACHE: $CACHE
      GAMEDIR: $GAMEDIR
- move:
    dst: $CACHE/successful-prefix-preparation-acknowledged
    src: $CACHE/successful-prefix-preparation
- chmodx: $GAMEDIR/run.sh
- chmodx: $GAMEDIR/download.sh
- extract:
    dst: $GAMEDIR/ModOrganizer2/
    file: mo_archive
- execute:
    command: 'mkdir -p ''$HOME/.config/modorganizer2/instances''

      rm -f "$HOME/.config/modorganizer2/instances/$INPUT_NEXUS_GAME_ID"

      ln -s ''$GAMEDIR/'' ''$HOME/.config/modorganizer2/instances/$INPUT_NEXUS_GAME_ID''

      '
- write_file:
    content: 2
    file: $HOME/.local/share/modorganizer2/installer_major_version.txt
require-binaries: zenity | xmessage | xterm
system:
  disable_runtime: true
description: null
game_slug: mod-organizer-2
gogslug: ''
humblestoreid: ''
installer_slug: mod-organizer-2-10
name: Mod Organizer 2
notes: ''
runner: linux
script:
  files:
  - dialog: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.0-utils/dialog.sh
  - find_library_for_appid: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.0-utils/find-library-for-appid.sh
  - gamesinfo: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.5-gamesinfo/gamesinfo.tar.gz
  - proton_launcher: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/proton-launcher.sh
  - wine_launcher: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/wine-launcher.sh
  - nxm_broker: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/modorganizer2-nxm-broker.sh
  - nxm_mime_handler: https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/modorganizer2-nxm-handler.desktop
  - openjdk: https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jre_x64_windows_8u252b09.zip
  - fose: https://www.fose.silverlock.org/download/fose_v1_2_beta2.7z
  - f4se: https://f4se.silverlock.org/beta/f4se_0_06_21.7z
  - nvse: http://nvse.silverlock.org/download/nvse_5_1_beta4.7z
  - mwse: https://github.com/MWSE/MWSE/releases/download/build-automatic/mwse.zip
  - obse: http://obse.silverlock.org/download/obse_0021.zip
  - skse: https://skse.silverlock.org/beta/skse_1_07_03.7z
  - skse64: https://skse.silverlock.org/beta/skse64_2_00_17.7z
  - mo_archive: https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.2.1/Mod.Organizer-2.2.2.1.7z
  game:
    exe: $GAMEDIR/run.sh
  install_complete_text: "Installation completed successfully!\n\nIt is recommended\
    \ to rename this instance so it's easier to tell which game it manages.\nYou can\
    \ do so by right clicking it on Lutris > Configure > Game Info.\n\nA few things\
    \ to keep in mind before using Mod Organizer 2:\n\n* Mod Organizer 2 cannot open\
    \ a browser. In order to login to Nexus, you must manually\n  add the API key\
    \ you generated at https://www.nexusmods.com/users/myaccount?tab=api\n\n* The\
    \ script extender for the game you selected is already installed and ready to\
    \ use\n\n* If you need to run Proc Patchers, a Java binary is available at C:\\\
    java\\bin\\java.exe\n\nIn case of questions or issues visit https://github.com/rockerbacon/lutris-skyrimse-installers"
  installer:
  - input_menu:
      description: 'Welcome to the Mod Organizer 2 installer!


        This installer only allows Mod Organizer 2 to manage a single game.

        Install one instance of Mod Organizer 2 for each game you want to manage.

        It is recommended to configure a cache path in "Lutris > Preferences > Lutris
        Preferences" to avoid re-downloading files.


        Which game would you like to manage with this installation?'
      id: NEXUS_GAME_ID
      options:
      - fallout3: Fallout 3
      - fallout4: Fallout 4
      - newvegas: Fallout New Vegas
      - morrowind: Morrowind
      - oblivion: Oblivion
      - skyrim: Skyrim
      - skyrimspecialedition: Skyrim Special Edition
      preselect: fallout3
  - input_menu:
      description: "Do you play this game through Steam Play (Proton)?\n\nIf yes,\
        \ ensure the following before continuing:\n    * The game was run at least\
        \ once on Steam\n    * The game is configured to use Proton 5. On Steam: right\
        \ click the game > Properties > tab \"General\" > Force the use of a specific\
        \ Steam Play compatibility tool"
      id: RUNNER
      options:
      - proton: Yes, I use Steam Play and everything is set up
      - wine: No, I use pure Wine
      preselect: proton
  - copy:
      dst: $CACHE/utils/
      src: dialog
  - chmodx: $CACHE/utils/dialog.sh
  - copy:
      dst: $CACHE/utils/
      src: find_library_for_appid
  - chmodx: $CACHE/utils/find-library-for-appid.sh
  - extract:
      dst: $CACHE/gamesinfo/
      file: gamesinfo
  - copy:
      dst: $HOME/.local/share/modorganizer2/
      src: wine_launcher
  - chmodx: $HOME/.local/share/modorganizer2/wine-launcher.sh
  - copy:
      dst: $HOME/.local/share/modorganizer2/
      src: proton_launcher
  - chmodx: $HOME/.local/share/modorganizer2/proton-launcher.sh
  - copy:
      dst: $HOME/.local/bin
      src: nxm_broker
  - chmodx: $HOME/.local/bin/modorganizer2-nxm-broker.sh
  - copy:
      dst: $HOME/.local/share/applications
      src: nxm_mime_handler
  - execute:
      command: xdg-mime default modorganizer2-nxm-handler.desktop x-scheme-handler/nxm
  - extract:
      dst: $CACHE/extracted-openjdk/
      file: openjdk
  - extract:
      dst: $CACHE/fallout3-script-extender/
      file: fose
  - extract:
      dst: $CACHE/fallout4-script-extender/
      file: f4se
  - extract:
      dst: $CACHE/newvegas-script-extender/
      file: nvse
  - extract:
      dst: $CACHE/morrowind-script-extender/
      file: mwse
  - extract:
      dst: $CACHE/oblivion-script-extender/
      file: obse
  - execute:
      command: printf '\x90\x90\x90' | dd conv=notrunc of='$CACHE/oblivion-script-extender/obse_loader.exe'
        bs=1 seek=$((0x14cb))
  - extract:
      dst: $CACHE/skyrim-script-extender/
      file: skse
  - extract:
      dst: $CACHE/skyrimspecialedition-script-extender/
      file: skse64
  - execute:
      command: "# clear envs set by Lutris\nexport LD_LIBRARY_PATH=\"\"\n\nnexus_game_id=$INPUT_NEXUS_GAME_ID\n\
        runner=$INPUT_RUNNER\n\nif [ ! -f \"$CACHE/gamesinfo/$nexus_game_id.sh\" ];\
        \ then\n    \"$CACHE/utils/dialog.sh\" errorbox \\\n        \"Could not find\
        \ gameinfo for '$nexus_game_id', remove Lutris cache and try again\"\n   \
        \ exit 1\nfi\n\nsource \"$CACHE/gamesinfo/$nexus_game_id.sh\"\n\nif [ -z \"\
        $game_appid\" ]; then\n    echo \"ERROR: empty game_appid\" >&2\n    exit\
        \ 1\nelif [ -z \"$game_steam_subdirectory\" ]; then\n    echo \"ERROR: empty\
        \ steam_subdirectory\" >&2\n    exit 1\nfi\n\nshared=\"$HOME/.local/share/modorganizer2\"\
        \n\ncase \"$runner\" in\n    proton)\n        mo2_tricks=\"vcrun2019\"\n \
        \       mo2_options=\"\"\n\n        if [ -z \"$steam_library\" ]; then\n \
        \           steam_library=$(\"$CACHE/utils/find-library-for-appid.sh\" $game_appid)\n\
        \        fi\n\n        if [ ! -d \"$steam_library\" ]; then\n            \"\
        $CACHE/utils/dialog.sh\" errorbox \\\n                \"Could not find '$game_steam_subdirectory'\
        \ in your Steam library\"\n            exit 1\n        fi\n\n        game_prefix=\"\
        $steam_library/steamapps/compatdata/$game_appid/pfx\"\n        game_installation=\"\
        $steam_library/steamapps/common/$game_steam_subdirectory\"\n        game_tricks=\"\
        $game_protontricks\"\n\n        echo -e \\\n        \"#!/bin/bash\\n\\n'$shared/proton-launcher.sh'\
        \ $mo2_options $game_proton_options \\\"\\$@\\\" $game_appid '$GAMEDIR/ModOrganizer2/ModOrganizer.exe'\"\
        \ \\\n        > \"$GAMEDIR/run.sh\"\n\n        echo -e \\\n        \"#!/bin/bash\\\
        n\\n'$shared/proton-launcher.sh' $mo2_options $game_proton_options $game_appid\
        \ '$GAMEDIR/ModOrganizer2/nxmhandler.exe' \\\"\\$1\\\"\" \\\n        > \"\
        $GAMEDIR/download.sh\"\n        ;;\n\n    wine)\n        mo2_tricks=\"vcrun2019\
        \ dotnet40\"\n        mo2_options=\"--proton-wine --winever 5.*\"\n\n    \
        \    \"$CACHE/utils/dialog.sh\" warnbox \\\n            \"As of version 5.7,\
        \ Wine still does not fully support Mod Organizer 2.2.1 and later.\\nFor this\
        \ reason this installer uses the Wine version bundled with Proton 5.0.\\nMake\
        \ sure you have Steam and Proton 5.0 installed on your system\"\n\n      \
        \  game_prefix=$( \\\n            \"$CACHE/utils/dialog.sh\" directorypicker\
        \ \\\n                \"Inform the path to your wineprefix\" \\\n        )\n\
        \        if [ -z \"$game_prefix\" ]; then\n            echo \"ERROR: Installation\
        \ canceled by user\" >&2\n            exit 1\n        fi\n\n        game_tricks=\"\
        $game_winetricks\"\n\n        install_path_candidates=( \\\n            \"\
        $game_prefix/drive_c/Program Files (x86)/Steam/steamapps/common/$game_steam_subdirectory\"\
        \ \\\n            \"$game_prefix/drive_c/GOG Games/$game_steam_subdirectory\"\
        \ \\\n        )\n        if [ -n \"$game_gog_subdirectory\" ]; then\n    \
        \        install_path_candidates+=( \\\n                \"$game_prefix/drive_c/GOG\
        \ Games/$game_gog_subdirectory\" \\\n            )\n        fi\n        if\
        \ [ \"$nexus_game_id\" == \"fallout3\" ]; then\n            install_path_candidates+=(\
        \ \\\n                \"$game_prefix/drive_c/Program Files (x86)/Steam/steamapps/common/Fallout\
        \ 3\" \\\n                \"$game_prefix/drive_c/GOG Games/Fallout 3\" \\\n\
        \            )\n        fi\n\n        for path in \"${install_path_candidates[@]}\"\
        ; do\n            echo \"Searching for game at '$path'\"\n            if [\
        \ -d \"$path\" ]; then\n                echo \"Found game\"\n            \
        \    game_installation=\"$path\"\n                break\n            fi\n\
        \        done\n\n        if [ -z \"$game_installation\" ]; then\n        \
        \    game_installation=$( \\\n                \"$CACHE/utils/dialog.sh\" directorypicker\
        \ \\\n                    \"Could not automatically find the game.\\nPlease\
        \ inform the path where the game is installed\" \\\n            )\n      \
        \      if [ -z \"$game_installation\" ]; then\n                echo \"ERROR:\
        \ installation canceled by user\" >&2\n                exit 1\n          \
        \  fi\n        fi\n\n        # TODO: uncomment once Wine fixes issues with\
        \ VC2019\n        # winever=$( \\\n        #     \"$CACHE/utils/dialog.sh\"\
        \ textentry \\\n        #         \"Inform which version of Wine you're using\\\
        nLeave as * to use the latest version available on Lutris\" \\\n        #\
        \         \"*\" \\\n        # )\n        # if [ -z \"$winever\" ]; then\n\
        \        #     echo \"ERROR: Installation canceled by user\" >&2\n       \
        \ #     exit 1\n        # fi\n\n        echo -e \\\n        \"#!/bin/bash\\\
        n\\nWINEPREFIX='$game_prefix' '$shared/wine-launcher.sh' $mo2_options $game_wine_options\
        \ \\\"\\$@\\\" '$GAMEDIR/ModOrganizer2/ModOrganizer.exe'\" \\\n        > \"\
        $GAMEDIR/run.sh\"\n\n        echo -e \\\n        \"#!/bin/bash\\n\\nWINEPREFIX='$game_prefix'\
        \ '$shared/wine-launcher.sh' $mo2_options $game_wine_options '$GAMEDIR/ModOrganizer2/nxmhandler.exe'\
        \ \\\"\\$1\\\"\" \\\n        > \"$GAMEDIR/download.sh\"\n        ;;\nesac\n\
        \nif [ -d \"$CACHE/${nexus_game_id}-script-extender\" ]; then\n    echo \"\
        Installing script extender...\"\n\n    output=$( \\\n        cp -af \\\n \
        \       \"$CACHE/${nexus_game_id}-script-extender/.\" \\\n        \"$game_installation/\"\
        \ 2>&1 \\\n    )\n    if [ \"$?\" != \"0\" ]; then\n        \"$CACHE/utils/dialog.sh\"\
        \ errorbox \\\n            \"Error while installing script extender: $output\"\
        \n        exit 1\n    fi\nfi\n\nmkdir -p \"$game_prefix/drive_c/java\"\noutput=$(\
        \ \\\n    cp -af \\\n    \"$CACHE/extracted-openjdk/.\" \\\n    \"$game_prefix/drive_c/java/\"\
        \ 2>&1 \\\n)\nif [ \"$?\" != \"0\" ]; then\n    \"$CACHE/utils/dialog.sh\"\
        \ errorbox \\\n        \"Error while installing OpenJDK: $output\"\n    exit\
        \ 1\nfi\n\nWINEPREFIX=\"$game_prefix\" \\\n\"$HOME/.local/share/lutris/runtime/winetricks/winetricks\"\
        \ -q $mo2_tricks $game_tricks\nif [ \"$?\" != \"0\" ]; then\n    \"$CACHE/utils/dialog.sh\"\
        \ errorbox \\\n        \"Error while installing winetricks, please run Lutris\
        \ from a terminal and check the logs\"\n    exit 1\nfi\n\n# workaround to\
        \ stop installation if command fails\necho \"success\" > '$CACHE/successful-prefix-preparation'\n"
      env:
        CACHE: $CACHE
        GAMEDIR: $GAMEDIR
  - move:
      dst: $CACHE/successful-prefix-preparation-acknowledged
      src: $CACHE/successful-prefix-preparation
  - chmodx: $GAMEDIR/run.sh
  - chmodx: $GAMEDIR/download.sh
  - extract:
      dst: $GAMEDIR/ModOrganizer2/
      file: mo_archive
  - execute:
      command: 'mkdir -p ''$HOME/.config/modorganizer2/instances''

        rm -f "$HOME/.config/modorganizer2/instances/$INPUT_NEXUS_GAME_ID"

        ln -s ''$GAMEDIR/'' ''$HOME/.config/modorganizer2/instances/$INPUT_NEXUS_GAME_ID''

        '
  - write_file:
      content: 2
      file: $HOME/.local/share/modorganizer2/installer_major_version.txt
  require-binaries: zenity | xmessage | xterm
  system:
    disable_runtime: true
slug: mod-organizer-2-10
steamid: null
version: '1.0'
year: null
{
  "game_slug": "mod-organizer-2",
  "version": "1.0",
  "description": null,
  "notes": "",
  "name": "Mod Organizer 2",
  "year": null,
  "steamid": null,
  "gogslug": "",
  "humblestoreid": "",
  "runner": "linux",
  "slug": "mod-organizer-2-10",
  "installer_slug": "mod-organizer-2-10",
  "script": {
    "files": [
      {
        "dialog": "https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.0-utils/dialog.sh"
      },
      {
        "find_library_for_appid": "https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.0-utils/find-library-for-appid.sh"
      },
      {
        "gamesinfo": "https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.5-gamesinfo/gamesinfo.tar.gz"
      },
      {
        "proton_launcher": "https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/proton-launcher.sh"
      },
      {
        "wine_launcher": "https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/wine-launcher.sh"
      },
      {
        "nxm_broker": "https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/modorganizer2-nxm-broker.sh"
      },
      {
        "nxm_mime_handler": "https://github.com/rockerbacon/lutris-skyrimse-installers/releases/download/2.6.2-runners/modorganizer2-nxm-handler.desktop"
      },
      {
        "openjdk": "https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jre_x64_windows_8u252b09.zip"
      },
      {
        "fose": "https://www.fose.silverlock.org/download/fose_v1_2_beta2.7z"
      },
      {
        "f4se": "https://f4se.silverlock.org/beta/f4se_0_06_21.7z"
      },
      {
        "nvse": "http://nvse.silverlock.org/download/nvse_5_1_beta4.7z"
      },
      {
        "mwse": "https://github.com/MWSE/MWSE/releases/download/build-automatic/mwse.zip"
      },
      {
        "obse": "http://obse.silverlock.org/download/obse_0021.zip"
      },
      {
        "skse": "https://skse.silverlock.org/beta/skse_1_07_03.7z"
      },
      {
        "skse64": "https://skse.silverlock.org/beta/skse64_2_00_17.7z"
      },
      {
        "mo_archive": "https://github.com/ModOrganizer2/modorganizer/releases/download/v2.2.2.1/Mod.Organizer-2.2.2.1.7z"
      }
    ],
    "game": {
      "exe": "$GAMEDIR/run.sh"
    },
    "install_complete_text": "Installation completed successfully!\n\nIt is recommended to rename this instance so it's easier to tell which game it manages.\nYou can do so by right clicking it on Lutris > Configure > Game Info.\n\nA few things to keep in mind before using Mod Organizer 2:\n\n* Mod Organizer 2 cannot open a browser. In order to login to Nexus, you must manually\n  add the API key you generated at https://www.nexusmods.com/users/myaccount?tab=api\n\n* The script extender for the game you selected is already installed and ready to use\n\n* If you need to run Proc Patchers, a Java binary is available at C:\\java\\bin\\java.exe\n\nIn case of questions or issues visit https://github.com/rockerbacon/lutris-skyrimse-installers",
    "installer": [
      {
        "input_menu": {
          "description": "Welcome to the Mod Organizer 2 installer!\n\nThis installer only allows Mod Organizer 2 to manage a single game.\nInstall one instance of Mod Organizer 2 for each game you want to manage.\nIt is recommended to configure a cache path in \"Lutris > Preferences > Lutris Preferences\" to avoid re-downloading files.\n\nWhich game would you like to manage with this installation?",
          "id": "NEXUS_GAME_ID",
          "options": [
            {
              "fallout3": "Fallout 3"
            },
            {
              "fallout4": "Fallout 4"
            },
            {
              "newvegas": "Fallout New Vegas"
            },
            {
              "morrowind": "Morrowind"
            },
            {
              "oblivion": "Oblivion"
            },
            {
              "skyrim": "Skyrim"
            },
            {
              "skyrimspecialedition": "Skyrim Special Edition"
            }
          ],
          "preselect": "fallout3"
        }
      },
      {
        "input_menu": {
          "description": "Do you play this game through Steam Play (Proton)?\n\nIf yes, ensure the following before continuing:\n    * The game was run at least once on Steam\n    * The game is configured to use Proton 5. On Steam: right click the game > Properties > tab \"General\" > Force the use of a specific Steam Play compatibility tool",
          "id": "RUNNER",
          "options": [
            {
              "proton": "Yes, I use Steam Play and everything is set up"
            },
            {
              "wine": "No, I use pure Wine"
            }
          ],
          "preselect": "proton"
        }
      },
      {
        "copy": {
          "dst": "$CACHE/utils/",
          "src": "dialog"
        }
      },
      {
        "chmodx": "$CACHE/utils/dialog.sh"
      },
      {
        "copy": {
          "dst": "$CACHE/utils/",
          "src": "find_library_for_appid"
        }
      },
      {
        "chmodx": "$CACHE/utils/find-library-for-appid.sh"
      },
      {
        "extract": {
          "dst": "$CACHE/gamesinfo/",
          "file": "gamesinfo"
        }
      },
      {
        "copy": {
          "dst": "$HOME/.local/share/modorganizer2/",
          "src": "wine_launcher"
        }
      },
      {
        "chmodx": "$HOME/.local/share/modorganizer2/wine-launcher.sh"
      },
      {
        "copy": {
          "dst": "$HOME/.local/share/modorganizer2/",
          "src": "proton_launcher"
        }
      },
      {
        "chmodx": "$HOME/.local/share/modorganizer2/proton-launcher.sh"
      },
      {
        "copy": {
          "dst": "$HOME/.local/bin",
          "src": "nxm_broker"
        }
      },
      {
        "chmodx": "$HOME/.local/bin/modorganizer2-nxm-broker.sh"
      },
      {
        "copy": {
          "dst": "$HOME/.local/share/applications",
          "src": "nxm_mime_handler"
        }
      },
      {
        "execute": {
          "command": "xdg-mime default modorganizer2-nxm-handler.desktop x-scheme-handler/nxm"
        }
      },
      {
        "extract": {
          "dst": "$CACHE/extracted-openjdk/",
          "file": "openjdk"
        }
      },
      {
        "extract": {
          "dst": "$CACHE/fallout3-script-extender/",
          "file": "fose"
        }
      },
      {
        "extract": {
          "dst": "$CACHE/fallout4-script-extender/",
          "file": "f4se"
        }
      },
      {
        "extract": {
          "dst": "$CACHE/newvegas-script-extender/",
          "file": "nvse"
        }
      },
      {
        "extract": {
          "dst": "$CACHE/morrowind-script-extender/",
          "file": "mwse"
        }
      },
      {
        "extract": {
          "dst": "$CACHE/oblivion-script-extender/",
          "file": "obse"
        }
      },
      {
        "execute": {
          "command": "printf '\\x90\\x90\\x90' | dd conv=notrunc of='$CACHE/oblivion-script-extender/obse_loader.exe' bs=1 seek=$((0x14cb))"
        }
      },
      {
        "extract": {
          "dst": "$CACHE/skyrim-script-extender/",
          "file": "skse"
        }
      },
      {
        "extract": {
          "dst": "$CACHE/skyrimspecialedition-script-extender/",
          "file": "skse64"
        }
      },
      {
        "execute": {
          "command": "# clear envs set by Lutris\nexport LD_LIBRARY_PATH=\"\"\n\nnexus_game_id=$INPUT_NEXUS_GAME_ID\nrunner=$INPUT_RUNNER\n\nif [ ! -f \"$CACHE/gamesinfo/$nexus_game_id.sh\" ]; then\n    \"$CACHE/utils/dialog.sh\" errorbox \\\n        \"Could not find gameinfo for '$nexus_game_id', remove Lutris cache and try again\"\n    exit 1\nfi\n\nsource \"$CACHE/gamesinfo/$nexus_game_id.sh\"\n\nif [ -z \"$game_appid\" ]; then\n    echo \"ERROR: empty game_appid\" >&2\n    exit 1\nelif [ -z \"$game_steam_subdirectory\" ]; then\n    echo \"ERROR: empty steam_subdirectory\" >&2\n    exit 1\nfi\n\nshared=\"$HOME/.local/share/modorganizer2\"\n\ncase \"$runner\" in\n    proton)\n        mo2_tricks=\"vcrun2019\"\n        mo2_options=\"\"\n\n        if [ -z \"$steam_library\" ]; then\n            steam_library=$(\"$CACHE/utils/find-library-for-appid.sh\" $game_appid)\n        fi\n\n        if [ ! -d \"$steam_library\" ]; then\n            \"$CACHE/utils/dialog.sh\" errorbox \\\n                \"Could not find '$game_steam_subdirectory' in your Steam library\"\n            exit 1\n        fi\n\n        game_prefix=\"$steam_library/steamapps/compatdata/$game_appid/pfx\"\n        game_installation=\"$steam_library/steamapps/common/$game_steam_subdirectory\"\n        game_tricks=\"$game_protontricks\"\n\n        echo -e \\\n        \"#!/bin/bash\\n\\n'$shared/proton-launcher.sh' $mo2_options $game_proton_options \\\"\\$@\\\" $game_appid '$GAMEDIR/ModOrganizer2/ModOrganizer.exe'\" \\\n        > \"$GAMEDIR/run.sh\"\n\n        echo -e \\\n        \"#!/bin/bash\\n\\n'$shared/proton-launcher.sh' $mo2_options $game_proton_options $game_appid '$GAMEDIR/ModOrganizer2/nxmhandler.exe' \\\"\\$1\\\"\" \\\n        > \"$GAMEDIR/download.sh\"\n        ;;\n\n    wine)\n        mo2_tricks=\"vcrun2019 dotnet40\"\n        mo2_options=\"--proton-wine --winever 5.*\"\n\n        \"$CACHE/utils/dialog.sh\" warnbox \\\n            \"As of version 5.7, Wine still does not fully support Mod Organizer 2.2.1 and later.\\nFor this reason this installer uses the Wine version bundled with Proton 5.0.\\nMake sure you have Steam and Proton 5.0 installed on your system\"\n\n        game_prefix=$( \\\n            \"$CACHE/utils/dialog.sh\" directorypicker \\\n                \"Inform the path to your wineprefix\" \\\n        )\n        if [ -z \"$game_prefix\" ]; then\n            echo \"ERROR: Installation canceled by user\" >&2\n            exit 1\n        fi\n\n        game_tricks=\"$game_winetricks\"\n\n        install_path_candidates=( \\\n            \"$game_prefix/drive_c/Program Files (x86)/Steam/steamapps/common/$game_steam_subdirectory\" \\\n            \"$game_prefix/drive_c/GOG Games/$game_steam_subdirectory\" \\\n        )\n        if [ -n \"$game_gog_subdirectory\" ]; then\n            install_path_candidates+=( \\\n                \"$game_prefix/drive_c/GOG Games/$game_gog_subdirectory\" \\\n            )\n        fi\n        if [ \"$nexus_game_id\" == \"fallout3\" ]; then\n            install_path_candidates+=( \\\n                \"$game_prefix/drive_c/Program Files (x86)/Steam/steamapps/common/Fallout 3\" \\\n                \"$game_prefix/drive_c/GOG Games/Fallout 3\" \\\n            )\n        fi\n\n        for path in \"${install_path_candidates[@]}\"; do\n            echo \"Searching for game at '$path'\"\n            if [ -d \"$path\" ]; then\n                echo \"Found game\"\n                game_installation=\"$path\"\n                break\n            fi\n        done\n\n        if [ -z \"$game_installation\" ]; then\n            game_installation=$( \\\n                \"$CACHE/utils/dialog.sh\" directorypicker \\\n                    \"Could not automatically find the game.\\nPlease inform the path where the game is installed\" \\\n            )\n            if [ -z \"$game_installation\" ]; then\n                echo \"ERROR: installation canceled by user\" >&2\n                exit 1\n            fi\n        fi\n\n        # TODO: uncomment once Wine fixes issues with VC2019\n        # winever=$( \\\n        #     \"$CACHE/utils/dialog.sh\" textentry \\\n        #         \"Inform which version of Wine you're using\\nLeave as * to use the latest version available on Lutris\" \\\n        #         \"*\" \\\n        # )\n        # if [ -z \"$winever\" ]; then\n        #     echo \"ERROR: Installation canceled by user\" >&2\n        #     exit 1\n        # fi\n\n        echo -e \\\n        \"#!/bin/bash\\n\\nWINEPREFIX='$game_prefix' '$shared/wine-launcher.sh' $mo2_options $game_wine_options \\\"\\$@\\\" '$GAMEDIR/ModOrganizer2/ModOrganizer.exe'\" \\\n        > \"$GAMEDIR/run.sh\"\n\n        echo -e \\\n        \"#!/bin/bash\\n\\nWINEPREFIX='$game_prefix' '$shared/wine-launcher.sh' $mo2_options $game_wine_options '$GAMEDIR/ModOrganizer2/nxmhandler.exe' \\\"\\$1\\\"\" \\\n        > \"$GAMEDIR/download.sh\"\n        ;;\nesac\n\nif [ -d \"$CACHE/${nexus_game_id}-script-extender\" ]; then\n    echo \"Installing script extender...\"\n\n    output=$( \\\n        cp -af \\\n        \"$CACHE/${nexus_game_id}-script-extender/.\" \\\n        \"$game_installation/\" 2>&1 \\\n    )\n    if [ \"$?\" != \"0\" ]; then\n        \"$CACHE/utils/dialog.sh\" errorbox \\\n            \"Error while installing script extender: $output\"\n        exit 1\n    fi\nfi\n\nmkdir -p \"$game_prefix/drive_c/java\"\noutput=$( \\\n    cp -af \\\n    \"$CACHE/extracted-openjdk/.\" \\\n    \"$game_prefix/drive_c/java/\" 2>&1 \\\n)\nif [ \"$?\" != \"0\" ]; then\n    \"$CACHE/utils/dialog.sh\" errorbox \\\n        \"Error while installing OpenJDK: $output\"\n    exit 1\nfi\n\nWINEPREFIX=\"$game_prefix\" \\\n\"$HOME/.local/share/lutris/runtime/winetricks/winetricks\" -q $mo2_tricks $game_tricks\nif [ \"$?\" != \"0\" ]; then\n    \"$CACHE/utils/dialog.sh\" errorbox \\\n        \"Error while installing winetricks, please run Lutris from a terminal and check the logs\"\n    exit 1\nfi\n\n# workaround to stop installation if command fails\necho \"success\" > '$CACHE/successful-prefix-preparation'\n",
          "env": {
            "CACHE": "$CACHE",
            "GAMEDIR": "$GAMEDIR"
          }
        }
      },
      {
        "move": {
          "dst": "$CACHE/successful-prefix-preparation-acknowledged",
          "src": "$CACHE/successful-prefix-preparation"
        }
      },
      {
        "chmodx": "$GAMEDIR/run.sh"
      },
      {
        "chmodx": "$GAMEDIR/download.sh"
      },
      {
        "extract": {
          "dst": "$GAMEDIR/ModOrganizer2/",
          "file": "mo_archive"
        }
      },
      {
        "execute": {
          "command": "mkdir -p '$HOME/.config/modorganizer2/instances'\nrm -f \"$HOME/.config/modorganizer2/instances/$INPUT_NEXUS_GAME_ID\"\nln -s '$GAMEDIR/' '$HOME/.config/modorganizer2/instances/$INPUT_NEXUS_GAME_ID'\n"
        }
      },
      {
        "write_file": {
          "content": 2,
          "file": "$HOME/.local/share/modorganizer2/installer_major_version.txt"
        }
      }
    ],
    "require-binaries": "zenity | xmessage | xterm",
    "system": {
      "disable_runtime": true
    }
  }
}
Back to game