1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00

[utils] Don't try to install or remove missing dlls

This commit is contained in:
Stelios Tsampas 2019-05-18 10:02:18 +03:00 committed by Philip Rebohle
parent 6a4fafba3d
commit 969aba16a7

View File

@ -50,6 +50,7 @@ if [ -z "$wine" ]; then
fi fi
wine64="${wine}64" wine64="${wine}64"
wineboot="${wine}boot"
# resolve 32-bit and 64-bit system32 path # resolve 32-bit and 64-bit system32 path
winever=`$wine --version | grep wine` winever=`$wine --version | grep wine`
@ -58,6 +59,10 @@ if [ -z "$winever" ]; then
exit 1 exit 1
fi fi
# ensure wine placeholder dlls are recreated
# if they are missing
$wineboot -u
win32_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null) win32_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null)
win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null) win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null)
@ -91,12 +96,12 @@ installFile() {
if [ -f "${srcfile}.so" ]; then if [ -f "${srcfile}.so" ]; then
srcfile="${srcfile}.so" srcfile="${srcfile}.so"
fi fi
if ! [ -f "${srcfile}" ]; then if ! [ -f "${srcfile}" ]; then
echo "${srcfile}: File not found" >&2 echo "${srcfile}: File not found. Skipping." >&2
exit 1 return 1
fi fi
if [ -n "$1" ]; then if [ -n "$1" ]; then
if [ -f "${dstfile}" ]; then if [ -f "${dstfile}" ]; then
if ! [ -f "${dstfile}.old" ]; then if ! [ -f "${dstfile}.old" ]; then
@ -107,31 +112,58 @@ installFile() {
$file_cmd "${srcfile}" "${dstfile}" $file_cmd "${srcfile}" "${dstfile}"
else else
echo "${dstfile}: File not found in wine prefix" >&2 echo "${dstfile}: File not found in wine prefix" >&2
exit 1 return 1
fi fi
fi fi
return 0
} }
# remove dxvk dll, restore original file # remove dxvk dll, restore original file
uninstallFile() { uninstallFile() {
dstfile="${1}/${2}.dll" 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
fi
if ! [ -f "${dstfile}" ];then
echo "${dstfile}: File not found. Skipping." >&2
return 1
fi
if [ -f "${dstfile}.old" ]; then if [ -f "${dstfile}.old" ]; then
rm "${dstfile}" rm "${dstfile}"
mv "${dstfile}.old" "${dstfile}" mv "${dstfile}.old" "${dstfile}"
return 0
else
return 1
fi fi
} }
install() { install() {
installFile "$win32_sys_path" "x32" "$1" installFile "$win32_sys_path" "x32" "$1"
inst32_ret="$?"
installFile "$win64_sys_path" "x64" "$1" installFile "$win64_sys_path" "x64" "$1"
overrideDll "$1" inst64_ret="$?"
if [ "$inst32_ret" -eq 0 ] || [ "$inst64_ret" -eq 0 ]; then
overrideDll "$1"
fi
} }
uninstall() { uninstall() {
uninstallFile "$win32_sys_path" "$1" uninstallFile "$win32_sys_path" "x32" "$1"
uninstallFile "$win64_sys_path" "$1" uninst32_ret="$?"
restoreDll "$1" uninstallFile "$win64_sys_path" "x64" "$1"
uninst64_ret="$?"
if [ "$uninst32_ret" -eq 0 ] || [ "$uninst64_ret" -eq 0 ]; then
restoreDll "$1"
fi
} }
# skip dxgi during install if not explicitly # skip dxgi during install if not explicitly