Pin the installer and filter spurious warnings
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{ lib
|
||||
, fetchurl
|
||||
, runCommand
|
||||
, writeShellScriptBin
|
||||
, makeDesktopItem
|
||||
@@ -15,6 +16,12 @@ let
|
||||
installDirWin = "C:\\Games\\EverQuestLegends";
|
||||
installDirUnix = "drive_c/Games/EverQuestLegends";
|
||||
|
||||
installer = fetchurl {
|
||||
name = "EQLegends_setup.exe";
|
||||
url = "https://launch.daybreakgames.com/installer/EQLegends_setup.exe";
|
||||
hash = "sha256-MFuIuPt/MlVzlCwiIGjjKkYT0Sm7ov5wm5Mrd1zfzx4=";
|
||||
};
|
||||
|
||||
setupDxvk = writeShellScriptBin "eqlegends-setup-dxvk" ''
|
||||
set -euo pipefail
|
||||
|
||||
@@ -47,32 +54,18 @@ let
|
||||
launcher_exe="$(cat "$launcher_path_file")"
|
||||
fi
|
||||
|
||||
find_installer() {
|
||||
if [ -n "''${EQL_INSTALLER:-}" ]; then
|
||||
printf '%s\n' "$EQL_INSTALLER"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -f "$PWD/EQLegends_setup.exe" ]; then
|
||||
printf '%s\n' "$PWD/EQLegends_setup.exe"
|
||||
return
|
||||
fi
|
||||
|
||||
printf '%s\n' ""
|
||||
}
|
||||
|
||||
if [ "''${EQL_RESET_PREFIX:-0}" = "1" ]; then
|
||||
echo "eqlegends: removing $WINEPREFIX"
|
||||
rm -rf "$WINEPREFIX"
|
||||
fi
|
||||
|
||||
if [ ! -f "$launcher_exe" ] || [ ! -f "$version_file" ] || [ "$(cat "$version_file" 2>/dev/null || true)" != "${setupVersion}" ]; then
|
||||
installer="$(find_installer)"
|
||||
if [ -z "$installer" ] || [ ! -f "$installer" ]; then
|
||||
installer_path="''${EQL_INSTALLER:-${installer}}"
|
||||
if [ ! -f "$installer_path" ]; then
|
||||
cat >&2 <<'EOF'
|
||||
eqlegends: missing EQLegends_setup.exe
|
||||
eqlegends: EQL_INSTALLER does not point to an existing file.
|
||||
|
||||
Run from the repository directory containing EQLegends_setup.exe, or set:
|
||||
Leave EQL_INSTALLER unset to use the pinned Daybreak installer, or set:
|
||||
|
||||
EQL_INSTALLER=/path/to/EQLegends_setup.exe nix run .#eqlegends
|
||||
EOF
|
||||
@@ -87,7 +80,7 @@ EOF
|
||||
wineserver -w
|
||||
|
||||
echo "eqlegends: installing EverQuest Legends LaunchPad with NSIS silent mode..."
|
||||
wine "$installer" /S "/D=${installDirWin}"
|
||||
wine "$installer_path" /S "/D=${installDirWin}"
|
||||
# The NSIS installer starts LaunchPad after extraction even in silent mode.
|
||||
# Stop that first instance so setup can finish and the wrapper can launch
|
||||
# the recorded executable itself.
|
||||
@@ -124,6 +117,16 @@ EOF
|
||||
fi
|
||||
|
||||
cd "$(dirname "$launcher_exe")"
|
||||
|
||||
if [ "''${EQL_FILTER_EGL_WARNINGS:-1}" = "1" ]; then
|
||||
exec wine "$launcher_exe" "$@" 2> >(
|
||||
sed \
|
||||
-e '/^libEGL warning: /d' \
|
||||
-e '/^pci id for fd [0-9][0-9]*: /d' \
|
||||
-e '/^$/d' >&2
|
||||
)
|
||||
fi
|
||||
|
||||
exec wine "$launcher_exe" "$@"
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user