-
Notifications
You must be signed in to change notification settings - Fork 0
/
w32.sh
34 lines (26 loc) · 933 Bytes
/
w32.sh
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
#!/usr/bin/env bash
#################################################
# run wine with 32-bit prefix on 64-bit systems #
#################################################
# set to absolute location where 32-bit WINE should run from
wine32dir="/home/${USER}/.wine32"
#---------------------------------------------------------------------------#
# check for WINE installation
if [ ! -f $(type -P wine) ] || [ ! -f $(type -P wine32) ]; then
echo "WINE doesn't seem to be installed. Please install it before"
echo "using this script."
echo
exit
fi
# check for WINE binary
if [ -f $(type -P wine) ]; then
wine32bin=$(type -P wine)
elif [ -f $(type -P wine32) ]; then
wine32bin=$(type -P wine32)
fi
# if 32-bit WINE prefix directory doesn't exist, create it
if [ ! -d "${wine32dir}" ]; then
mkdir -p "${wine32dir}"
fi
# run WINE in the 32-bit prefix directory
env WINEPREFIX="${wine32dir}" WINEARCH="win32" ${wine32bin} "$@"