-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwine-libs.sh
More file actions
executable file
·95 lines (75 loc) · 1.62 KB
/
Copy pathwine-libs.sh
File metadata and controls
executable file
·95 lines (75 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env bash
action="$1"
arch="$2"
librarys=("xact" "d3d" "xinput")
target=()
PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
case "$action" in
list)
echo "${librarys[@]}"
exit 1
;;
install)
;;
uninstall)
;;
*)
echo "Unrecognized action: $action"
echo "Usage: $0 [install|uninstall] [64/32] lib1 lib2 ..."
echo "Usage: $0 list"
exit 1
esac
shift
case "$arch" in
32)
;;
64)
;;
*)
echo "Unrecognized Arch: $arch"
echo "Usage: $0 [install|uninstall] [64/32] lib1 lib2 ..."
exit 1
esac
shift
while (( $# > 0 )); do
if [[ " ${librarys[*]} " =~ " $1 " ]]; then
target+=($1)
else
echo "$1 is not exist"
exit 1
fi
shift
done
echo "install ${target[@]}"
if [ -n "$WINEPREFIX" ] && ! [ -f "$WINEPREFIX/system.reg" ]; then
echo "$WINEPREFIX:"' WINEPREFIX 不存在' >&2
exit 1
fi
export WINEDEBUG=-all
export WINEDLLOVERRIDES="mscoree,mshtml="
wine="wine"
wine64="wine64"
wineboot="wineboot"
install_wine_libs() {
echo "install from ${PATH} into ${WINEPREFIX}"
for libs in "${target[@]}"; do
/usr/bin/cp -vr ${PATH}/${arch}/${libs}/* ${WINEPREFIX}/drive_c/windows/system32
done
}
uninstall_wine_libs() {
echo "uninstall from ${PATH} into ${WINEPREFIX}"
files=()
for libs in "${target[@]}"; do
for file in "${PATH}/${arch}/${libs}"/*; do
files+=( "${file##*/}" )
done
done
for libs_files in "${files[@]}"; do
/usr/bin/rm -vr ${WINEPREFIX}/drive_c/windows/system32/${libs_files}
done
}
if [ "$action" == "install" ]; then
install_wine_libs
else
uninstall_wine_libs
fi