I'm aware of this, but I don't think this can be fixed because the trick the old script used to determine its own location doesn't work here, as it'll point to the directory where winetricks itself is located.
How about this?
w_metadata setup_dxvk dlls \
title="DXVK" \
publisher="Philip Rebohle" \
year="2018" \
media="manual_download" \
file1="dxgi.dll" \
file2="d3d11.dll" \
file3="d3d10.dll" \
file4="d3d10_1.dll" \
file5="d3d10core.dll" \
installed_file1="$W_SYSTEM32_DLLS_WIN/dxgi.dll" \
installed_file2="$W_SYSTEM32_DLLS_WIN/d3d11.dll" \
installed_file3="$W_SYSTEM32_DLLS_WIN/d3d10.dll" \
installed_file4="$W_SYSTEM32_DLLS_WIN/d3d10_1.dll" \
installed_file5="$W_SYSTEM32_DLLS_WIN/d3d10core.dll" \
homepage="https://github.com/doitsujin/dxvk"
DXVK_VERBDIR=`dirname "$(readlink -f $1)"`
load_setup_dxvk()
{
echo "================================================================="
echo DXVK_VERBDIR: $DXVK_VERBDIR
echo "================================================================="
if [ ! -d "$DXVK_VERBDIR/x32" ]; then
(>&2 echo "x32 directory not found.")
exit 1
fi
if [ ! -d "$DXVK_VERBDIR/x64" ]; then
(>&2 echo "x64 directory not found.")
exit 1
fi
for f in "$file1" "$file2" "$file3" "$file4" "$file5"; do
w_try cp "$DXVK_VERBDIR/x32/$f" "$W_SYSTEM32_DLLS/$f"
done
if [ "$W_ARCH" = "win64" ]; then
dxvk64_dir="/usr/lib64/wine/dxvk"
for f in "$file1" "$file2" "$file3" "$file4" "$file5"; do
w_try cp "$DXVK_VERBDIR/x64/$f" "$W_SYSTEM64_DLLS/$f"
done
fi
w_override_dlls native \
dxgi \
d3d11 \
d3d10 \
d3d10_1 \
d3d10core
}
Setting DXVK_VERBDIR outside of load_setup_dxvk can detect the path of the verb file from the parameters. For me it's always $1, no matter of the other parameters like force.
I'm not an expert with shell scripting or familiar with the winetricks environment, there may be better error handling than echo and exit 1.
This looks like a hack that might break with a winetricks update, but let's hope it doesn't. Fixed in latest master, and since this only affects the verb I'll update the release as well.
This is a major problem as winetricks is still failing the issue from 2015: https://github.com/Winetricks/winetricks/issues/163
DXVK_VERBDIRx1 2018-08DXVK_VERBDIR=`dirnamex1 2018-08WINEPREFIXx1 2018-08d3d10.dllx1 2018-08d3d10_1.dllx1 2018-08d3d10core.dllx1 2018-08d3d11.dllx1 2018-08dxgi.dllx1 2018-08
The old
setup_dxvk.shworked from everywhere. I could cd into my prefix, set my WINEPREFIX to CWD, and then I could just run the setup script with absolute path.With the winetricks verb the working directory must be the downloaded directory where "x32" and "x64" can be accessed relatively.
Maybe the verb script could detect the source folder from the parameters, so it can be used with absolute path?