Removed resource.h.
[wine.git] / tools / wineinstall
blob7f84041e99079042c3459acefa2132c352de9959
1 #!/bin/bash
2 # WINE Installation script
4 # Mar 31 1999 - Ove Kåven
5 # First version
7 # defaults
9 sysconfdir=/usr/local/etc
10 DOCONF=auto
11 DOREG=yes
13 # startup...
15 echo "WINE Installer v0.1"
16 echo
17 if ! [ -f configure ]
18 then {
19 echo "You're running this from the wrong directory."
20 echo "Change to the Wine directory and try again."
21 exit 1
25 # run the configure script, if necessary
27 if [ -f Makefile ] && [ Makefile -nt configure ]
28 then {
29 echo "I see that WINE has already been configured, so I'll skip that."
31 else {
32 # we'll run with defaults (we need libwine.a later)
33 echo "Running configure..."
34 echo
35 if ! ./configure
36 then {
37 echo
38 echo "Configure failed, aborting install."
39 rm -f config.cache
40 exit 1
43 # make sure X was found
44 if ! grep -qs "have_x=yes" config.cache
45 then {
46 echo "Install the X development headers and try again."
47 rm -f config.cache
48 exit 1
54 # now do the compilation
56 if [ -f wine ] && [ wine -nt Makefile ]
57 then {
58 echo "Hmm, looks like WINE is already compiled. I'll skip that too, I guess."
60 else {
61 echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever, in the meantime..."
62 echo
63 if ! { make depend && make; }
64 then {
65 echo
66 echo "Compilation failed, aborting install."
67 exit 1
70 echo
74 # and installation, if root
76 if [ `whoami` != 'root' ]
77 then {
78 echo "You aren't root, so I'll skip the make install."
80 else {
81 echo "Now installing binaries onto the system..."
82 echo
83 if ! make install
84 then {
85 echo
86 echo "Installation failed, aborting."
87 exit 1
92 echo
94 # now check whether we should generate wine.conf
95 if [ -z "$DOCONF" ]
96 then DOCONF=auto
99 if [ "$DOCONF" = 'auto' ]
100 then {
101 # see if we already have a system wine.conf
102 if [ -f $sysconfdir/wine.conf ] || [ -f /etc/wine.conf ]
103 then DOCONF=no
108 if [ "$DOCONF" != 'no' ]
109 then {
110 if [ `whoami` != 'root' ]
111 then {
112 CONF=~/.winerc
113 if ! [ -f $CONF ]
114 then {
115 if [ "$DOCONF" != 'yes' ]
116 then {
117 echo "Since you aren't root, and there's no system wine.conf, I assume"
118 echo "you want a user-specific .winerc. Am I correct? (yes/no)"
119 while [ "$DOCONF" != 'yes' ] && [ "$DOCONF" != 'no' ]
120 do read DOCONF
121 done
124 if [ "$DOCONF" = 'no' ]
125 then echo "Skipping generation of .winerc."
130 else {
131 CONF=$sysconfdir/wine.conf
132 mkdir -p $sysconfdir
133 DOCONF=yes
139 if [ "$DOCONF" = 'yes' ]
140 then {
141 echo "Now automatically generating $CONF for you..."
142 echo
143 tools/wineconf > $CONF
144 echo
145 echo "Done. You probably want to review the file, though."
148 echo
150 # install default registry entries
151 if [ "$DOREG" = 'yes' ]
152 then {
153 echo "Compiling regapi..."
154 echo
155 (cd programs/regapi; make)
156 echo
157 echo "Installing default registry entries, please wait..."
158 echo
159 if ! programs/regapi/regapi setValue < winedefault.reg
160 then {
161 echo
162 echo "Registry install failed. Perhaps you weren't running X."
167 echo
168 echo "Installation complete for now. Good luck (this is still alpha software)."
169 echo "If you have problems with WINE, please read the documentation first."