Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # WINE Installation script |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 3 | # Can do almost everything from compiling to configuring... |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 4 | |
| 5 | # Mar 31 1999 - Ove Kåven |
| 6 | # First version |
Ove Kaaven | b822b84 | 2000-02-25 20:51:09 +0000 | [diff] [blame] | 7 | # Dec 9 1999 - Ove Kåven |
| 8 | # require Xpm |
| 9 | # Feb 25 2000 - Ove Kåven |
| 10 | # auto-add /usr/local/lib to /etc/ld.so.conf |
Ove Kaaven | ce2b724 | 2000-03-04 19:13:52 +0000 | [diff] [blame] | 11 | # Mar 2 2000 - Ove Kåven |
| 12 | # source rather than grep config.cache |
| 13 | # use sourced config.cache to start ldconfig |
| 14 | # reconfigure if config.cache doesn't exist |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 15 | # Mar 30 2000 - Ove Kåven |
| 16 | # autoconfigure no-windows installs |
| 17 | # do not install registry on real-windows installs |
| 18 | # some support for binary package installs |
| 19 | # set and tell user about LD_LIBRARY_PATH if necessary |
| 20 | # set EXTRA_LD_LIBRARY_PATH in wine.conf |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 21 | # Apr 9 2000 - Ove Kåven |
| 22 | # make root's registry global (system-default) |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 23 | # May 9 2000 - Ove Kåven |
| 24 | # use ttydrv when running regapi, so we don't have to run from X |
| 25 | # change debugger path in registry |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 26 | # Oct 29 2000 - Ove Kåven |
| 27 | # added --enable-opengl to default confargs |
| 28 | # added conf_question, conf_yesno_answer, and conf_string_answer functions |
| 29 | # added DEFCAT variable |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 30 | # (later that day...) |
| 31 | # added conf_reset_question function |
| 32 | # added file existence checks to the registry copying |
| 33 | # fixed problem with no-windows directory creation |
| 34 | # some text reformatting from Eric Maryniak |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 35 | |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 36 | #--- defaults (change these if you are a packager) |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 37 | CONFARGS=--enable-opengl # configure args, e.g. --prefix=/usr --sysconfdir=/etc |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 38 | prefix=/usr/local # installation prefix |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 39 | sysconfdir=$prefix/etc # where wine.conf and global registry is supposed to be |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 40 | bindir=$prefix/bin # where winelib apps will be (or is) installed |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 41 | libdir=$prefix/lib # where libwine.so will be (or is) installed |
| 42 | exdir=documentation/samples # where the example system.ini resides |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 43 | CONF=$sysconfdir/wine.conf # default path of the wine.conf |
| 44 | BINDIST=no # whether called from a binary package config script |
| 45 | DOCONF=auto # whether to autogenerate wine.conf |
| 46 | DOWCHK=auto # whether to autoconfigure existing-windows installation |
| 47 | DOWINE=auto # whether to autoconfigure no-windows installation |
| 48 | DOREG=auto # whether to install default registry |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 49 | SYSREG=yes # whether to make root's registry global (system-default) |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 50 | |
| 51 | # "make install" still installs the dlls into $libdir, but this may change in the future |
| 52 | # (DLLPATH should point to them if/when they are not in standard ld.so paths) |
| 53 | DLLPATH=$libdir/wine # default path of the dll .so files (except libwine.so) |
| 54 | |
| 55 | # having the Wine debugger launched automatically will be a plus for us |
| 56 | DEBUGGER=$bindir/winedbg # the (installed) path of winedbg |
| 57 | HDEBUGGER=debugger/winedbg # the (non-installed) path of winedbg |
| 58 | |
| 59 | # this is only for existing-windows installs |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 60 | WINECONF=tools/wineconf # the path of wineconf perl script |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 61 | |
| 62 | # this is only for no-windows installs |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 63 | WINEINI=wine.ini # the path of default wine.ini (also used by wineconf) |
| 64 | WININI=/dev/null # the path of default win.ini |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 65 | SYSTEMINI=$exdir/system.ini # the path of default system.ini |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 66 | REGAPI=programs/regapi/regapi # the path of regapi winelib application |
| 67 | DEFREG=winedefault.reg # the path of the registry file to be fed to regapi |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 68 | # CROOT=/var/wine # the path of the fake Drive C (asks user if not set) |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 69 | DEFCAT=cat # program to cat $DEFREG with (some packages need zcat) |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 70 | #--- end of defaults |
| 71 | |
| 72 | # temporary files used by the installer |
| 73 | TMPCONF=/tmp/wineinstall.conf |
| 74 | TMPREG=/tmp/wineinstall.reg |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 75 | |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 76 | # functions |
| 77 | |
| 78 | function conf_question { |
| 79 | # parameters: $1 = importance, $2 = question-id, $3+ = message lines |
| 80 | # the first two parameters can be used by e.g. debconf in debian packages |
| 81 | # but here we just print the message |
| 82 | shift 2 |
| 83 | echo |
| 84 | local LINE="$1" |
| 85 | while shift |
| 86 | do { |
| 87 | echo "$LINE" |
| 88 | LINE="$1" |
| 89 | } |
| 90 | done |
| 91 | } |
| 92 | |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 93 | function conf_reset_question { |
| 94 | # parameters: $1 = question-id |
| 95 | # this is used to flush any cached answers and "already-displayed" flags |
| 96 | shift # dummy command |
| 97 | } |
| 98 | |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 99 | function conf_yesno_answer { |
| 100 | unset ANSWER |
| 101 | while [ "$ANSWER" != 'yes' ] && [ "$ANSWER" != 'no' ] |
| 102 | do { |
| 103 | echo -n "$1" |
| 104 | read ANSWER |
| 105 | } |
| 106 | done |
| 107 | } |
| 108 | |
| 109 | function conf_string_answer { |
| 110 | echo -n "$1" |
| 111 | read ANSWER |
| 112 | } |
| 113 | |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 114 | # startup... |
| 115 | |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 116 | echo "WINE Installer v0.5" |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 117 | echo |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 118 | |
| 119 | if [ "$BINDIST" = 'no' ] |
| 120 | then { |
| 121 | |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 122 | if ! [ -f configure ] |
| 123 | then { |
| 124 | echo "You're running this from the wrong directory." |
Andreas Mohr | 8724ea8 | 2000-11-25 01:23:32 +0000 | [diff] [blame] | 125 | echo "Change to the Wine source's main directory and try again." |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 126 | exit 1 |
| 127 | } |
| 128 | fi |
| 129 | |
Andreas Mohr | 8bba9ba | 2000-08-28 21:32:08 +0000 | [diff] [blame] | 130 | # check whether RPM installed, and if it is, remove any old wine rpm. |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 131 | hash rpm &>/dev/null |
| 132 | RET=$? |
Andreas Mohr | 8bba9ba | 2000-08-28 21:32:08 +0000 | [diff] [blame] | 133 | if [ $RET -eq 0 ]; then |
| 134 | if [ -n "`rpm -qi wine 2>/dev/null|grep "^Name"`" ]; then |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 135 | echo "Warning: Old Wine RPM install detected. Do you want to remove it first?" |
| 136 | conf_yesno_answer "(yes/no) " |
| 137 | if [ "$ANSWER" = 'yes' ]; then |
Andreas Mohr | 8bba9ba | 2000-08-28 21:32:08 +0000 | [diff] [blame] | 138 | echo Starting wine rpm removal... |
| 139 | rpm -e wine; RET=$? |
| 140 | if [ $RET -eq 0 ]; then |
| 141 | echo Done. |
| 142 | else |
Phil Cole | a7c48b1 | 2000-08-31 02:07:07 +0000 | [diff] [blame] | 143 | echo "FAILED. Probably you aren't installing as root." |
Andreas Mohr | 8724ea8 | 2000-11-25 01:23:32 +0000 | [diff] [blame] | 144 | echo "Expect problems (library conflicts with existing install etc.)." |
Andreas Mohr | 8bba9ba | 2000-08-28 21:32:08 +0000 | [diff] [blame] | 145 | fi |
| 146 | else |
| 147 | echo "Sorry, I won't install Wine when an rpm version is still installed." |
| 148 | echo "(Wine support suffered from way too many conflicts)" |
| 149 | echo "Have a nice day !" |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 150 | exit 1 |
Andreas Mohr | 8bba9ba | 2000-08-28 21:32:08 +0000 | [diff] [blame] | 151 | fi |
| 152 | fi |
| 153 | fi |
| 154 | |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 155 | # run the configure script, if necessary |
| 156 | |
Ove Kaaven | ce2b724 | 2000-03-04 19:13:52 +0000 | [diff] [blame] | 157 | if [ -f config.cache ] && [ -f Makefile ] && [ Makefile -nt configure ] |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 158 | then { |
| 159 | echo "I see that WINE has already been configured, so I'll skip that." |
Ove Kaaven | ce2b724 | 2000-03-04 19:13:52 +0000 | [diff] [blame] | 160 | # load configure results |
| 161 | . ./config.cache |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 162 | } |
| 163 | else { |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 164 | echo "Running configure..." |
| 165 | echo |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 166 | if ! ./configure $CONFARGS |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 167 | then { |
| 168 | echo |
| 169 | echo "Configure failed, aborting install." |
| 170 | rm -f config.cache |
| 171 | exit 1 |
| 172 | } |
| 173 | fi |
Ove Kaaven | ce2b724 | 2000-03-04 19:13:52 +0000 | [diff] [blame] | 174 | # load configure results |
| 175 | . ./config.cache |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 176 | # make sure X was found |
Ove Kaaven | ce2b724 | 2000-03-04 19:13:52 +0000 | [diff] [blame] | 177 | eval "$ac_cv_have_x" |
| 178 | if [ "$have_x" != "yes" ] |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 179 | then { |
| 180 | echo "Install the X development headers and try again." |
| 181 | rm -f config.cache |
| 182 | exit 1 |
| 183 | } |
Ove Kaaven | ce2b724 | 2000-03-04 19:13:52 +0000 | [diff] [blame] | 184 | elif [ "$ac_cv_header_X11_xpm_h" != "yes" ] |
Ove Kaaven | b822b84 | 2000-02-25 20:51:09 +0000 | [diff] [blame] | 185 | then { |
| 186 | echo "Install the Xpm development headers and try again." |
| 187 | rm -f config.cache |
| 188 | exit 1 |
| 189 | } |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 190 | fi |
| 191 | } |
| 192 | fi |
| 193 | |
| 194 | # now do the compilation |
| 195 | |
| 196 | if [ -f wine ] && [ wine -nt Makefile ] |
| 197 | then { |
| 198 | echo "Hmm, looks like WINE is already compiled. I'll skip that too, I guess." |
| 199 | } |
| 200 | else { |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 201 | echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever," |
| 202 | echo "in the meantime..." |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 203 | echo |
| 204 | if ! { make depend && make; } |
| 205 | then { |
| 206 | echo |
| 207 | echo "Compilation failed, aborting install." |
| 208 | exit 1 |
| 209 | } |
| 210 | fi |
| 211 | echo |
| 212 | } |
| 213 | fi |
| 214 | |
| 215 | # and installation, if root |
| 216 | |
| 217 | if [ `whoami` != 'root' ] |
| 218 | then { |
| 219 | echo "You aren't root, so I'll skip the make install." |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 220 | # setup to run from current directory |
| 221 | DLLPATH="$PWD/dlls" |
| 222 | if [ -z "$LD_LIBRARY_PATH" ] |
| 223 | then LD_LIBRARY_PATH="$PWD:$DLLPATH" |
| 224 | else LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD:$DLLPATH" |
| 225 | fi |
| 226 | export LD_LIBRARY_PATH |
Ove Kaaven | 91ae8cb | 2000-07-23 13:32:04 +0000 | [diff] [blame] | 227 | DEBUGGER="$PWD/$HDEBUGGER" |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 228 | echo |
| 229 | echo "NOTE! To run Wine without installing, you must set the environment variable" |
| 230 | echo "LD_LIBRARY_PATH to $PWD:$DLLPATH" |
| 231 | echo "in your logon scripts." |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 232 | } |
| 233 | else { |
| 234 | echo "Now installing binaries onto the system..." |
| 235 | echo |
| 236 | if ! make install |
| 237 | then { |
| 238 | echo |
| 239 | echo "Installation failed, aborting." |
| 240 | exit 1 |
| 241 | } |
| 242 | fi |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 243 | if [ -f /etc/ld.so.conf ] && ! grep -qs "$libdir" /etc/ld.so.conf |
Ove Kaaven | b822b84 | 2000-02-25 20:51:09 +0000 | [diff] [blame] | 244 | then { |
| 245 | echo |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 246 | echo "$libdir didn't exist in your /etc/ld.so.conf, adding it now..." |
| 247 | echo "$libdir" >>/etc/ld.so.conf |
Ove Kaaven | b822b84 | 2000-02-25 20:51:09 +0000 | [diff] [blame] | 248 | echo "Re-running ldconfig..." |
Ove Kaaven | ce2b724 | 2000-03-04 19:13:52 +0000 | [diff] [blame] | 249 | eval "$ac_cv_path_LDCONFIG" |
Ove Kaaven | b822b84 | 2000-02-25 20:51:09 +0000 | [diff] [blame] | 250 | } |
| 251 | fi |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 252 | } |
| 253 | fi |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 254 | |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 255 | } |
| 256 | fi # BINDIST |
| 257 | |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 258 | # now check whether we should generate wine.conf |
| 259 | if [ -z "$DOCONF" ] |
| 260 | then DOCONF=auto |
| 261 | fi |
| 262 | |
| 263 | if [ "$DOCONF" = 'auto' ] |
| 264 | then { |
| 265 | # see if we already have a system wine.conf |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 266 | if [ -f $CONF ] |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 267 | then DOCONF=no |
| 268 | fi |
| 269 | } |
| 270 | fi |
| 271 | |
| 272 | if [ "$DOCONF" != 'no' ] |
| 273 | then { |
| 274 | if [ `whoami` != 'root' ] |
| 275 | then { |
| 276 | CONF=~/.winerc |
| 277 | if ! [ -f $CONF ] |
| 278 | then { |
| 279 | if [ "$DOCONF" != 'yes' ] |
| 280 | then { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 281 | conf_question medium make_user_winerc \ |
| 282 | "Since you aren't root, and there's no system wine.conf, I assume" \ |
| 283 | "you want a user-specific .winerc. Am I correct?" |
| 284 | conf_yesno_answer "(yes/no) " |
| 285 | DOCONF="$ANSWER" |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 286 | } |
| 287 | fi |
| 288 | if [ "$DOCONF" = 'no' ] |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 289 | then { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 290 | conf_question high need_root \ |
| 291 | "Aborting install. Try again as root to generate a system wine.conf." |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 292 | exit 1 |
| 293 | } |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 294 | fi |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 295 | echo |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 296 | } |
| 297 | fi |
| 298 | } |
| 299 | else { |
Joerg Mayer | d178fb0 | 1999-08-04 14:26:08 +0000 | [diff] [blame] | 300 | mkdir -p $sysconfdir |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 301 | DOCONF=yes |
| 302 | } |
| 303 | fi |
| 304 | } |
| 305 | fi |
| 306 | |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 307 | # generate wine.conf from existing windows install, if any |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 308 | if [ "$DOCONF" = 'yes' ] |
| 309 | then { |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 310 | if [ "$DOWCHK" = 'yes' ] || [ "$DOWCHK" = 'auto' ] |
| 311 | then { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 312 | echo |
| 313 | echo -n "Searching for an existing Windows installation..." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 314 | if ! $WINECONF -inifile "$WINEINI" > $CONF 2>/dev/null |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 315 | then { |
| 316 | rm -f $CONF |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 317 | echo " not found." |
| 318 | conf_question low do_without_windows \ |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 319 | "Windows was not found on your system, so I assume you want" \ |
| 320 | "a Wine-only installation. Am I correct?" |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 321 | conf_yesno_answer "(yes/no) " |
| 322 | if [ "$ANSWER" = 'no' ] |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 323 | then { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 324 | conf_question high windows_not_found \ |
| 325 | "Aborting install. Make sure your Windows partition is mounted and try again," \ |
| 326 | "or create $CONF manually by copying from $WINEINI and adapting the drive paths." |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 327 | exit 1 |
| 328 | } |
| 329 | fi |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 330 | DOWINE=yes |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 331 | } |
| 332 | else { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 333 | echo " found." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 334 | conf_reset_question windows_found |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 335 | conf_question low windows_found \ |
| 336 | "Created $CONF using your existing Windows installation." \ |
| 337 | "You probably want to review the file, though." |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 338 | DOWINE=no |
| 339 | } |
| 340 | fi |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 341 | } |
| 342 | elif [ "$DOWINE" = 'auto' ] |
| 343 | then DOWINE=yes |
| 344 | fi |
| 345 | } |
| 346 | elif [ "$DOWINE" = 'auto' ] |
| 347 | then DOWINE=no |
| 348 | fi |
| 349 | |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 350 | # setup a no-windows installation, if necessary |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 351 | if [ "$DOWINE" = 'yes' ] |
| 352 | then { |
| 353 | if [ `whoami` != 'root' ] |
| 354 | then DCROOT=~/c |
| 355 | else DCROOT=/c |
| 356 | fi |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 357 | conf_question low drivec_path \ |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 358 | "Configuring Wine without Windows." \ |
| 359 | "Some fake Windows directories must be created, to hold any .ini files, DLLs," \ |
| 360 | "start menu entries, and other things your applications may need to install." \ |
| 361 | "Where would oyu like your fake C drive to be placed?" |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 362 | while [ -z "$CROOT" ] |
| 363 | do { |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 364 | conf_string_answer "(default is $DCROOT) " |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 365 | if [ -z "$ANSWER" ] |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 366 | then CROOT="$DCROOT" |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 367 | elif ! [ -d "$ANSWER" ] |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 368 | then { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 369 | if mkdir -p "$ANSWER" |
| 370 | then CROOT="$ANSWER" |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 371 | else conf_reset_question drivec_path |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 372 | fi |
| 373 | } |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 374 | else CROOT="$ANSWER" |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 375 | fi |
| 376 | } |
| 377 | done |
| 378 | echo "Configuring Wine for a no-windows install in $CROOT..." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 379 | for tdir in "$CROOT/windows" "$CROOT/windows/system" \ |
| 380 | "$CROOT/windows/Start Menu" "$CROOT/windows/Start Menu/Programs" \ |
| 381 | "$CROOT/Common Files" "$CROOT/Program Files" \ |
| 382 | "$CROOT/windows/Profiles" "$CROOT/windows/Profiles/Administrator" |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 383 | do [ -d "$tdir" ] || mkdir "$tdir" |
| 384 | done |
| 385 | [ -f "$CROOT/windows/win.ini" ] || cp "$WININI" "$CROOT/windows/win.ini" |
| 386 | [ -f "$CROOT/windows/system.ini" ] || cp "$SYSTEMINI" "$CROOT/windows/system.ini" |
| 387 | if [ "$DOCONF" = 'yes' ] |
| 388 | then { |
Ove Kaaven | 91ae8cb | 2000-07-23 13:32:04 +0000 | [diff] [blame] | 389 | sed "s|Path=/c\$|Path=${CROOT}|" $WINEINI > $CONF |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 390 | conf_reset_question default_config |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 391 | conf_question low default_config \ |
| 392 | "Created $CONF using default Wine configuration." \ |
| 393 | "You probably want to review the file, though." |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 394 | } |
| 395 | fi |
Ove Kaaven | 91ae8cb | 2000-07-23 13:32:04 +0000 | [diff] [blame] | 396 | # now we really should install the registry |
| 397 | if [ "$DOREG" = 'auto' ] |
| 398 | then DOREG=yes |
| 399 | fi |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 400 | } |
| 401 | elif [ -z "$CROOT" ] |
| 402 | then { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 403 | echo |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 404 | echo "Reading current Wine configuration from $CONF..." |
| 405 | CROOT=`sed -n '/^\[Drive C\]$/,/^\[.*\]$/ s/^Path=\(.*\)/\1/p' $CONF` |
| 406 | echo "Drive C is configured at $CROOT." |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 407 | } |
| 408 | fi |
| 409 | echo |
| 410 | |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 411 | # fixup EXTRA_LD_LIBRARY_PATH |
| 412 | if [ "$DOCONF" = 'yes' ] |
| 413 | then { |
| 414 | echo "Setting EXTRA_LD_LIBRARY_PATH in .winerc to $DLLPATH..." |
Ove Kaaven | 91ae8cb | 2000-07-23 13:32:04 +0000 | [diff] [blame] | 415 | sed "s|EXTRA_LD_LIBRARY_PATH=.*|EXTRA_LD_LIBRARY_PATH=${DLLPATH}|" $CONF > $CONF.new |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 416 | mv -f $CONF.new $CONF |
| 417 | echo |
| 418 | } |
| 419 | fi |
| 420 | |
| 421 | # check whether we need to install default registry |
| 422 | # (not to be done if windows registry exists) |
| 423 | if [ "$DOREG" = 'auto' ] |
| 424 | then { |
| 425 | echo "Checking for real Windows registry..." |
| 426 | if [ -f "$CROOT/windows/system.dat" ] |
| 427 | then DOREG=no |
| 428 | elif [ -f "$CROOT/windows/system32/config/system" ] |
| 429 | then DOREG=no |
| 430 | else DOREG=yes |
| 431 | fi |
| 432 | if [ "$DOREG" = 'yes' ] |
| 433 | then echo "Not found, default Wine registry will be installed." |
| 434 | else echo "Windows registry found, will not install default Wine registry." |
| 435 | fi |
| 436 | echo |
| 437 | } |
| 438 | fi |
| 439 | |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 440 | # install default registry entries |
| 441 | if [ "$DOREG" = 'yes' ] |
| 442 | then { |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 443 | if [ "$BINDIST" = 'no' ] |
| 444 | then { |
| 445 | echo "Compiling regapi..." |
| 446 | echo |
| 447 | (cd programs/regapi; make) |
| 448 | echo |
| 449 | } |
| 450 | fi |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 451 | echo "Preparing to install default Wine registry entries..." |
| 452 | |
| 453 | # create a temporary wineinstall.conf file using ttydrv, |
| 454 | # so that we don't have to run regapi under X |
| 455 | sed "s/GraphicsDriver=.*/GraphicsDriver=ttydrv/" $CONF > $TMPCONF |
| 456 | |
| 457 | # create a temporary wineinstall.reg with fixed debugger path |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 458 | $DEFCAT $DEFREG | sed "s|debugger/winedbg|${DEBUGGER}|" > $TMPREG |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 459 | |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 460 | echo "Installing default Wine registry entries..." |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 461 | echo |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 462 | if ! $REGAPI --config $TMPCONF setValue < $TMPREG > /dev/null |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 463 | then { |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 464 | rm -f $TMPCONF $TMPREG |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 465 | echo "Registry install failed." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 466 | conf_reset_question regapi_error |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 467 | conf_question high regapi_error |
Ove Kaaven | b822b84 | 2000-02-25 20:51:09 +0000 | [diff] [blame] | 468 | exit 1 |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 469 | } |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 470 | else echo "Registry entries successfully installed." |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 471 | fi |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 472 | rm -f $TMPCONF $TMPREG |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 473 | if [ "$SYSREG" = 'auto' ] |
| 474 | then SYSREG=yes |
| 475 | fi |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 476 | } |
| 477 | fi |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 478 | |
| 479 | # make root's registry global, if desired |
| 480 | if [ `whoami` = 'root' ] && [ "$SYSREG" = 'yes' ] |
| 481 | then { |
Ove Kaaven | 91ae8cb | 2000-07-23 13:32:04 +0000 | [diff] [blame] | 482 | [ -d ~/.wine ] || mkdir ~/.wine |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 483 | if ! [ -f $sysconfdir/wine.userreg ] |
| 484 | then { |
| 485 | echo "Linking root's user registry hive to the global registry..." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 486 | [ -f ~/.wine/wine.userreg ] && cp ~/.wine/wine.userreg $sysconfdir/wine.userreg |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 487 | ln -sf $sysconfdir/wine.userreg ~/.wine/wine.userreg |
| 488 | } |
| 489 | fi |
| 490 | if ! [ -f $sysconfdir/wine.systemreg ] |
| 491 | then { |
| 492 | echo "Linking root's system registry hive to the global registry..." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 493 | [ -f ~/.wine/system.reg ] && cp ~/.wine/system.reg $sysconfdir/wine.systemreg |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 494 | ln -sf $sysconfdir/wine.systemreg ~/.wine/system.reg |
| 495 | } |
| 496 | fi |
| 497 | } |
| 498 | fi |
| 499 | |
| 500 | # it's a wrap |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 501 | echo |
| 502 | echo "Installation complete for now. Good luck (this is still alpha software)." |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 503 | echo "If you have problems with WINE, please read the documentation first," |
| 504 | echo "as many kinds of potential problems are explained there." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 505 | |
| 506 | exit 0 |