summarylogtreecommitdiffstats
path: root/setup_dxvk.sh
diff options
context:
space:
mode:
authorStelios Tsampas2024-01-25 17:53:17 +0200
committerStelios Tsampas2024-01-25 17:53:17 +0200
commit3854b705ba930b0e8ffb5a97ce081f0be3ff7946 (patch)
tree0fd5b4833c3b3051855376ae988726c88558d132 /setup_dxvk.sh
parent46ce08c73513b245ff169286c7407a61092d286f (diff)
downloadaur-3854b705ba930b0e8ffb5a97ce081f0be3ff7946.tar.gz
[dxvk,dxvk-nvapi,vkd3d-proton,d8vk] Update setup script
Diffstat (limited to 'setup_dxvk.sh')
-rw-r--r--setup_dxvk.sh38
1 files changed, 18 insertions, 20 deletions
diff --git a/setup_dxvk.sh b/setup_dxvk.sh
index 0f1998f30d99..a45002f3c611 100644
--- a/setup_dxvk.sh
+++ b/setup_dxvk.sh
@@ -68,21 +68,24 @@ if ! [ -f "$wine_path/$wine" ]; then
fi
# resolve 32-bit and 64-bit system32 path
-winever=$($wine --version | grep wine)
+winever="$($wine --version | grep wine)"
if [ -z "$winever" ]; then
- echo "$wine:"' Not a wine executable. Check your $wine.' >&2
- exit 1
+ echo "$wine:"' Not a wine executable. Check your $wine.' >&2
+ exit 1
fi
# ensure wine placeholder dlls are recreated
# if they are missing
$wineboot -u
-win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null)
+win64_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null)
win64_sys_path="${win64_sys_path/$'\r'/}"
-if $wow64; then
- win32_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null)
- win32_sys_path="${win32_sys_path/$'\r'/}"
+win32_sys_path=$($wine winepath -u 'C:\windows\syswow64' 2> /dev/null)
+win32_sys_path="${win32_sys_path/$'\r'/}"
+
+# if syswow64 for the prefix doesn't exist, treat it as a win32 prefix
+if ! [ -d "$win32_sys_path" ]; then
+ win32_sys_path="$win64_sys_path"
fi
if [ -z "$win32_sys_path" ] && [ -z "$win64_sys_path" ]; then
@@ -92,7 +95,7 @@ fi
# create native dll override
overrideDll() {
- $wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d native /f >/dev/null 2>&1
+ $wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /d native /f >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "Failed to add override for $1"
exit 1
@@ -101,7 +104,7 @@ overrideDll() {
# remove dll override
restoreDll() {
- $wine reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /f > /dev/null 2>&1
+ $wine reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /f > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Failed to remove override for $1"
fi
@@ -112,10 +115,6 @@ installFile() {
dstfile="${1}/${3}.dll"
srcfile="${basedir}/${2}/${3}.dll"
- if [ -f "${srcfile}.so" ]; then
- srcfile="${srcfile}.so"
- fi
-
if ! [ -f "${srcfile}" ]; then
echo "${srcfile}: File not found. Skipping." >&2
return 1
@@ -128,11 +127,10 @@ installFile() {
else
rm -v "${dstfile}"
fi
- $file_cmd "${srcfile}" "${dstfile}"
else
- echo "${dstfile}: File not found in wine prefix" >&2
- return 1
+ touch "${dstfile}.old_none"
fi
+ $file_cmd "${srcfile}" "${dstfile}"
fi
return 0
}
@@ -142,10 +140,6 @@ uninstallFile() {
dstfile="${1}/${3}.dll"
srcfile="${basedir}/${2}/${3}.dll"
- if [ -f "${srcfile}.so" ]; then
- srcfile="${srcfile}.so"
- fi
-
if ! [ -f "${srcfile}" ]; then
echo "${srcfile}: File not found. Skipping." >&2
return 1
@@ -160,6 +154,10 @@ uninstallFile() {
rm -v "${dstfile}"
mv -v "${dstfile}.old" "${dstfile}"
return 0
+ elif [ -f "${dstfile}.old_none" ]; then
+ rm -v "${dstfile}.old_none"
+ rm -v "${dstfile}"
+ return 0
else
return 1
fi