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... |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 4 | # |
| 5 | # Copyright 1999 Ove Kåven |
| 6 | # |
| 7 | # This library is free software; you can redistribute it and/or |
| 8 | # modify it under the terms of the GNU Lesser General Public |
| 9 | # License as published by the Free Software Foundation; either |
| 10 | # version 2.1 of the License, or (at your option) any later version. |
| 11 | # |
| 12 | # This library is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | # Lesser General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU Lesser General Public |
| 18 | # License along with this library; if not, write to the Free Software |
| 19 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | # |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 21 | |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 22 | #--- defaults (change these if you are a packager) |
Matthew Davison | 994c1b3 | 2002-11-21 23:46:06 +0000 | [diff] [blame] | 23 | CONFARGS="" # configure args, e.g. --prefix=/usr --sysconfdir=/etc |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 24 | prefix=/usr/local # installation prefix |
Francois Gouget | cbe88fc | 2002-09-06 19:46:27 +0000 | [diff] [blame] | 25 | sysconfdir=$prefix/etc # where wine.conf and the global registry are supposed to be |
| 26 | bindir=$prefix/bin # where winelib apps will be (or are) installed |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 27 | libdir=$prefix/lib # where libwine.so will be (or is) installed |
Francois Gouget | cbe88fc | 2002-09-06 19:46:27 +0000 | [diff] [blame] | 28 | exdir=documentation/samples # where the sample system.ini resides |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 29 | GCONF=$sysconfdir/wine.conf # default path of the wine.conf global config file |
| 30 | LCONF=~/.wine/config # default path of the local config file |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 31 | BINDIST=no # whether called from a binary package config script |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 32 | DOGLOBALCONF=auto # whether to autogenerate wine.conf |
| 33 | DOLOCALCONF=auto # whether to autogenerate localconf |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 34 | DOWCHK=auto # whether to autoconfigure existing-windows installation |
| 35 | DOWINE=auto # whether to autoconfigure no-windows installation |
| 36 | DOREG=auto # whether to install default registry |
Andriy Palamarchuk | a38f2d9 | 2002-05-04 18:31:24 +0000 | [diff] [blame] | 37 | DOAPP=auto # whether to install applications, distributed with Wine |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 38 | SYSREG=yes # whether to make root's registry global (system-default) |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 39 | |
| 40 | # "make install" still installs the dlls into $libdir, but this may change in the future |
| 41 | # (DLLPATH should point to them if/when they are not in standard ld.so paths) |
| 42 | DLLPATH=$libdir/wine # default path of the dll .so files (except libwine.so) |
| 43 | |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 44 | # this is only for existing-windows installs |
Francois Gouget | cbe88fc | 2002-09-06 19:46:27 +0000 | [diff] [blame] | 45 | WINECONF=tools/wineconf # path to the wineconf perl script |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 46 | |
| 47 | # this is only for no-windows installs |
Francois Gouget | cbe88fc | 2002-09-06 19:46:27 +0000 | [diff] [blame] | 48 | WINEINI=$exdir/config # path to the default wine config file (also used by wineconf) |
| 49 | WININI=/dev/null # path to the default win.ini |
| 50 | SYSTEMINI=$exdir/system.ini # path to the default system.ini |
Vincent Béron | 8ce90f2 | 2002-10-21 19:19:54 +0000 | [diff] [blame] | 51 | REGEDIT=programs/regedit/regedit # path to the regedit winelib application |
Francois Gouget | cbe88fc | 2002-09-06 19:46:27 +0000 | [diff] [blame] | 52 | DEFREG=winedefault.reg # path of the registry file to be fed to regedit |
| 53 | # CROOT=/var/wine # path of the fake Drive C (asks user if not set) |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 54 | DEFCAT=cat # program to cat $DEFREG with (some packages need zcat) |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 55 | #--- end of defaults |
| 56 | |
| 57 | # temporary files used by the installer |
| 58 | TMPCONF=/tmp/wineinstall.conf |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 59 | |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 60 | # functions |
| 61 | |
Andreas Mohr | 6dc0054 | 2000-12-05 03:53:51 +0000 | [diff] [blame] | 62 | function std_sleep { |
| 63 | sleep 1 |
| 64 | } |
| 65 | |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 66 | function conf_question { |
| 67 | # parameters: $1 = importance, $2 = question-id, $3+ = message lines |
| 68 | # the first two parameters can be used by e.g. debconf in debian packages |
| 69 | # but here we just print the message |
| 70 | shift 2 |
| 71 | echo |
| 72 | local LINE="$1" |
| 73 | while shift |
| 74 | do { |
| 75 | echo "$LINE" |
| 76 | LINE="$1" |
| 77 | } |
| 78 | done |
| 79 | } |
| 80 | |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 81 | function conf_reset_question { |
| 82 | # parameters: $1 = question-id |
| 83 | # this is used to flush any cached answers and "already-displayed" flags |
| 84 | shift # dummy command |
| 85 | } |
| 86 | |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 87 | function conf_yesno_answer { |
| 88 | unset ANSWER |
| 89 | while [ "$ANSWER" != 'yes' ] && [ "$ANSWER" != 'no' ] |
| 90 | do { |
| 91 | echo -n "$1" |
| 92 | read ANSWER |
| 93 | } |
| 94 | done |
| 95 | } |
| 96 | |
| 97 | function conf_string_answer { |
| 98 | echo -n "$1" |
| 99 | read ANSWER |
| 100 | } |
| 101 | |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 102 | function create_windows_directories { |
Sylvain Petreolle | 11666bb | 2002-12-05 19:05:44 +0000 | [diff] [blame] | 103 | for tdir in "$CROOT/windows" "$CROOT/windows/system" \ |
Dan Kegel | ba02ae4 | 2003-01-21 20:14:36 +0000 | [diff] [blame] | 104 | "$CROOT/windows/command" \ |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 105 | "$CROOT/windows/Start Menu" "$CROOT/windows/Start Menu/Programs" \ |
Andriy Palamarchuk | e02fd41 | 2002-05-16 20:27:27 +0000 | [diff] [blame] | 106 | "$CROOT/Program Files" "$CROOT/Program Files/Common Files" \ |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 107 | "$CROOT/windows/Profiles" "$CROOT/windows/Profiles/Administrator" \ |
| 108 | "$CROOT/windows/Fonts" "$CROOT/windows/Start Menu/Programs/Startup" |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 109 | do [ -d "$tdir" ] || mkdir "$tdir" |
| 110 | done |
| 111 | [ -f "$CROOT/windows/win.ini" ] || cp "$WININI" "$CROOT/windows/win.ini" |
| 112 | [ -f "$CROOT/windows/system.ini" ] || cp "$SYSTEMINI" "$CROOT/windows/system.ini" |
| 113 | } |
| 114 | |
Andriy Palamarchuk | a38f2d9 | 2002-05-04 18:31:24 +0000 | [diff] [blame] | 115 | #creates symbolic link in windows directory to installed winelib application |
| 116 | #parameters: |
| 117 | # - name of the installed winelib application |
| 118 | # - full path to application in the winelib directory |
| 119 | function link_app { |
Shachar Shemesh | 2deda85 | 2002-11-21 00:03:14 +0000 | [diff] [blame] | 120 | if [ "$WINEINSTALLED" = 'no' ] |
| 121 | then { |
| 122 | ln -sf $PWD/programs/$1/$1.exe.so $2 |
| 123 | } |
| 124 | else { |
| 125 | ln -sf $libdir/wine/$1.exe.so $2 |
| 126 | } |
| 127 | fi |
Andriy Palamarchuk | a38f2d9 | 2002-05-04 18:31:24 +0000 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | #puts windows applications replacements to windows directories, |
| 131 | #configures them |
| 132 | function configure_wine_applications { |
Dan Kegel | ba02ae4 | 2003-01-21 20:14:36 +0000 | [diff] [blame] | 133 | link_app start "$CROOT/windows/command/start.exe" |
Francois Gouget | e30b078 | 2002-09-23 19:55:12 +0000 | [diff] [blame] | 134 | link_app notepad "$CROOT/windows/notepad.exe" |
Andriy Palamarchuk | a38f2d9 | 2002-05-04 18:31:24 +0000 | [diff] [blame] | 135 | link_app regedit "$CROOT/windows/regedit.exe" |
Alberto Massari | 488a6a5 | 2002-11-18 19:42:34 +0000 | [diff] [blame] | 136 | link_app rundll32 "$CROOT/windows/rundll32.exe" |
Sylvain Petreolle | 11666bb | 2002-12-05 19:05:44 +0000 | [diff] [blame] | 137 | link_app wcmd "$CROOT/windows/system/wcmd.exe" |
| 138 | link_app control "$CROOT/windows/system/control.exe" |
| 139 | link_app winhelp "$CROOT/windows/system/help.exe" |
| 140 | link_app notepad "$CROOT/windows/system/notepad.exe" |
| 141 | link_app progman "$CROOT/windows/system/progman.exe" |
| 142 | link_app regsvr32 "$CROOT/windows/system/regsvr32.exe" |
| 143 | link_app winemine "$CROOT/windows/system/winmine.exe" |
| 144 | link_app winver "$CROOT/windows/system/winver.exe" |
Francois Gouget | e30b078 | 2002-09-23 19:55:12 +0000 | [diff] [blame] | 145 | link_app uninstaller "$CROOT/windows/uninstall.exe" |
Rok Mandeljc | 8f40af4 | 2002-09-04 23:30:44 +0000 | [diff] [blame] | 146 | link_app winhelp "$CROOT/windows/winhelp.exe" |
| 147 | link_app winhelp "$CROOT/windows/winhlp32.exe" |
Andriy Palamarchuk | a38f2d9 | 2002-05-04 18:31:24 +0000 | [diff] [blame] | 148 | } |
| 149 | |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 150 | # startup... |
| 151 | |
Shachar Shemesh | 2deda85 | 2002-11-21 00:03:14 +0000 | [diff] [blame] | 152 | echo "WINE Installer v0.74" |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 153 | echo |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 154 | |
| 155 | if [ "$BINDIST" = 'no' ] |
| 156 | then { |
| 157 | |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 158 | if ! [ -f configure ] |
| 159 | then { |
Vincent Béron | 0e668bb | 2002-10-13 17:53:47 +0000 | [diff] [blame] | 160 | if [ -f ../configure ] |
| 161 | then { |
| 162 | pushd .. |
| 163 | } |
| 164 | else { |
| 165 | echo "You're running this from the wrong directory." |
| 166 | echo "Change to the Wine source's main directory and try again." |
| 167 | exit 1 |
| 168 | } |
| 169 | fi |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 170 | } |
Andreas Mohr | 8bba9ba | 2000-08-28 21:32:08 +0000 | [diff] [blame] | 171 | fi |
Andreas Mohr | 8bba9ba | 2000-08-28 21:32:08 +0000 | [diff] [blame] | 172 | |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 173 | if [ `whoami` == 'root' ] |
| 174 | then { |
| 175 | echo "You are running wineinstall as root, this is not advisable. Please rerun as a user." |
| 176 | echo "Aborting." |
| 177 | exit 1 |
| 178 | } |
| 179 | fi |
Andreas Mohr | de53c48 | 2001-04-09 18:32:16 +0000 | [diff] [blame] | 180 | |
Alexandre Julliard | 1bb7a9f | 2003-09-29 20:25:47 +0000 | [diff] [blame] | 181 | if [ ! -w . ] |
| 182 | then { |
| 183 | echo "The source directory is not writable. You probably extracted the sources as root." |
| 184 | echo "You should remove the source tree and extract it again as a normal user." |
| 185 | exit 1 |
| 186 | } |
| 187 | fi |
| 188 | |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 189 | # check whether RPM installed, and if it is, remove any old wine rpm. |
| 190 | hash rpm &>/dev/null |
| 191 | RET=$? |
| 192 | if [ $RET -eq 0 ]; then |
| 193 | if [ -n "`rpm -qi wine 2>/dev/null|grep "^Name"`" ]; then |
| 194 | echo "Warning: Old Wine RPM install detected. Do you want to remove it first?" |
| 195 | conf_yesno_answer "(yes/no) " |
| 196 | if [ "$ANSWER" = 'yes' ]; then |
| 197 | echo "We need to remove the rpm as root, please enter your root password" |
| 198 | echo |
| 199 | echo Starting wine rpm removal... |
| 200 | su -c "rpm -e wine; RET=$?" |
| 201 | if [ $RET -eq 0 ]; then |
| 202 | echo Done. |
| 203 | else |
| 204 | echo "FAILED. Probably you aren't installing as root." |
| 205 | echo "Expect problems (library conflicts with existing install etc.)." |
| 206 | fi |
| 207 | else |
| 208 | echo "Sorry, I won't install Wine when an rpm version is still installed." |
| 209 | echo "(Wine support suffered from way too many conflicts between RPM" |
| 210 | echo "and source installs)" |
| 211 | echo "Have a nice day !" |
| 212 | exit 1 |
| 213 | fi |
| 214 | fi |
| 215 | fi |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 216 | |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 217 | # check whether wine binary still available |
| 218 | if [ -n "`which wine 2>/dev/null|grep '/wine'`" ]; then |
| 219 | echo "Warning !! wine binary (still) found, which may indicate" |
| 220 | echo "a (conflicting) previous installation." |
| 221 | echo "You might want to abort and uninstall Wine first." |
| 222 | std_sleep |
| 223 | fi |
| 224 | |
| 225 | # run the configure script, if necessary |
| 226 | |
| 227 | if [ -f config.cache ] && [ -f Makefile ] && [ Makefile -nt configure ] |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 228 | then { |
| 229 | echo |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 230 | echo "I see that WINE has already been configured, so I'll skip that." |
| 231 | std_sleep |
| 232 | # load configure results |
| 233 | . ./config.cache |
| 234 | } |
| 235 | else { |
| 236 | echo "Running configure..." |
| 237 | echo |
Mike Hearn | 7927b41 | 2003-05-13 23:37:09 +0000 | [diff] [blame] | 238 | if ! ./configure -C $CONFARGS --prefix=$prefix |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 239 | then { |
| 240 | echo |
| 241 | echo "Configure failed, aborting install." |
| 242 | rm -f config.cache |
| 243 | exit 1 |
| 244 | } |
| 245 | fi |
| 246 | # load configure results |
| 247 | . ./config.cache |
| 248 | # make sure X was found |
| 249 | eval "$ac_cv_have_x" |
| 250 | if [ "$have_x" != "yes" ] |
| 251 | then { |
| 252 | echo "Install the X development headers and try again." |
| 253 | rm -f config.cache |
| 254 | exit 1 |
| 255 | } |
| 256 | fi |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 257 | } |
| 258 | fi |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 259 | |
| 260 | # now do the compilation and install, we need to always do this because we |
| 261 | # don't want the 'make install' command we might run to run 'make' as root |
| 262 | if [ `whoami` != 'root' ] |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 263 | then { |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 264 | # ask the user if they want to build and install wine |
| 265 | echo |
| 266 | echo "We need to install wine as root user, do you want us to build wine," |
| 267 | echo "'su root' and install Wine? Enter 'no' to continue without installing" |
| 268 | conf_yesno_answer "(yes/no) " |
Vincent Béron | fc144ad | 2002-10-15 01:19:46 +0000 | [diff] [blame] | 269 | ROOTINSTALL="$ANSWER" |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 270 | |
Vincent Béron | fc144ad | 2002-10-15 01:19:46 +0000 | [diff] [blame] | 271 | if [ "$ROOTINSTALL" = "yes" ] |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 272 | then { |
| 273 | # start out with the basic command |
| 274 | sucommand="make install" |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 275 | |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 276 | # if the user doesn't have $libdir in their ld.so.conf add this |
| 277 | # to our sucommand string |
| 278 | if [ -f /etc/ld.so.conf ] |
| 279 | then |
Francois Gouget | 533f0b5 | 2003-07-30 03:43:55 +0000 | [diff] [blame] | 280 | if ! grep -s "$libdir" /etc/ld.so.conf >/dev/null 2>&1 |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 281 | then { |
| 282 | echo |
| 283 | echo "$libdir doesn't exist in your /etc/ld.so.conf, it will be added" |
| 284 | echo "when we perform the install..." |
| 285 | sucommand="$sucommand;echo $libdir>>/etc/ld.so.conf" |
| 286 | } |
| 287 | fi |
| 288 | # run ldconfig always just in case some updated files dont get linked |
| 289 | sucommand="$sucommand;$ac_cv_path_LDCONFIG" |
| 290 | fi |
Vincent Béron | fc144ad | 2002-10-15 01:19:46 +0000 | [diff] [blame] | 291 | } |
| 292 | fi # [ "$ROOTINSTALL" = "yes" ] |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 293 | |
Vincent Béron | fc144ad | 2002-10-15 01:19:46 +0000 | [diff] [blame] | 294 | echo |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 295 | |
Vincent Béron | fc144ad | 2002-10-15 01:19:46 +0000 | [diff] [blame] | 296 | echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever," |
| 297 | echo "in the meantime..." |
| 298 | echo |
| 299 | std_sleep |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 300 | |
Vincent Béron | fc144ad | 2002-10-15 01:19:46 +0000 | [diff] [blame] | 301 | # try to just make wine, if this fails 'make depend' and try to remake |
| 302 | if ! { make; } |
| 303 | then { |
| 304 | if ! { make depend && make; } |
Dustin Navea | 693d719 | 2002-04-27 00:15:12 +0000 | [diff] [blame] | 305 | then { |
Vincent Béron | fc144ad | 2002-10-15 01:19:46 +0000 | [diff] [blame] | 306 | echo |
| 307 | echo "Compilation failed, aborting install." |
| 308 | exit 1 |
Dustin Navea | 693d719 | 2002-04-27 00:15:12 +0000 | [diff] [blame] | 309 | } |
| 310 | fi |
Vincent Béron | fc144ad | 2002-10-15 01:19:46 +0000 | [diff] [blame] | 311 | } |
| 312 | fi |
| 313 | |
| 314 | if [ "$ROOTINSTALL" = "yes" ] |
| 315 | then { |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 316 | echo |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 317 | |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 318 | echo "Performing 'make install' as root to install binaries, enter root password" |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 319 | |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 320 | std_sleep |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 321 | |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 322 | if ! su root -c "$sucommand" |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 323 | then { |
Brian Vincent | d6841ee | 2003-03-24 19:29:38 +0000 | [diff] [blame] | 324 | if ! su root -c "$sucommand" |
| 325 | then { |
| 326 | echo |
| 327 | echo "Either you entered an incorrect password or we failed to" |
| 328 | echo "run '$sucommand' correctly." |
| 329 | echo "If you didn't enter an incorrect password then please" |
| 330 | echo "report this error and any steps to possibly reproduce it to" |
Dimitrie O. Paun | c023254 | 2003-11-26 03:55:01 +0000 | [diff] [blame] | 331 | echo "http://bugs.winehq.org/" |
Brian Vincent | d6841ee | 2003-03-24 19:29:38 +0000 | [diff] [blame] | 332 | echo |
| 333 | echo "Installation failed, aborting." |
| 334 | exit 1 |
| 335 | } |
| 336 | fi |
| 337 | } |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 338 | fi |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 339 | |
| 340 | echo |
| 341 | |
| 342 | # see if wine is installed on the users system, if not prompt them |
| 343 | # and then exit |
| 344 | if [ ! `which wine` ] |
| 345 | then |
| 346 | echo "Could not find wine on your system. Run wineinstall as root to install wine" |
| 347 | echo "before re-running wineinstall as a user." |
| 348 | echo |
| 349 | echo "Exiting wineinstall" |
| 350 | exit 1; |
| 351 | fi |
Shachar Shemesh | 2deda85 | 2002-11-21 00:03:14 +0000 | [diff] [blame] | 352 | |
| 353 | WINEINSTALLED=yes |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 354 | } |
| 355 | else { |
| 356 | # user didn't want to install wine so tell them about running from the |
| 357 | # current directory and set some stuff up for them |
| 358 | |
| 359 | # setup to run from current directory |
| 360 | DLLPATH="$PWD/dlls" |
| 361 | if [ -z "$LD_LIBRARY_PATH" ] |
| 362 | then LD_LIBRARY_PATH="$PWD:$DLLPATH" |
| 363 | else LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD:$DLLPATH" |
| 364 | fi |
| 365 | export LD_LIBRARY_PATH |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 366 | echo |
| 367 | echo "NOTE! To run Wine without installing, you must set the environment variable" |
| 368 | echo "LD_LIBRARY_PATH to $PWD:$DLLPATH" |
| 369 | echo "in your logon scripts." |
| 370 | echo |
Shachar Shemesh | 2deda85 | 2002-11-21 00:03:14 +0000 | [diff] [blame] | 371 | |
| 372 | WINEINSTALLED=no |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 373 | } |
Vincent Béron | fc144ad | 2002-10-15 01:19:46 +0000 | [diff] [blame] | 374 | fi # [ "$ROOTINSTALL" = "yes" ] |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 375 | } |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 376 | fi # [ `whoami` != 'root' ] |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 377 | |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 378 | } |
| 379 | fi # BINDIST |
| 380 | |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 381 | # now check whether we should generate wine.conf |
| 382 | if [ -z "$DOGLOBALCONF" ] |
Adam D. Moss | 49185ac | 2002-02-19 18:30:54 +0000 | [diff] [blame] | 383 | then |
| 384 | DOGLOBALCONF=auto |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 385 | fi |
| 386 | |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 387 | if [ "$DOGLOBALCONF" = 'auto' ] |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 388 | then { |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 389 | # see if we already have a system wine.conf |
| 390 | if [ ! -f $GCONF ] && [ `whoami` = 'root' ] |
| 391 | then |
| 392 | DOGLOBALCONF=no |
| 393 | echo "Creation of a global config file is not supported in wineinstall at this" |
| 394 | echo "time. When the configuration architecture is cleaned up this functionality" |
| 395 | echo "will be restored to wineinstall." |
| 396 | echo |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 397 | fi |
| 398 | } |
| 399 | fi |
| 400 | |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 401 | if [ "$DOLOCALCONF" = 'auto' ] |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 402 | then { |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 403 | # see if the user is root, if so, explicitly ask them if they want a |
| 404 | # local config file |
| 405 | if [ `whoami` = 'root' ] |
| 406 | then |
| 407 | echo "You are running as root. Do you want a local config file," |
| 408 | echo "file, ~/.wine/config, created?" |
| 409 | conf_yesno_answer "(yes/no) " |
| 410 | DOLOCALCONF="$ANSWER" |
| 411 | else |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 412 | # if the user has an existing config file ask them if they want us to |
| 413 | # overwrite it, otherwise just ask them if they want to create one |
| 414 | if [ -f "$LCONF" ] |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 415 | then |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 416 | echo "Found existing $LCONF, do you want to overwrite this" |
| 417 | echo "existing Wine configuration file?" |
| 418 | conf_yesno_answer "(yes/no) " |
| 419 | DOLOCALCONF="$ANSWER" |
| 420 | echo |
Dustin Navea | 3ebea43 | 2002-05-23 16:30:42 +0000 | [diff] [blame] | 421 | if [ "$ANSWER" = "yes" ] |
| 422 | then |
| 423 | { |
| 424 | echo "Would you like to make a backup of this old config file?" |
| 425 | conf_yesno_answer "(yes/no) " |
| 426 | echo |
| 427 | if [ "$ANSWER" = "yes" ] |
| 428 | then |
| 429 | { |
| 430 | echo "Renaming $LCONF to $LCONF.old" |
| 431 | mv -f "$LCONF" "$LCONF.old" |
| 432 | echo |
| 433 | } |
| 434 | fi |
| 435 | } |
| 436 | fi |
| 437 | else |
| 438 | { |
Chris Morgan | ee626fe | 2002-04-01 20:56:51 +0000 | [diff] [blame] | 439 | echo "Create local config file ~/.wine/config?" |
| 440 | conf_yesno_answer "(yes/no) " |
| 441 | DOLOCALCONF="$ANSWER" |
| 442 | echo |
| 443 | if [ "$ANSWER" = 'no' ] |
| 444 | then |
| 445 | conf_question high need_root \ |
| 446 | "Aborting install. Try again as root to generate a system wine.conf." |
| 447 | exit 1 |
| 448 | fi |
| 449 | } |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 450 | fi |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 451 | fi |
| 452 | } |
| 453 | fi |
| 454 | |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 455 | # generate $TMPCONF from existing windows install, if any |
| 456 | if [ "$DOLOCALCONF" = 'yes' ] |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 457 | then { |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 458 | if [ "$DOWCHK" = 'yes' ] || [ "$DOWCHK" = 'auto' ] |
| 459 | then { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 460 | echo -n "Searching for an existing Windows installation..." |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 461 | if ! $WINECONF -inifile "$WINEINI" > $TMPCONF 2>/dev/null |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 462 | then { |
Alexandre Julliard | 4a301f5 | 2002-10-29 23:27:37 +0000 | [diff] [blame] | 463 | rm -f $TMPCONF > /dev/null |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 464 | |
Andreas Mohr | 9cef2d0 | 2001-11-19 02:30:01 +0000 | [diff] [blame] | 465 | echo " not found. (no matching /etc/fstab mount entry found)" |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 466 | conf_question low do_without_windows \ |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 467 | "Windows was not found on your system, so I assume you want" \ |
| 468 | "a Wine-only installation. Am I correct?" |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 469 | conf_yesno_answer "(yes/no) " |
| 470 | if [ "$ANSWER" = 'no' ] |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 471 | then { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 472 | conf_question high windows_not_found \ |
| 473 | "Aborting install. Make sure your Windows partition is mounted and try again," \ |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 474 | "or create $LCONF manually by copying from $WINEINI and adapting the drive paths." |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 475 | exit 1 |
| 476 | } |
| 477 | fi |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 478 | DOWINE=yes |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 479 | } |
| 480 | else { |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 481 | echo " found." |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 482 | |
Shachar Shemesh | 2deda85 | 2002-11-21 00:03:14 +0000 | [diff] [blame] | 483 | conf_question low do_without_windows \ |
| 484 | "Windows was found on your system, and so we can use the Windows" \ |
| 485 | "Drive as our Wine drive. You may, however, wish to create a clean" \ |
| 486 | "Wine install anyways." |
| 487 | conf_yesno_answer "Should I use the Windows drive for the Wine install? (yes/no) " |
| 488 | if [ "$ANSWER" = 'yes' ] |
| 489 | then { |
| 490 | conf_reset_question windows_found |
| 491 | conf_question low windows_found \ |
| 492 | "Created $LCONF using your existing Windows installation." \ |
| 493 | "You probably want to review the file, though." |
| 494 | DOWINE=no |
| 495 | } |
| 496 | else { |
| 497 | DOWINE=yes |
| 498 | } |
| 499 | fi |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 500 | } |
| 501 | fi |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 502 | } |
| 503 | elif [ "$DOWINE" = 'auto' ] |
| 504 | then DOWINE=yes |
| 505 | fi |
| 506 | } |
| 507 | elif [ "$DOWINE" = 'auto' ] |
Alexandre Julliard | 7cae558 | 2002-06-01 02:55:48 +0000 | [diff] [blame] | 508 | then |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 509 | DOWINE=no |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 510 | fi |
| 511 | |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 512 | # setup a no-windows installation, if necessary |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 513 | if [ "$DOWINE" = 'yes' ] |
| 514 | then { |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 515 | # set an appropriate DCROOT |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 516 | if [ `whoami` != 'root' ] |
| 517 | then DCROOT=~/c |
| 518 | else DCROOT=/c |
| 519 | fi |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 520 | |
Alexandre Julliard | d16a64e | 2002-11-22 20:44:13 +0000 | [diff] [blame] | 521 | conf_question low drivec_path \ |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 522 | "Configuring Wine without Windows." \ |
| 523 | "Some fake Windows directories must be created, to hold any .ini files, DLLs," \ |
| 524 | "start menu entries, and other things your applications may need to install." \ |
| 525 | "Where would you like your fake C drive to be placed?" |
Alexandre Julliard | d16a64e | 2002-11-22 20:44:13 +0000 | [diff] [blame] | 526 | while [ -z "$CROOT" ] |
| 527 | do { |
| 528 | conf_string_answer "(default is $DCROOT) " |
| 529 | [ -z "$ANSWER" ] && ANSWER="$DCROOT" |
| 530 | if ! [ -d "$ANSWER" ] |
| 531 | then { |
| 532 | if mkdir -p "$ANSWER" |
| 533 | then CROOT="$ANSWER" |
| 534 | else |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 535 | echo "Directory $ANSWER can't be created !" |
| 536 | conf_reset_question drivec_path |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 537 | fi |
| 538 | } |
Alexandre Julliard | d16a64e | 2002-11-22 20:44:13 +0000 | [diff] [blame] | 539 | else CROOT="$ANSWER" |
| 540 | fi |
| 541 | } |
| 542 | done |
| 543 | echo "Configuring Wine for a no-windows install in $CROOT..." |
Alexandre Julliard | 7cae558 | 2002-06-01 02:55:48 +0000 | [diff] [blame] | 544 | |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 545 | create_windows_directories |
Andriy Palamarchuk | a38f2d9 | 2002-05-04 18:31:24 +0000 | [diff] [blame] | 546 | configure_wine_applications |
Chris Morgan | 3a21321 | 2001-01-11 20:18:06 +0000 | [diff] [blame] | 547 | |
Alexandre Julliard | 7cae558 | 2002-06-01 02:55:48 +0000 | [diff] [blame] | 548 | # create $LCONF using the default config file $WINEINI |
Alexandre Julliard | d16a64e | 2002-11-22 20:44:13 +0000 | [diff] [blame] | 549 | if [ "$DOLOCALCONF" = 'yes' ] |
Chris Morgan | 3a21321 | 2001-01-11 20:18:06 +0000 | [diff] [blame] | 550 | then { |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 551 | sed "s|\"Path\" = \"/c\"\$|\"Path\" = \"${CROOT}\"|" $WINEINI > $TMPCONF |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 552 | conf_reset_question default_config |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 553 | conf_question low default_config \ |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 554 | "Created $LCONF using default Wine configuration." \ |
Ove Kaaven | 2c76752 | 2000-10-29 18:02:53 +0000 | [diff] [blame] | 555 | "You probably want to review the file, though." |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 556 | } |
| 557 | fi |
Chris Morgan | 3a21321 | 2001-01-11 20:18:06 +0000 | [diff] [blame] | 558 | |
Ove Kaaven | 91ae8cb | 2000-07-23 13:32:04 +0000 | [diff] [blame] | 559 | # now we really should install the registry |
| 560 | if [ "$DOREG" = 'auto' ] |
| 561 | then DOREG=yes |
| 562 | fi |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 563 | } |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 564 | fi |
| 565 | echo |
| 566 | |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 567 | #install the local config file $LCONF |
| 568 | if [ "$DOLOCALCONF" = 'yes' ] |
| 569 | then |
| 570 | if [ ! -w ~/.wine ] |
| 571 | then |
| 572 | mkdir ~/.wine |
Chris Morgan | 3a21321 | 2001-01-11 20:18:06 +0000 | [diff] [blame] | 573 | fi |
Alexandre Julliard | d16a64e | 2002-11-22 20:44:13 +0000 | [diff] [blame] | 574 | cp $TMPCONF $LCONF > /dev/null |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 575 | else |
| 576 | DOREG=no |
Alexandre Julliard | 7cae558 | 2002-06-01 02:55:48 +0000 | [diff] [blame] | 577 | fi |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 578 | |
| 579 | #install the global config file $GCONF |
| 580 | if [ "$DOGLOBALCONF" = 'yes' ] |
| 581 | then |
| 582 | if [ ! -f $sysconfdir ] |
| 583 | then |
| 584 | mkdir -p $sysconfdir |
| 585 | fi |
| 586 | |
| 587 | cp $TMPCONF $GCONF > /dev/null |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 588 | fi |
| 589 | |
| 590 | # check whether we need to install default registry |
| 591 | # (not to be done if windows registry exists) |
| 592 | if [ "$DOREG" = 'auto' ] |
| 593 | then { |
Dustin Navea | e052196 | 2002-04-23 19:29:55 +0000 | [diff] [blame] | 594 | CROOT=`sed -n '/^\[Drive C\]$/,/^\[.*\]$/ s/^\"Path\" = \"\(.*\)\"/\1/p' $LCONF` |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 595 | echo "Checking for real Windows registry..." |
| 596 | if [ -f "$CROOT/windows/system.dat" ] |
| 597 | then DOREG=no |
| 598 | elif [ -f "$CROOT/windows/system32/config/system" ] |
| 599 | then DOREG=no |
Dustin Navea | e052196 | 2002-04-23 19:29:55 +0000 | [diff] [blame] | 600 | elif [ -f "$CROOT/WINNT/system32/config/system" ] |
Alexandre Julliard | 7cae558 | 2002-06-01 02:55:48 +0000 | [diff] [blame] | 601 | then DOREG=no |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 602 | else DOREG=yes |
| 603 | fi |
| 604 | if [ "$DOREG" = 'yes' ] |
| 605 | then echo "Not found, default Wine registry will be installed." |
| 606 | else echo "Windows registry found, will not install default Wine registry." |
| 607 | fi |
| 608 | echo |
| 609 | } |
| 610 | fi |
| 611 | |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 612 | # install default registry entries |
| 613 | if [ "$DOREG" = 'yes' ] |
| 614 | then { |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 615 | if [ "$BINDIST" = 'no' ] |
| 616 | then { |
Andriy Palamarchuk | a38f2d9 | 2002-05-04 18:31:24 +0000 | [diff] [blame] | 617 | echo "Compiling regedit..." |
| 618 | (cd programs/regedit; make) |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 619 | echo |
| 620 | } |
| 621 | fi |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 622 | echo "Preparing to install default Wine registry entries..." |
| 623 | |
Vincent Béron | a03e66d | 2003-04-22 04:03:08 +0000 | [diff] [blame] | 624 | # Make sure we are on a Windows drive |
Alexandre Julliard | d16a64e | 2002-11-22 20:44:13 +0000 | [diff] [blame] | 625 | mv $LCONF $LCONF.orig |
Vincent Béron | 0996d0c | 2003-09-08 18:52:12 +0000 | [diff] [blame] | 626 | sed "s/\"Path\" = \"%HOME%\"$/\"Path\" = \"%PWD%\"/" $LCONF.orig> $LCONF |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 627 | |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 628 | echo "Installing default Wine registry entries..." |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 629 | echo |
Alexandre Julliard | 4a301f5 | 2002-10-29 23:27:37 +0000 | [diff] [blame] | 630 | if ! $REGEDIT $DEFREG > /dev/null |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 631 | then { |
Ove Kaaven | f561aad | 2000-05-09 22:32:42 +0000 | [diff] [blame] | 632 | echo "Registry install failed." |
Alexandre Julliard | d16a64e | 2002-11-22 20:44:13 +0000 | [diff] [blame] | 633 | mv $LCONF.orig $LCONF |
Andriy Palamarchuk | a38f2d9 | 2002-05-04 18:31:24 +0000 | [diff] [blame] | 634 | conf_reset_question regedit_error |
| 635 | conf_question high regedit_error |
Ove Kaaven | b822b84 | 2000-02-25 20:51:09 +0000 | [diff] [blame] | 636 | exit 1 |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 637 | } |
Chris Morgan | 3a21321 | 2001-01-11 20:18:06 +0000 | [diff] [blame] | 638 | else { |
Alexandre Julliard | d16a64e | 2002-11-22 20:44:13 +0000 | [diff] [blame] | 639 | echo |
| 640 | echo "Registry entries successfully installed." |
| 641 | mv $LCONF.orig $LCONF |
Chris Morgan | 3a21321 | 2001-01-11 20:18:06 +0000 | [diff] [blame] | 642 | } |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 643 | fi |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 644 | if [ "$SYSREG" = 'auto' ] |
| 645 | then SYSREG=yes |
| 646 | fi |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 647 | } |
| 648 | fi |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 649 | |
| 650 | # make root's registry global, if desired |
Chris Morgan | 3a21321 | 2001-01-11 20:18:06 +0000 | [diff] [blame] | 651 | if [ `whoami` = 'root' ] && [ "$DOREG" = 'yes' ] && [ "$SYSREG" = 'yes' ] |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 652 | then { |
Ove Kaaven | 91ae8cb | 2000-07-23 13:32:04 +0000 | [diff] [blame] | 653 | [ -d ~/.wine ] || mkdir ~/.wine |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 654 | if ! [ -f $sysconfdir/wine.userreg ] |
| 655 | then { |
| 656 | echo "Linking root's user registry hive to the global registry..." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 657 | [ -f ~/.wine/wine.userreg ] && cp ~/.wine/wine.userreg $sysconfdir/wine.userreg |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 658 | ln -sf $sysconfdir/wine.userreg ~/.wine/wine.userreg |
| 659 | } |
| 660 | fi |
| 661 | if ! [ -f $sysconfdir/wine.systemreg ] |
| 662 | then { |
| 663 | echo "Linking root's system registry hive to the global registry..." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 664 | [ -f ~/.wine/system.reg ] && cp ~/.wine/system.reg $sysconfdir/wine.systemreg |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 665 | ln -sf $sysconfdir/wine.systemreg ~/.wine/system.reg |
| 666 | } |
| 667 | fi |
| 668 | } |
| 669 | fi |
| 670 | |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 671 | # cleanup any temporary files that may remain |
| 672 | if [ -f $TMPCONF ] |
| 673 | then rm -f $TMPCONF |
| 674 | fi |
Chris Morgan | a00cefb | 2001-01-18 20:29:21 +0000 | [diff] [blame] | 675 | |
| 676 | |
Ove Kaaven | b5d37ec | 2000-04-15 20:37:14 +0000 | [diff] [blame] | 677 | # it's a wrap |
Ove Kaaven | 2043ba0 | 1999-04-18 13:16:29 +0000 | [diff] [blame] | 678 | echo |
| 679 | echo "Installation complete for now. Good luck (this is still alpha software)." |
Ove Kaaven | e185888 | 2000-04-08 20:20:21 +0000 | [diff] [blame] | 680 | echo "If you have problems with WINE, please read the documentation first," |
| 681 | echo "as many kinds of potential problems are explained there." |
Ove Kaaven | 6e143b3 | 2000-10-31 00:59:01 +0000 | [diff] [blame] | 682 | |
| 683 | exit 0 |