cryptui: Implement specifying the destination store in CryptUIWizImport.
[wine/wine64.git] / tools / wineinstall
blobfe48505c03b153aa700a039b83681fc55247d6b6
1 #!/bin/sh
2 # WINE Installation script
3 # Can do almost everything from compiling to configuring...
5 # Copyright 1999 Ove Kåven
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #--- defaults (change these if you are a packager)
23 CONFARGS="" # configure args, e.g. --prefix=/usr
25 std_sleep() {
26 sleep 1
29 conf_yesno_answer() {
30 unset ANSWER
31 while [ "$ANSWER" != 'yes' ] && [ "$ANSWER" != 'no' ]
32 do {
33 echo -n "$1"
34 read ANSWER
36 done
39 # startup...
41 echo "Wine Installer v1.0"
42 echo
44 if ! [ -f configure ]
45 then
46 if [ -f ../configure ]
47 then {
48 cd ..
50 else {
51 echo "You're running this from the wrong directory."
52 echo "Change to the Wine source's main directory and try again."
53 exit 1
58 if [ `whoami` = 'root' ]
59 then
60 echo "You are running wineinstall as root, this is not advisable. Please rerun as a user."
61 echo "Aborting."
62 exit 1
65 if [ ! -w . ]
66 then
67 echo "The source directory is not writable. You probably extracted the sources as root."
68 echo "You should remove the source tree and extract it again as a normal user."
69 exit 1
72 # check whether RPM installed, and if it is, remove any old wine rpm.
73 hash rpm &>/dev/null
74 RET=$?
75 if [ $RET -eq 0 ]; then
76 if [ -n "`rpm -qi wine 2>/dev/null|grep "^Name"`" ]; then
77 echo "Warning: Old Wine RPM install detected. Do you want to remove it first?"
78 conf_yesno_answer "(yes/no) "
79 if [ "$ANSWER" = 'yes' ]; then
80 echo "We need to remove the rpm as root, please enter your root password"
81 echo
82 echo Starting wine rpm removal...
83 su -c "rpm -e wine; RET=$?"
84 if [ $RET -eq 0 ]; then
85 echo Done.
86 else
87 echo "FAILED. Probably you aren't installing as root."
88 echo "Expect problems (library conflicts with existing install etc.)."
90 else
91 echo "Sorry, I won't install Wine when an rpm version is still installed."
92 echo "(Wine support suffered from way too many conflicts between RPM"
93 echo "and source installs)"
94 echo "Have a nice day !"
95 exit 1
100 # check whether wine binary still available
101 if [ -n "`wine --version 2>/dev/null`" ]
102 then
103 echo "Warning !! wine binary (still) found, which may indicate"
104 echo "a (conflicting) previous installation."
105 echo "You might want to abort and uninstall Wine first."
106 echo "(If you previously tried to install from source manually, "
107 echo "run 'make uninstall' from the wine root directory)"
108 std_sleep
111 # run the configure script, if necessary
113 if [ -f Makefile ]
114 then
115 echo "I see that Wine has already been configured, so I'll skip that."
116 std_sleep
117 else
118 echo "Running configure..."
119 echo
120 if ! ./configure $CONFARGS
121 then {
122 echo
123 echo "Configure failed, aborting install."
124 exit 1
129 # now do the compilation and install, we need to always do this because we
130 # don't want the 'make install' command we might run to run 'make' as root
132 # ask the user if they want to build and install wine
133 echo
134 echo "We need to install wine as root user, do you want us to build wine,"
135 echo "'su root' and install Wine? Enter 'no' to continue without installing"
136 conf_yesno_answer "(yes/no) "
137 ROOTINSTALL="$ANSWER"
139 if [ "$ROOTINSTALL" = "yes" ]
140 then sucommand="make install"
143 echo
144 echo "Compiling Wine. Grab a lunch or two, rent a video, or whatever,"
145 echo "in the meantime..."
146 echo
147 std_sleep
149 # try to just make wine, if this fails 'make depend' and try to remake
150 if ! { make; }
151 then
152 if ! { make depend && make; }
153 then
154 echo
155 echo "Compilation failed, aborting install."
156 exit 1
160 if [ "$ROOTINSTALL" = "no" ]
161 then
162 exit 0
165 echo
166 echo "Performing 'make install' as root to install binaries, enter root password"
168 if ! su root -c "$sucommand"
169 then
170 echo
171 echo "Incorrect root password. If you are running Ubuntu or a similar distribution,"
172 echo "'make install' needs to be run via the sudo wrapper, so trying that one now"
173 if ! sudo su root -c "$sucommand"
174 then
175 echo
176 echo "Either you entered an incorrect password or we failed to"
177 echo "run '$sucommand' correctly."
178 echo "If you didn't enter an incorrect password then please"
179 echo "report this error and any steps to possibly reproduce it to"
180 echo "http://bugs.winehq.org/"
181 echo
182 echo "Installation failed, aborting."
183 exit 1
187 # it's a wrap
188 echo
189 echo "Installation complete."
190 echo "If you have problems with Wine, please read the documentation first,"
191 echo "as many kinds of potential problems are explained there."
193 exit 0