SHA256
1
0
forked from pool/wine
OBS User unknown
2007-10-04 22:39:47 +00:00
committed by Git OBS Bridge
parent bf2bd215d9
commit f54d3d73d5
6 changed files with 134 additions and 88 deletions

View File

@@ -6,13 +6,30 @@
# Thanks to Detlef Riekenberg for lots of updates
# Thanks to Saulius Krasuckas for corrections and suggestions
# FIXME get these settings right
# Default values for important settings if not already in environment.
# These settings should not need editing here.
WINE=${WINE:-wine}
WINEPREFIXCREATE=${WINEPREFIXCREATE:-wineprefixcreate}
WINEPREFIX=${WINEPREFIX:-$HOME/.wine}
# Internal variables; these locations are not too important
WINETRICKS_CACHE=$HOME/winetrickscache
WINETRICKS_TMP=$WINEPREFIX/drive_c/winetrickstmp
which "$WINE" > /dev/null
if test "$?" -ne "0"
then
echo "Cannot find wine ($WINE)"
exit 1
fi
which "$WINEPREFIXCREATE" > /dev/null
if test "$?" -ne "0"
then
echo "Cannot find wineprefixcreate ($WINEPREFIXCREATE)"
exit 1
fi
#----------------------------------------------------------------
usage() {
@@ -59,6 +76,7 @@ usage() {
echo " winver=win98 Set windows version to win98"
echo " winver=winxp Set windows version to winxp"
echo " winver= Set windows version to default (win2k)"
echo " volnum Rename drive_c to harddiskvolume0 (needed by some installers)"
exit 1
}
@@ -75,18 +93,11 @@ olddir=`pwd`
# Clean up after failed runs, if needed
rm -rf $WINETRICKS_TMP/*
#----- Helpers ------------------------------------------------
# The folder-name is localized!
programfilesdir_win=`$WINE cmd.exe /c echo "%ProgramFiles%"`
programfilesdir_unix=`$WINE winepath -u "$programfilesdir_win"`
# Download a file
download() {
file=`basename $1`
test -f $WINETRICKS_CACHE/$file || (cd $WINETRICKS_CACHE; wget -c $1)
if [ "$2"x != ""x ]
then
echo "$2 $WINETRICKS_CACHE/$file" > $WINETRICKS_CACHE/$file.sha1sum
try sha1sum --status -c $WINETRICKS_CACHE/$file.sha1sum
fi
}
#----- Helpers ------------------------------------------------
# Execute with error checking
try() {
@@ -104,6 +115,17 @@ try() {
fi
}
# Download a file
download() {
file=`basename "$1"`
test -f $WINETRICKS_CACHE/$file || (cd $WINETRICKS_CACHE; wget -c "$1")
if [ "$2"x != ""x ]
then
echo "$2 $WINETRICKS_CACHE/$file" > $WINETRICKS_CACHE/$file.sha1sum
try sha1sum --status -c $WINETRICKS_CACHE/$file.sha1sum
fi
}
set_winver() {
echo "Setting Windows version to $1"
cat > $WINETRICKS_TMP/set-winver.reg <<_EOF_
@@ -212,34 +234,11 @@ load_dcom98() {
#----------------------------------------------------------------
find_program_files()
{
for i in \
"Programme" \
"Program Files" \
"Archivos de programa" \
"Ohjelmatiedostot" \
"Programmi" \
"Programfiler" \
"Arquivos de programas" \
"Programas"; do
if [ -x "$WINEPREFIX/drive_c/$i" ]; then
PROGRAM_FILES=$i;
return 0;
fi
done
echo "Couldn't find program files"
exit 1
}
# Fake IE per workaround in http://bugs.winehq.org/show_bug.cgi?id=3453
# Just the first registry key works for most apps.
# The App Paths part is required by a few apps, like Quickbooks Pro;
# see http://windowsxp.mvps.org/ie/qbooks.htm
# Put iexplore.exe in c:/windows/command as wine.inf can't handle
# c:/Program Files yet.
set_fakeie6() {
find_program_files
cat > $WINETRICKS_TMP/fakeie6.reg <<"_EOF_"
REGEDIT4
@@ -248,21 +247,26 @@ REGEDIT4
"Version"="6.0.2900.2180"
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE]
@="C:\\__PROGRAM_FILES__\\Internet Explorer\\iexplore.exe"
"PATH"="c:\\__PROGRAM_FILES__\\Internet Explorer"
_EOF_
sed -i -e "s/__PROGRAM_FILES__/$PROGRAM_FILES/" $WINETRICKS_TMP/fakeie6.reg
echo -n '@="' >>$WINETRICKS_TMP/fakeie6.reg
echo -n "${programfilesdir_win}" | sed "s/\\\\/\\\\\\\\/" >>$WINETRICKS_TMP/fakeie6.reg
echo '\\\\Internet Explorer\\\\iexplore.exe"' >>$WINETRICKS_TMP/fakeie6.reg
echo -n '"PATH"="' >>$WINETRICKS_TMP/fakeie6.reg
echo -n "${programfilesdir_win}" | sed "s/\\\\/\\\\\\\\/" >>$WINETRICKS_TMP/fakeie6.reg
echo '\\\\Internet Explorer"' >>$WINETRICKS_TMP/fakeie6.reg
try $WINE regedit $WINETRICKS_TMP/fakeie6.reg
# On old wineprefixes iexlore.exe is not created. Create a fake dll using
# On old wineprefixes iexplore.exe is not created. Create a fake dll using
# shdocvw.dll that should have similar VERSIONINFO.
if [ ! -f "$WINEPREFIX/drive_c/$PROGRAM_FILES/Internet Explorer/iexplore.exe" ]; then
if [ ! -f "$programfilesdir_unix/Internet Explorer/iexplore.exe" ]; then
echo "You have an old wineprefix without iexplore.exe. Will create a fake now"
if [ ! -d "$WINEPREFIX/drive_c/$PROGRAM_FILES/Internet Explorer/iexplore.exe" ]; then
try mkdir "$WINEPREFIX/drive_c/$PROGRAM_FILES/Internet Explorer";
if [ ! -d "$programfilesdir_unix/Internet Explorer/iexplore.exe" ]; then
try mkdir "$programfilesdir_unix/Internet Explorer";
fi
try cp -f "$WINEPREFIX/drive_c/windows/system32/shdocvw.dll" "$WINEPREFIX/drive_c/$PROGRAM_FILES/Internet Explorer/iexplore.exe"
try cp -f "$WINEPREFIX/drive_c/windows/system32/shdocvw.dll" "$programfilesdir_unix/Internet Explorer/iexplore.exe"
fi
}
@@ -275,32 +279,30 @@ load_gecko() {
# (e.g. we hardcode gecko's url here, but it's normally
# only hardcoded in wine.inf, and fetched from the registry thereafter,
# so we're adding a maintenance burden here.)
GECKO_VERSION=0.1.0
if ! test -f $WINETRICKS_CACHE/wine_gecko.cab
if ! test -f $WINETRICKS_CACHE/wine_gecko-$GECKO_VERSION.cab
then
download http://source.winehq.org/winegecko.php
download "http://source.winehq.org/winegecko.php?v=$GECKO_VERSION"
fi
# The folder-name is localized!
programfilesdir_win=`$WINE cmd.exe /c echo "%ProgramFiles%"`
programfilesdir_unix=`$WINE winepath -u "$programfilesdir_win"`
cat > $WINETRICKS_TMP/geckopath.reg <<"_EOF_"
cat > $WINETRICKS_TMP/geckopath.reg <<_EOF_
REGEDIT4
[HKEY_CURRENT_USER\Software\Wine\MSHTML]
[HKEY_CURRENT_USER\\Software\\Wine\\MSHTML\\$GECKO_VERSION]
_EOF_
#The registry-entry does not support an environment-variable
# note: echo's behavior with backslashes and options is nonportable,
# see http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html
echo -n '"GeckoPath"="' >>$WINETRICKS_TMP/geckopath.reg
echo -n "${programfilesdir_win}" | sed "s/\\\\/\\\\\\\\/" >>$WINETRICKS_TMP/geckopath.reg
echo -n 'c:\\windows\\gecko\\'$GECKO_VERSION | sed "s/\\\\/\\\\\\\\/g" >>$WINETRICKS_TMP/geckopath.reg
echo '\\\\wine_gecko"' >>$WINETRICKS_TMP/geckopath.reg
# extract the files
cd "$programfilesdir_unix"
try cabextract $WINETRICKS_UNIXQUIET $WINETRICKS_CACHE/wine_gecko.cab
mkdir -p $WINEPREFIX/drive_c/windows/gecko/$GECKO_VERSION
cd $WINEPREFIX/drive_c/windows/gecko/$GECKO_VERSION
try cabextract $WINETRICKS_UNIXQUIET $WINETRICKS_CACHE/wine_gecko-$GECKO_VERSION.cab
cd "$olddir"
# set install-path
@@ -311,14 +313,13 @@ _EOF_
load_gdiplus() {
# gdiplus is documented here as a redistributable:
# http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/GDIPlus.asp
# http://msdn.microsoft.com/library/en-us/gdicpp/GDIPlus/GDIPlus.asp
# however, there's no standalone installer. So install a random
# app that happens to bundle it.
download http://download.microsoft.com/download/a/1/a/a1adc39b-9827-4c7a-890b-91396aed2b86/ppviewer.exe 4d13ca85d1d366167b6247ac7340b7736b1bff87
try $WINE $WINETRICKS_CACHE/ppviewer.exe $WINETRICKS_QUIET
# And then make it globally available.
# FIXME: use localized name for ProgramFiles (see gecko above)
try cp $WINEPREFIX/drive_c/Program\ Files/Microsoft\ Office/PowerPoint\ Viewer/GDIPLUS.DLL $WINEPREFIX/drive_c/windows/system32/
try cp "$programfilesdir_unix/Microsoft Office/PowerPoint Viewer/GDIPLUS.DLL" $WINEPREFIX/drive_c/windows/system32/
}
#----------------------------------------------------------------
@@ -334,8 +335,8 @@ load_jet40() {
load_liberation() {
# http://www.redhat.com/promo/fonts/
download http://www.redhat.com/f/fonts/liberation-fonts-ttf-2.tar.gz c49cae316fa454a10502feb2122e7d3b33ab06d5
tar --wildcards -C $WINEPREFIX/drive_c/windows/fonts -xvzf $WINETRICKS_CACHE/liberation-fonts-ttf-2.tar.gz '*.ttf'
download http://www.redhat.com/f/fonts/liberation-fonts-ttf-3.tar.gz 503fd3c60174b53f59ca41927b72e4a44bab586b
tar --wildcards -C $WINEPREFIX/drive_c/windows/fonts -xvzf $WINETRICKS_CACHE/liberation-fonts-ttf-3.tar.gz '*.ttf'
}
#----------------------------------------------------------------
@@ -498,6 +499,29 @@ load_pdh() {
#----------------------------------------------------------------
volnum() {
# Recent Microsoft installers are often based on "windows package manager", see
# http://support.microsoft.com/kb/262841 and
# http://www.microsoft.com/technet/prodtechnol/windowsserver2003/deployment/winupdte.mspx
# These installers check the drive name, and if it doesn't start with 'harddisk',
# they complain "Unable to find a volume for file extraction", see
# http://bugs.winehq.org/show_bug.cgi?id=5351
# You may be able to work around this by using the installer's /x or /extract switch,
# but renaming drive_c to "harddiskvolume0" lets you just run the installer as normal.
if ! test -d $WINEPREFIX/harddiskvolume0/
then
ln -s drive_c $WINEPREFIX/harddiskvolume0
rm $WINEPREFIX/dosdevices/c:
ln -s ../harddiskvolume0 $WINEPREFIX/dosdevices/c:
echo "Renamed drive_c to harddiskvolume0"
else
echo "drive_c already named harddiskvolume0"
fi
}
#----------------------------------------------------------------
load_tahoma() {
# The tahoma font is needed by e.g. Steam
download http://internap.dl.sourceforge.net/sourceforge/corefonts/wd97vwr32.exe 8edf758f92513094a94e50b7826cd6f2b7696b8c
@@ -652,6 +676,7 @@ do
winver=winxp) set_winver winxp;;
winver=) unset_winver;;
native_mdac) set_native_mdac;;
volnum) volnum;;
*) echo Unknown arg $1; usage;;
esac
# Provide a bit of feedback