Make widl parse the 'transmit_as' and 'endpoint' keywords.
[wine] / tools / wineprefixcreate.in
1 #!/bin/sh
2 #
3 # Script to create the initial WINEPREFIX directory
4 #
5 # Copyright 1999 Ove Kåven
6 # Copyright 2004 Chris Morgan
7 # Copyright 2004 Alexandre Julliard
8 #
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.
13 #
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.
18 #
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
22 #
23
24 dlldir=@dlldir@
25 datadir=@datadir@
26
27 WINEPREFIX="${1:-$WINEPREFIX}"
28 WINEPREFIX="${WINEPREFIX:-$HOME/.wine}"
29
30 if [ -d "$WINEPREFIX" ]
31 then
32   echo "The $WINEPREFIX directory already exists, aborting"
33   exit 1
34 fi
35
36 if mkdir "$WINEPREFIX"; then :
37 else
38   echo "Could not create $WINEPREFIX, aborting"
39   exit 1
40 fi
41
42 CROOT="$WINEPREFIX/drive_c"
43
44 # Create the directory tree
45
46 for i in \
47     "$WINEPREFIX/dosdevices" \
48     "$CROOT" \
49     "$CROOT/windows" \
50     "$CROOT/windows/command" \
51     "$CROOT/windows/fonts" \
52     "$CROOT/windows/inf" \
53     "$CROOT/windows/profiles" \
54     "$CROOT/windows/profiles/Administrator" \
55     "$CROOT/windows/Program Files" \
56     "$CROOT/windows/Program Files/Common Files" \
57     "$CROOT/windows/Start Menu" \
58     "$CROOT/windows/Start Menu/Programs" \
59     "$CROOT/windows/Start Menu/Programs/Startup" \
60     "$CROOT/windows/system" \
61     "$CROOT/windows/temp"
62 do
63   mkdir "$i"
64 done
65
66 # Create the drive symlinks
67
68 ln -s "../drive_c" "$WINEPREFIX/dosdevices/c:"
69 ln -s "/" "$WINEPREFIX/dosdevices/z:"
70
71 # Create the application symlinks
72
73 link_app()
74 {
75    ln -s "$dlldir/$1.exe.so" "$2" || echo "Warning: failed to create $2"
76 }
77
78 link_app start        "$CROOT/windows/command/start.exe"
79 link_app notepad      "$CROOT/windows/notepad.exe"
80 link_app regedit      "$CROOT/windows/regedit.exe"
81 link_app rundll32     "$CROOT/windows/rundll32.exe"
82 link_app wcmd         "$CROOT/windows/system/wcmd.exe"
83 link_app control      "$CROOT/windows/system/control.exe"
84 link_app winhelp      "$CROOT/windows/system/help.exe"
85 link_app notepad      "$CROOT/windows/system/notepad.exe"
86 link_app progman      "$CROOT/windows/system/progman.exe"
87 link_app regsvr32     "$CROOT/windows/system/regsvr32.exe"
88 link_app winemine     "$CROOT/windows/system/winmine.exe"
89 link_app winver       "$CROOT/windows/system/winver.exe"
90 link_app uninstaller  "$CROOT/windows/uninstall.exe"
91 link_app winhelp      "$CROOT/windows/winhelp.exe"
92 link_app winhelp      "$CROOT/windows/winhlp32.exe"
93 link_app winebrowser  "$CROOT/windows/winebrowser.exe"
94
95 # Copy the .inf script and run it
96
97 cp "$datadir/wine/wine.inf" "$CROOT/windows/inf/wine.inf"
98 export WINEPREFIX
99 ${WINELOADER:-wine} rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 wine.inf
100
101 # Wait for the wineserver to finish
102
103 ${WINESERVER:-wineserver} -w
104
105 echo "$WINEPREFIX created successfully."