Fixed allocation of 16x16 icons.
[wine.git] / tools / wineinstall
blob3bf502a04c4986a4e511aa258c68f2e1bdcbe00d
1 #!/bin/bash
2 # WINE Installation script
4 # Mar 31 1999 - Ove Kåven
5 # First version
6 # Dec 9 1999 - Ove Kåven
7 # require Xpm
8 # Feb 25 2000 - Ove Kåven
9 # auto-add /usr/local/lib to /etc/ld.so.conf
11 # defaults
13 sysconfdir=/usr/local/etc
14 DOCONF=auto
15 DOREG=yes
17 # startup...
19 echo "WINE Installer v0.2"
20 echo
21 if ! [ -f configure ]
22 then {
23 echo "You're running this from the wrong directory."
24 echo "Change to the Wine directory and try again."
25 exit 1
29 # run the configure script, if necessary
31 if [ -f Makefile ] && [ Makefile -nt configure ]
32 then {
33 echo "I see that WINE has already been configured, so I'll skip that."
35 else {
36 # we'll run with defaults (we need libwine.a later)
37 echo "Running configure..."
38 echo
39 if ! ./configure
40 then {
41 echo
42 echo "Configure failed, aborting install."
43 rm -f config.cache
44 exit 1
47 # make sure X was found
48 if ! grep -qs "have_x=yes" config.cache
49 then {
50 echo "Install the X development headers and try again."
51 rm -f config.cache
52 exit 1
54 elif ! grep -qs "xpm_h=yes" config.cache
55 then {
56 echo "Install the Xpm development headers and try again."
57 rm -f config.cache
58 exit 1
64 # now do the compilation
66 if [ -f wine ] && [ wine -nt Makefile ]
67 then {
68 echo "Hmm, looks like WINE is already compiled. I'll skip that too, I guess."
70 else {
71 echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever, in the meantime..."
72 echo
73 if ! { make depend && make; }
74 then {
75 echo
76 echo "Compilation failed, aborting install."
77 exit 1
80 echo
84 # and installation, if root
86 if [ `whoami` != 'root' ]
87 then {
88 echo "You aren't root, so I'll skip the make install."
90 else {
91 echo "Now installing binaries onto the system..."
92 echo
93 if ! make install
94 then {
95 echo
96 echo "Installation failed, aborting."
97 exit 1
100 if [ -f /etc/ld.so.conf ] && ! grep -qs "/usr/local/lib" /etc/ld.so.conf
101 then {
102 echo
103 echo "/usr/local/lib didn't exist in your /etc/ld.so.conf, adding it now..."
104 echo /usr/local/lib >>/etc/ld.so.conf
105 echo "Re-running ldconfig..."
106 ldconfig
111 echo
113 # now check whether we should generate wine.conf
114 if [ -z "$DOCONF" ]
115 then DOCONF=auto
118 if [ "$DOCONF" = 'auto' ]
119 then {
120 # see if we already have a system wine.conf
121 if [ -f $sysconfdir/wine.conf ] || [ -f /etc/wine.conf ]
122 then DOCONF=no
127 if [ "$DOCONF" != 'no' ]
128 then {
129 if [ `whoami` != 'root' ]
130 then {
131 CONF=~/.winerc
132 if ! [ -f $CONF ]
133 then {
134 if [ "$DOCONF" != 'yes' ]
135 then {
136 echo "Since you aren't root, and there's no system wine.conf, I assume"
137 echo "you want a user-specific .winerc. Am I correct? (yes/no)"
138 while [ "$DOCONF" != 'yes' ] && [ "$DOCONF" != 'no' ]
139 do read DOCONF
140 done
143 if [ "$DOCONF" = 'no' ]
144 then echo "Skipping generation of .winerc."
149 else {
150 CONF=$sysconfdir/wine.conf
151 mkdir -p $sysconfdir
152 DOCONF=yes
158 if [ "$DOCONF" = 'yes' ]
159 then {
160 echo "Now automatically generating $CONF for you..."
161 echo
162 tools/wineconf > $CONF
163 echo
164 echo "Done. You probably want to review the file, though."
167 echo
169 # install default registry entries
170 if [ "$DOREG" = 'yes' ]
171 then {
172 echo "Compiling regapi..."
173 echo
174 (cd programs/regapi; make)
175 echo
176 echo "Installing default registry entries, please wait..."
177 echo
178 if ! programs/regapi/regapi setValue < winedefault.reg
179 then {
180 echo
181 echo "Registry install failed. Perhaps you weren't running X."
182 exit 1
185 # FIXME: perhaps install registry to $sysconfdir/winesystem.reg and $sysconfdir/wineuser.reg?
188 echo
189 echo "Installation complete for now. Good luck (this is still alpha software)."
190 echo "If you have problems with WINE, please read the documentation first."