mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-29 00:20:21 +00:00
e6e63307fd
On Linux, MultiMC's startup script will now look for plugins with missing depenedencies and warn the user about them if they are missing.
34 lines
911 B
Bash
Executable File
34 lines
911 B
Bash
Executable File
#!/bin/sh
|
|
# Basic start script for running MultiMC with the libs packaged with it.
|
|
|
|
MMC_DIR=`dirname "$0"`
|
|
cd "${MMC_DIR}"
|
|
echo "MultiMC Dir: ${MMC_DIR}"
|
|
|
|
# Set up env
|
|
export LD_LIBRARY_PATH="${MMC_DIR}/bin":$LD_LIBRARY_PATH
|
|
export QT_PLUGIN_PATH="${MMC_DIR}/plugins"
|
|
export QT_FONTPATH="${MMC_DIR}/fonts"
|
|
|
|
# Detect missing dependencies...
|
|
DEPS_LIST=`ldd "${MMC_DIR}"/plugins/*/*.so | grep "not found" | awk -vORS=", " '{ print $1 }'`
|
|
if [ -z $DEPS_LIST ]; then
|
|
# We have all our dependencies. Run MultiMC.
|
|
echo "No missing dependencies found."
|
|
|
|
# Just to be sure...
|
|
chmod +x "${MMC_DIR}/bin/MultiMC"
|
|
|
|
# Run MultiMC
|
|
"${MMC_DIR}/bin/MultiMC" -d "${MMC_DIR}" $@
|
|
|
|
# Exit with MultiMC's exit code.
|
|
exit $?
|
|
else
|
|
echo "Error: MultiMC is missing the following libraries that it needs to work correctly:"
|
|
echo "\t${DEPS_LIST}"
|
|
echo "Please install them from your distribution's package manager."
|
|
exit 1
|
|
fi
|
|
|