Initialize the output buffer parameters to 0 in RegQueryValue*
[wine.git] / tools / wineinstall
blobf3c46fb5c32482eafc6e1421f53d2e964ba6882b
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 DOCONF=yes
138 if [ "$DOCONF" = 'yes' ]
139 then {
140 echo "Now automatically generating $CONF for you..."
141 echo
142 tools/wineconf > $CONF
143 echo
144 echo "Done. You probably want to review the file, though."
147 echo
149 # install default registry entries
150 if [ "$DOREG" = 'yes' ]
151 then {
152 echo "Compiling regapi..."
153 echo
154 (cd programs/regapi; make)
155 echo
156 echo "Installing default registry entries, please wait..."
157 echo
158 if ! programs/regapi/regapi setValue < winedefault.reg
159 then {
160 echo
161 echo "Registry install failed. Perhaps you weren't running X."
166 echo
167 echo "Installation complete for now. Good luck (this is still alpha software)."
168 echo "If you have problems with WINE, please read the documentation first."