1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 05:52:11 +01:00
dxvk/wine_utils/setup_dxvk.sh.in
Philip Rebohle 26ef59dd6f
[d3d11] dlls_setup.sh -> setup_dxvk.sh
Also, the install script no longer relies on the prefix
being set by the Meson configuration.
2018-02-05 11:58:49 +01:00

72 lines
1.6 KiB
Bash

#!/bin/bash
export WINEDEBUG=-all
dlls_dir=`dirname $(readlink -f $0)`
build_arch='@arch@'
if [ ! -f "$dlls_dir/d3d11.dll" ] || [ ! -f "$dlls_dir/dxgi.dll" ]; then
echo "d3d11.dll or dxgi.dll not found in $dlls_dir"
exit 1
fi
if [ $build_arch == "x86_64" ]; then
wine=wine64
else
wine=wine
fi
if [ -z "$WINEPREFIX" ]; then
echo "WINEPREFIX is not set, continue? (y/N)"
read continue
if [ "$continue" != "y" ] && [ "$continue" != "Y" ]; then
exit 1
fi
fi
unix_sys_path="$($wine winepath -u 'C:\windows\system32')"
function removeOverride {
echo "$1:"
echo -n ' [1/2] Removing override... '
wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d builtin /f
if [ ! $? ]; then
exit 1
fi
local dll="$unix_sys_path/$1.dll"
echo -n ' [2/2] Removing link... '
if [ -h "$dll" ]; then
rm "$dll"
if [ "$?" == "0" ]; then
echo "Done."
fi
else
echo "'$dll' is not a link or doesn't exist."
fi
}
function createOverride {
echo "$1:"
echo -n ' [1/2] Creating override... '
wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d native /f
echo -n " [2/2] Creating link to $1.dll... "
ln -sf "$dlls_dir/$1.dll" "$unix_sys_path/$1.dll"
if [ $? ]; then
echo "Done."
fi
}
if [ "$1" == "reset" ]; then
echo -n '[1/2] '
removeOverride d3d11
echo -n '[2/2] '
removeOverride dxgi
elif [ -z "$1" ]; then
echo -n '[1/2] '
createOverride d3d11
echo -n '[2/2] '
createOverride dxgi
else
echo "Unrecognized option: $1"
echo "Usage: $0 [reset]"
exit 1
fi