blob: cfe0a85986582a006b702d2861d0491004814ec8 (
plain)
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
|
#!/bin/sh
WINEPREFIX=$HOME/.deepinwine/qqintl
APPDIR=/opt/deepinwine/qqintl
EXECUTE=$WINEPREFIX/drive_c/Program\ Files/Tencent/QQIntl/Bin/QQ.exe
APPTAR=QQIntl.tar.gz
WINEDIR=/usr
PACKAGENAME=Deepinwine-QQIntl
helpapp()
{
echo " Commands:"
echo " -r/--reinstall Fix error or reinstall $PACKAGENAME"
echo " -k/--kill Kill wine progrem"
echo " -e/--regedit Start regedit editor"
echo " -c/--winecfg Start winecfg to tweak wine environment"
echo " -h/--help Program help info"
}
reinstallapp()
{
echo "Reinstall $PACKAGENAME....."
read -p "* Are you sure?(Y/N)" ANSWER
if [ "$ANSWER" = "Y" -o "$ANSWER" = "y" -o -z $ANSWER ];then
rm -r $WINEPREFIX
installapp
else
exit 0
fi
}
installapp()
{
echo "Install $PACKAGENAME....."
if [ -e $WINEPREFIX ];then
echo "PACKAGE had installed,If has trouble, Please use --reinstall(-r) to reinstall $PACKAGENAME"
else
mkdir -p $WINEPREFIX
tar -xzf $APPDIR/$APPTAR -C $WINEPREFIX
env WINEPREFIX=$WINEPREFIX $WINEDIR/bin/wine "$EXECUTE"
fi
}
runapp()
{
if [ -e $WINEPREFIX ];then
env WINEPREFIX=$WINEPREFIX $WINEDIR/bin/wine "$EXECUTE"
else
installapp
fi
}
case $1 in
"--reinstall"| "-r")
reinstallapp
;;
"--kill"| "-k")
env WINEPREFIX=$WINEPREFIX $WINEDIR/bin/wineserver -k
;;
"--regedit"| "-e")
env WINEPREFIX=$WINEPREFIX $WINEDIR/bin/regedit
;;
"--winecfg"| "-c")
env WINEPREFIX=$WINEPREFIX $WINEDIR/bin/winecfg
;;
"--help"| "-h")
helpapp
;;
*)
if [ -z $1 ];then
runapp
else
echo "Invalid option: $1"
fi
;;
esac
|