Skip to content

Commit

Permalink
Fix handling of nxm:// URLs for MO2 (#1082)
Browse files Browse the repository at this point in the history
* Fix handling of nxm:// URLs

It now writes the MO2*Conf files on each startup of MO2, and in addition to the
STEAM*/PROTON variables it will now also write MO2PFX, MO2WINE and MO2INST, so
that it can launch URLs in an MO2 instance launched by startMO2

* Updated PROGVERS

* Fixed check for MO2INST
  • Loading branch information
zerodogg authored Apr 14, 2024
1 parent 7199cf5 commit 109c6f3
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20240327-1"
PROGVERS="v14.0.20240415-1"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
Expand Down Expand Up @@ -17564,6 +17564,12 @@ function startMO2 {
mkProjDir "$PFXSUTEMP"
cd "${MO2EXE%/*}" >/dev/null || return

if [ -n "$MOINST" ] && [ "$MOINST" == "portable" ]; then
updateMO2PortConf
else
updateMO2GlobConf
fi

if [ -n "$MO2INST" ]; then
writelog "INFO" "${FUNCNAME[0]} - WINEDEBUG=\"-all\" WINEPREFIX=\"$MO2PFX\" \"$MO2WINE\" \"$MO2EXE\" -i \"$MO2INST\"" E
WINEDEBUG="-all" WINEPREFIX="$MO2PFX" "$MO2WINE" "$MO2EXE" -i "$MO2INST" 2>&1 | tee "$STLSHM/${FUNCNAME[0]}_${IFILE##*/}.log"
Expand Down Expand Up @@ -17620,6 +17626,16 @@ function dlMod2nexurl {
writelog "INFO" "${FUNCNAME[0]} - Starting portable '$RUNPROTON run ${MO}.exe $1'"
STEAM_COMPAT_CLIENT_INSTALL_PATH="$STEAM_COMPAT_CLIENT_INSTALL_PATH" STEAM_COMPAT_DATA_PATH="$STEAM_COMPAT_DATA_PATH" "$RUNPROTON" run "${MO}.exe" "$1" 2>&1 | tee /tmp/RUNMO2DL.log
cd - >/dev/null || return
elif [ -d "${GMO2EXE%/*}" ] && [ -n "$MO2PFX" ] && [ -n "$MO2WINE" ]; then
writelog "INFO" "${FUNCNAME[0]} - Download Url '$1' for game '$MONGURL' using data from portable '$MYPORTDLDAT'"
cd "${GMO2EXE%/*}" >/dev/null || return
writelog "INFO" "${FUNCNAME[0]} - Starting portable MO2 in prefix '$MO2PFX' using '$MO2WINE'"
if [ -n "$MO2INST" ]; then
WINEDEBUG="-all" WINEPREFIX="$MO2PFX" "$MO2WINE" "$GMO2EXE" -i "$MO2INST" "$1" 2>&1 | tee /tmp/RUNMO2DL.log
else
WINEDEBUG="-all" WINEPREFIX="$MO2PFX" "$MO2WINE" "$GMO2EXE" "$1" 2>&1 | tee /tmp/RUNMO2DL.log
fi
cd - >/dev/null || return
else
writelog "ERROR" "${FUNCNAME[0]} - Attempted to download Url '$1' for game '$MONGURL', but seems like portable '$MYPORTDLDAT' has incomplete data - trying global $MO" "E"
dlMod2globnexurl "$1"
Expand Down Expand Up @@ -19744,8 +19760,11 @@ function updateMO2PortConf {
writelog "INFO" "${FUNCNAME[0]} - Updating '$MYPORTDLDAT' with up to date data"

{
echo "GMO2EXE=\"$GMO2EXE\""
echo "GMO2EXE=\"$MO2EXE\""
echo "RUNPROTON=\"$RUNPROTON\""
echo "MO2PFX=\"$MO2PFX\""
echo "MO2WINE=\"$MO2WINE\""
echo "MO2INST=\"$MO2INST\""
echo "STEAM_COMPAT_CLIENT_INSTALL_PATH=\"$STEAM_COMPAT_CLIENT_INSTALL_PATH\""
echo "STEAM_COMPAT_DATA_PATH=\"$STEAM_COMPAT_DATA_PATH\""
} > "$MYPORTDLDAT"
Expand Down

0 comments on commit 109c6f3

Please sign in to comment.