2 # WINE Installation script
4 # Mar 31 1999 - Ove Kåven
6 # Dec 9 1999 - Ove Kåven
8 # Feb 25 2000 - Ove Kåven
9 # auto-add /usr/local/lib to /etc/ld.so.conf
10 # Mar 2 2000 - Ove Kåven
11 # source rather than grep config.cache
12 # use sourced config.cache to start ldconfig
13 # reconfigure if config.cache doesn't exist
14 # Mar 30 2000 - Ove Kåven
15 # autoconfigure no-windows installs
16 # do not install registry on real-windows installs
17 # some support for binary package installs
18 # set and tell user about LD_LIBRARY_PATH if necessary
19 # set EXTRA_LD_LIBRARY_PATH in wine.conf
20 # Apr 9 2000 - Ove Kåven
21 # make root's registry global (system-default)
23 # defaults (change these if you are a packager)
24 CONFARGS
= # configure args, e.g. --prefix=/usr --sysconfdir=/etc
25 prefix
=/usr
/local # installation prefix
26 sysconfdir
=$prefix/etc
# where wine.conf and global registry is supposed to be
27 libdir
=$prefix/lib
# where libwine.so will be (or is) installed
28 exdir
=documentation
/samples
# where the example system.ini resides
29 CONF
=$sysconfdir/wine.conf
# default path of the wine.conf
30 BINDIST
=no
# whether called from a binary package config script
31 DOCONF
=auto
# whether to autogenerate wine.conf
32 DOWCHK
=auto
# whether to autoconfigure existing-windows installation
33 DOWINE
=auto
# whether to autoconfigure no-windows installation
34 DOREG
=auto
# whether to install default registry
35 SYSREG
=yes # whether to make root's registry global (system-default)
36 # elfdlls are not implemented yet, so this has no effect yet
37 DLLPATH
=$libdir/wine
# default path of the elfdll .so files
38 # only for existing-windows installs
39 WINECONF
=tools
/wineconf
# the path of wineconf perl script
40 # only for no-windows installs
41 WINEINI
=wine.ini
# the path of default wine.ini (also used by wineconf)
42 WININI
=/dev
/null
# the path of default win.ini
43 SYSTEMINI
=$exdir/system.ini
# the path of default system.ini
44 REGAPI
=programs
/regapi
/regapi
# the path of regapi winelib application
45 DEFREG
=winedefault.reg
# the path of the registry file to be fed to regapi
46 # CROOT=/var/wine # the path of the fake Drive C (asks user if not set)
50 echo "WINE Installer v0.3"
53 if [ "$BINDIST" = 'no' ]
58 echo "You're running this from the wrong directory."
59 echo "Change to the Wine directory and try again."
64 # run the configure script, if necessary
66 if [ -f config.cache
] && [ -f Makefile
] && [ Makefile
-nt configure
]
68 echo "I see that WINE has already been configured, so I'll skip that."
69 # load configure results
73 echo "Running configure..."
75 if ! .
/configure
$CONFARGS
78 echo "Configure failed, aborting install."
83 # load configure results
85 # make sure X was found
87 if [ "$have_x" != "yes" ]
89 echo "Install the X development headers and try again."
93 elif [ "$ac_cv_header_X11_xpm_h" != "yes" ]
95 echo "Install the Xpm development headers and try again."
103 # now do the compilation
105 if [ -f wine
] && [ wine
-nt Makefile
]
107 echo "Hmm, looks like WINE is already compiled. I'll skip that too, I guess."
110 echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever, in the meantime..."
112 if ! { make depend
&& make; }
115 echo "Compilation failed, aborting install."
123 # and installation, if root
125 if [ `whoami` != 'root' ]
127 echo "You aren't root, so I'll skip the make install."
128 # setup to run from current directory
130 if [ -z "$LD_LIBRARY_PATH" ]
131 then LD_LIBRARY_PATH
="$PWD:$DLLPATH"
132 else LD_LIBRARY_PATH
="$LD_LIBRARY_PATH:$PWD:$DLLPATH"
134 export LD_LIBRARY_PATH
136 echo "NOTE! To run Wine without installing, you must set the environment variable"
137 echo "LD_LIBRARY_PATH to $PWD:$DLLPATH"
138 echo "in your logon scripts."
141 echo "Now installing binaries onto the system..."
146 echo "Installation failed, aborting."
150 if [ -f /etc
/ld.so.conf
] && ! grep -qs "$libdir" /etc
/ld.so.conf
153 echo "$libdir didn't exist in your /etc/ld.so.conf, adding it now..."
154 echo "$libdir" >>/etc
/ld.so.conf
155 echo "Re-running ldconfig..."
156 eval "$ac_cv_path_LDCONFIG"
166 # now check whether we should generate wine.conf
171 if [ "$DOCONF" = 'auto' ]
173 # see if we already have a system wine.conf
180 if [ "$DOCONF" != 'no' ]
182 if [ `whoami` != 'root' ]
187 if [ "$DOCONF" != 'yes' ]
189 echo "Since you aren't root, and there's no system wine.conf, I assume"
190 echo "you want a user-specific .winerc. Am I correct? (yes/no)"
191 while [ "$DOCONF" != 'yes' ] && [ "$DOCONF" != 'no' ]
196 if [ "$DOCONF" = 'no' ]
198 echo "Aborting install. Try again as root to generate a system wine.conf."
214 # generate wine.conf from existing windows install, if any
215 if [ "$DOCONF" = 'yes' ]
217 if [ "$DOWCHK" = 'yes' ] ||
[ "$DOWCHK" = 'auto' ]
219 echo "Searching for an existing Windows installation..."
220 if ! $WINECONF > $CONF 2>/dev
/null
224 echo "Windows was not found on your system, so I assume you want a Wine-only installation."
225 echo "Am I correct? (yes/no)"
226 while [ "$DOWINE" != 'yes' ] && [ "$DOWINE" != 'no' ]
229 if [ "$DOWINE" = 'no' ]
231 echo "Aborting install. Make sure your Windows partition is mounted and try again,"
232 echo "or create $CONF manually by copying from $WINEINI and adapting the drive paths."
239 echo "Created $CONF using your existing Windows installation."
240 echo "You probably want to review the file, though."
246 elif [ "$DOWINE" = 'auto' ]
250 elif [ "$DOWINE" = 'auto' ]
254 # setup a no-windows installation, if necessary
255 if [ "$DOWINE" = 'yes' ]
257 if [ `whoami` != 'root' ]
261 echo "Configuring Wine without Windows. Some fake Windows directories must be created, to"
262 echo "hold any .ini files, DLLs, and start menu entries your applications may need to install."
263 while [ -z "$CROOT" ]
265 echo "Where would you like your fake C drive to be placed? (default is $DCROOT)"
272 if ! mkdir
-p "$CROOT"
279 echo "Configuring Wine for a no-windows install in $CROOT..."
280 for tdir
in "$CROOT/windows" "$CROOT/windows/system" "$CROOT/windows/Start Menu" "$CROOT/windows/Start Menu/Programs"
281 do [ -d "$tdir" ] || mkdir
"$tdir"
283 [ -f "$CROOT/windows/win.ini" ] ||
cp "$WININI" "$CROOT/windows/win.ini"
284 [ -f "$CROOT/windows/system.ini" ] ||
cp "$SYSTEMINI" "$CROOT/windows/system.ini"
285 if [ "$DOCONF" = 'yes' ]
287 sed "s/Path=\/c$/Path=${CROOT//\//\\/}/" $WINEINI > $CONF
288 echo "Created $CONF using default Wine configuration."
289 echo "You probably want to review the file, though."
292 # now we really need to install the registry
297 echo "Reading current Wine configuration from $CONF..."
298 CROOT
=`sed -n '/^\[Drive C\]$/,/^\[.*\]$/ s/^Path=\(.*\)/\1/p' $CONF`
299 echo "Drive C is configured at $CROOT."
304 # fixup EXTRA_LD_LIBRARY_PATH
305 if [ "$DOCONF" = 'yes' ]
307 echo "Setting EXTRA_LD_LIBRARY_PATH in .winerc to $DLLPATH..."
308 sed "s/EXTRA_LD_LIBRARY_PATH=.*/EXTRA_LD_LIBRARY_PATH=${DLLPATH//\//\\/}/" $CONF > $CONF.new
309 mv -f $CONF.new
$CONF
314 # check whether we need to install default registry
315 # (not to be done if windows registry exists)
316 if [ "$DOREG" = 'auto' ]
318 echo "Checking for real Windows registry..."
319 if [ -f "$CROOT/windows/system.dat" ]
321 elif [ -f "$CROOT/windows/system32/config/system" ]
325 if [ "$DOREG" = 'yes' ]
326 then echo "Not found, default Wine registry will be installed."
327 else echo "Windows registry found, will not install default Wine registry."
333 # install default registry entries
334 if [ "$DOREG" = 'yes' ]
336 if [ "$BINDIST" = 'no' ]
338 echo "Compiling regapi..."
340 (cd programs
/regapi
; make)
344 echo "Installing default Wine registry entries..."
346 if ! $REGAPI setValue
< $DEFREG > /dev
/null
349 echo "Registry install failed. Perhaps you weren't running X."
352 else echo "Registry entries successfully installed."
354 if [ "$SYSREG" = 'auto' ]
360 # make root's registry global, if desired
361 if [ `whoami` = 'root' ] && [ "$SYSREG" = 'yes' ]
363 if ! [ -f $sysconfdir/wine.userreg
]
365 echo "Linking root's user registry hive to the global registry..."
366 cp ~
/.wine
/wine.userreg
$sysconfdir/wine.userreg
367 ln -sf $sysconfdir/wine.userreg ~
/.wine
/wine.userreg
370 if ! [ -f $sysconfdir/wine.systemreg
]
372 echo "Linking root's system registry hive to the global registry..."
373 cp ~
/.wine
/system.reg
$sysconfdir/wine.systemreg
374 ln -sf $sysconfdir/wine.systemreg ~
/.wine
/system.reg
382 echo "Installation complete for now. Good luck (this is still alpha software)."
383 echo "If you have problems with WINE, please read the documentation first,"
384 echo "as many kinds of potential problems are explained there."