3 # Script to create the initial WINEPREFIX directory
5 # Copyright 1999 Ove Kåven
6 # Copyright 2004 Chris Morgan
7 # Copyright 2004 Alexandre Julliard
9 # This library is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public
11 # License as published by the Free Software Foundation; either
12 # version 2.1 of the License, or (at your option) any later version.
14 # This library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with this library; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 echo "Usage: $0 [options]"
29 echo " -h, --help Display this message"
30 echo " --prefix <dir> Directory to create (default: \$WINEPREFIX or ~/.wine)"
31 echo " -q, --quiet Don't print status messages"
32 echo " -u, --update Update the prefix directory if it already exists"
33 echo " --use-wine-tree <dir> Run from the Wine source tree <dir>"
40 datadir="@datadir@/wine"
65 topdir=`cd "$2" && pwd`
66 if [ -x "$topdir/server/wineserver" ]
68 WINELOADER="$topdir/wine"
69 dlldir="$topdir/programs"
70 datadir="$topdir/tools"
72 echo "$2 is not a valid Wine source tree"
78 echo "Unknown option $1"
85 WINEPREFIX="${WINEPREFIX:-$HOME/.wine}"
87 if [ -d "$WINEPREFIX" ] || mkdir "$WINEPREFIX"; then :
89 echo "Could not create $WINEPREFIX, aborting"
93 WINEPREFIX=`cd "$WINEPREFIX" && pwd`
95 # Create the drive symlinks
97 if [ ! -d "$WINEPREFIX/dosdevices" ]
99 mkdir "$WINEPREFIX/dosdevices"
100 [ -d "$WINEPREFIX/drive_c" ] || mkdir "$WINEPREFIX/drive_c"
101 ln -s "../drive_c" "$WINEPREFIX/dosdevices/c:"
102 ln -s "/" "$WINEPREFIX/dosdevices/z:"
105 CROOT="$WINEPREFIX/dosdevices/c:"
107 # Create the directory tree
110 "$CROOT/My Documents" \
111 "$CROOT/My Documents/My Music" \
112 "$CROOT/My Documents/My Pictures" \
113 "$CROOT/My Documents/My Video" \
114 "$CROOT/Program Files" \
115 "$CROOT/Program Files/Common Files" \
117 "$CROOT/windows/command" \
118 "$CROOT/windows/fonts" \
119 "$CROOT/windows/inf" \
120 "$CROOT/windows/profiles" \
121 "$CROOT/windows/profiles/Administrator" \
122 "$CROOT/windows/Start Menu" \
123 "$CROOT/windows/Application Data" \
124 "$CROOT/windows/Start Menu/Programs" \
125 "$CROOT/windows/Start Menu/Programs/Startup" \
126 "$CROOT/windows/system" \
127 "$CROOT/windows/temp"
129 [ -d "$i" ] || mkdir "$i"
132 # Create the application symlinks
136 rm -f "$2" && ln -s "$dlldir/$1.exe.so" "$2" || echo "Warning: failed to create $2"
139 link_app start "$CROOT/windows/command/start.exe"
140 link_app notepad "$CROOT/windows/notepad.exe"
141 link_app regedit "$CROOT/windows/regedit.exe"
142 link_app rundll32 "$CROOT/windows/rundll32.exe"
143 link_app wcmd "$CROOT/windows/system/wcmd.exe"
144 link_app control "$CROOT/windows/system/control.exe"
145 link_app winhelp "$CROOT/windows/system/help.exe"
146 link_app notepad "$CROOT/windows/system/notepad.exe"
147 link_app progman "$CROOT/windows/system/progman.exe"
148 link_app regsvr32 "$CROOT/windows/system/regsvr32.exe"
149 link_app winemine "$CROOT/windows/system/winmine.exe"
150 link_app winver "$CROOT/windows/system/winver.exe"
151 link_app uninstaller "$CROOT/windows/uninstall.exe"
152 link_app winhelp "$CROOT/windows/winhelp.exe"
153 link_app winhelp "$CROOT/windows/winhlp32.exe"
154 link_app winebrowser "$CROOT/windows/winebrowser.exe"
156 # Copy the .inf script and run it
158 cp "$datadir/wine.inf" "$CROOT/windows/inf/wine.inf"
160 ${WINELOADER:-wine} rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 wine.inf
162 # Wait for the wineserver to finish
164 if [ $do_update = 0 ]
166 ${WINESERVER:-wineserver} -w
169 echo "$WINEPREFIX created successfully."
174 echo "$WINEPREFIX updated successfully."