Forum

[script] Winamp

Författare Svar
NSLW Monday 21 September 2009 at 9:27
NSLW

Hello,
I wrote script which installs Winamp
Wine version : 1.1.29
Distribution : Fedora
Distribution Version : 11 (32 bit)
Graphics card : Nvidia, GeForce 9xxx
Drivers of the graphics card : 190.32

Icon for the game:


#!/bin/bash
# Date : (2009-09-21 09-00)
# Last revision : (2009-09-21 09-00)
# Wine version used : 1.1.29
# Distribution used to test : Fedora 11
# Author : NSLW
# Licence : Freeware

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}

TYTUL="Winamp"
PREFIX="Winamp"
WINAMPVER="556"
WORKINGWINEVERSION="1.1.29"

LNG_VERQUESTION="Which $TYTUL would you like to install?"
LNG_OWNVER="I've got my own installation file."
LNG_SETUPSEL="Select $TYTUL setup file"
LNG_WHICHLANG="Which language version would you like to install?"
LNG_DOWNLOADING="PlayOnLinux is downloading"
LNG_DOWNLOADINGANDINSTALLING="PlayOnLinux is downloading and installing"
LNG_INSTALLING="PlayOnLinux is installing"
LNG_DIBENGINE="Do you want to use DIB Engine (improves Media Library performance)?"
LNG_SUCCES="$TYTUL has been installed successfully"
LNG_ONLYDIVXCODECS="Please install only \\"DivX Codec\\" component"

POL_SetupWindow_make_icon_for_shortcut()
{
convert "$HOME/.local/share/icons/$2" -geometry 32X32 "$REPERTOIRE/icones/32/$1"
}

Get_Latest_Wine_Version()
{
wget http://mulx.playonlinux.com/wine/linux-i386/LIST --output-document="$REPERTOIRE/tmp/LIST"
xyz=`cat "$REPERTOIRE/tmp/LIST" | sed -e 's/\\.//g' | cut -d';' -f2 | sort -n | tail -n1`
echo "$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
}

download_DIBEngine()
{
cd "$REPERTOIRE/ressources/"
if [ ! -e "$REPERTOIRE/ressources/$WORKINGWINEVERSION-mod.zip" ]; then
POL_SetupWindow_download "Downloading DIB Engine" "$TYTUL" "http://www.sigmirror.com/files/30883_5ku8k/$WORKINGWINEVERSION-mod.zip"
fi
cd "$WINEPREFIX/drive_c/windows/temp/"
unzip "$REPERTOIRE/ressources/$WORKINGWINEVERSION-mod.zip"
./$WORKINGWINEVERSION-mod -y
cp dibengine/* ./
}

prepare_patched_WineVersion()
{
POL_SetupWindow_install_wine "$1"
cd "$REPERTOIRE/WineVersions"
POL_SetupWindow_wait_next_signal "Removing old WineVersion" "$TYTUL"
rm -fr "$1-$PREFIX"
POL_SetupWindow_detect_exit
 
POL_SetupWindow_wait_next_signal "Copying WineVersion" "$TYTUL"
cp -r "$1" "$1-$PREFIX"
rm -fr "$REPERTOIRE/WineVersions/$1-$PREFIX/usr/lib/wine/gdi32.dll.so"
cp "$WINEPREFIX/drive_c/windows/temp/gdi32.dll.so" "$REPERTOIRE/WineVersions/$1-$PREFIX/usr/lib/wine/gdi32.dll.so"
cp "$WINEPREFIX/drive_c/windows/temp/winedib.drv.so" "$REPERTOIRE/WineVersions/$1-$PREFIX/usr/lib/wine/winedib.drv.so"
POL_SetupWindow_detect_exit
}

POL_SetupWindow_Init
POL_SetupWindow_presentation "$TYTUL" "Nullsoft" "www.winamp.com" "NSLW" "$PREFIX" 

POL_SetupWindow_menu "$LNG_VERQUESTION" "$TYTUL" "Full~Bundle~Lite~Pro~$LNG_OWNVER" "~"
if [ "$APP_ANSWER" == "$LNG_OWNVER" ]; then
WINAMPFILE="$APP_ANSWER"
POL_SetupWindow_browse "$LNG_SETUPSEL" ""
else
	if [ "$APP_ANSWER" == "Full" ]; then
	NAMEENDING="full_emusic-7plus"
	elif [ "$APP_ANSWER" == "Bundle" ]
	then
	NAMEENDING="full_bundle_emusic-7plus"
	elif [ "$APP_ANSWER" == "Lite" ]
	then
	NAMEENDING="lite"
	elif [ "$APP_ANSWER" == "Pro" ]
	then
	NAMEENDING="pro"
	fi

	POL_SetupWindow_menu "$LNG_WHICHLANG" "$TYTUL" "English~Simplified Chinese~Traditional Chinese~Deutsch~Español~Français~Italiano~Japanese~Korean~Nederlands~Polski~Русский~Svenska~Turkish~Brazilian Portuguese~Romanian" "~"
	if [ "$APP_ANSWER" == "English" ]; then
	WINAMPLANGSHRT="all"
	elif [ "$APP_ANSWER" == "Simplified Chinese" ]
	then
	WINAMPLANGSHRT="zh-cn"
	elif [ "$APP_ANSWER" == "Traditional Chinese" ]
	then
	WINAMPLANGSHRT="zh-tw"
	elif [ "$APP_ANSWER" == "Deutsch" ]
	then
	WINAMPLANGSHRT="de-de"
	elif [ "$APP_ANSWER" == "Español" ]
	then
	WINAMPLANGSHRT="es-us"
	elif [ "$APP_ANSWER" == "Français" ]
	then
	WINAMPLANGSHRT="fr-fr"
	elif [ "$APP_ANSWER" == "Italiano" ]
	then
	WINAMPLANGSHRT="it-it"
	elif [ "$APP_ANSWER" == "Japanese" ]
	then
	WINAMPLANGSHRT="ja-jp"
	elif [ "$APP_ANSWER" == "Korean" ]
	then
	WINAMPLANGSHRT="ko-kr"
	elif [ "$APP_ANSWER" == "Nederlands" ]
	then
	WINAMPLANGSHRT="nl-nl"
	elif [ "$APP_ANSWER" == "Polski" ]
	then
	WINAMPLANGSHRT="pl-pl"
	elif [ "$APP_ANSWER" == "Русский" ]
	then
	WINAMPLANGSHRT="ru-ru"
	elif [ "$APP_ANSWER" == "Svenska" ]
	then
	WINAMPLANGSHRT="sv-se"
	elif [ "$APP_ANSWER" == "Turkish" ]
	then
	WINAMPLANGSHRT="tr-tr"
	elif [ "$APP_ANSWER" == "Brazilian Portuguese" ]
	then
	WINAMPLANGSHRT="pt-br"
	elif [ "$APP_ANSWER" == "Romanian" ]
	then
	WINAMPLANGSHRT="ro-ro"
	fi

	echo "$WINAMPLANGSHRT"
	WINAMPFILE="winamp${WINAMPVER}_${NAMEENDING}_${WINAMPLANGSHRT}.exe"
	echo "$WINAMPFILE"

	cd "$REPERTOIRE/ressources"
	#checking if Winamp is in ressources
	if [ ! -e "$WINAMPFILE" ]; then
	POL_SetupWindow_download "$LNG_DOWNLOADING $WINAMPFILE" "$TYTUL" "http://download.nullsoft.com/winamp/client/$WINAMPFILE"
	fi
fi

	select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
	LATESTVERSION=$(Get_Latest_Wine_Version)
	CHOSENWINEVERSION=$LATESTVERSION
	POL_SetupWindow_install_wine "$CHOSENWINEVERSION"
	Use_WineVersion "$CHOSENWINEVERSION"
	POL_SetupWindow_prefixcreate

cd "$REPERTOIRE/ressources"
if [ "`sha1sum < winetricks | sed 's/ .*//'`" != "153de6c6a751bee53e0125bd93a7e77e76d3d452" ]; then
wget http://winezeug.googlecode.com/svn/trunk/winetricks --output-document=winetricks
fi

mkdir "$HOME/.winetrickscache"
cd "$HOME/.winetrickscache"

# checking if 3725.exe is in winetricks cache if not then download
if [ ! -e "3725.exe" ]
then
POL_SetupWindow_download "$LNG_DOWNLOADING wininet.dll" "$TYTUL" "http://download.microsoft.com/download/ie5/Update/1/WIN98/EN-US/3725.exe"
fi

# checking if cc32inst.exe is in winetricks cache if not then download
if [ ! -e "cc32inst.exe" ]
then
POL_SetupWindow_download "$LNG_DOWNLOADING MS common controls 5.80" "$TYTUL" "http://download.microsoft.com/download/platformsdk/redist/5.80.2614.3600/w9xnt4/en-us/cc32inst.exe"
fi

mkdir "$HOME/.winetrickscache/divx-7"
cd "$HOME/.winetrickscache/divx-7"
# checking if DivXInstaller.exe is in winetricks cache if not then download
if [ ! -e "DivXInstaller.exe" ]
then
POL_SetupWindow_download "$LNG_DOWNLOADING DivX codecs" "$TYTUL" "http://download.divx.com/divx/DivXInstaller.exe"
fi

cd "$REPERTOIRE/ressources"
#installing ie6
POL_SetupWindow_wait_next_signal "$LNG_DOWNLOADINGANDINSTALLING Internet Explorer 6\\n\\nPlease be patient ca. 12 MB is being downloaded." "$TYTUL"
bash winetricks -q ie6
POL_SetupWindow_detect_exit

#installing ffdshow (IMO codecs are causing unhandeled exceptions)
#POL_SetupWindow_wait_next_signal "$LNG_DOWNLOADINGANDINSTALLING ffdshow codecs\\n\\nPlease be patient ca. 4 MB is being downloaded." "$TYTUL"
#bash winetricks -q ffdshow
#POL_SetupWindow_detect_exit

#installing wininet
POL_SetupWindow_wait_next_signal "$LNG_INSTALLING wininet.dll" "$TYTUL"
bash winetricks -q wininet
POL_SetupWindow_detect_exit

#installing cc32inst.exe
POL_SetupWindow_wait_next_signal "$LNG_INSTALLING MS common controls 5.80" "$TYTUL"
bash winetricks -q cc580
POL_SetupWindow_detect_exit

#temporary fix
cd "$WINEPREFIX/drive_c/windows/temp"
cat "$REPERTOIRE/ressources/winetricks" | sed -e 's/786aef0f421df5e7358d2d740d9911f9afd055de/ad420bf8bf72e924e658c9c6ad6bba76b848fb79/' > winetricks

POL_SetupWindow_message_image "$LNG_ONLYDIVXCODECS" "$TYTUL" "/usr/share/playonlinux/themes/tango/info.png"
#installing DivX
POL_SetupWindow_wait_next_signal "$LNG_INSTALLING DivX codecs" "$TYTUL"
bash winetricks -q divx
POL_SetupWindow_detect_exit

cd "$REPERTOIRE/ressources"
#installing Winamp
POL_SetupWindow_wait_next_signal "$LNG_INSTALLING $WINAMPFILE" "$TYTUL"
wine "$WINAMPFILE"
POL_SetupWindow_detect_exit

POL_SetupWindow_reboot

#asking about DIB Engine
POL_SetupWindow_question "$LNG_DIBENGINE" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ] ;then
	CHOSENWINEVERSION=$LATESTVERSION-$PREFIX
	download_DIBEngine
	prepare_patched_WineVersion "$LATESTVERSION"
	cd "$WINEPREFIX/drive_c/windows/temp/" 
	echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DIB Engine]" > dib.reg
	echo "\\"Enable\\"=\\"Y\\"" >> dib.reg
	regedit dib.reg
fi

POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Winamp" "winamp.exe" "" "$TYTUL" "" ""
POL_SetupWindow_make_icon_for_shortcut "$TYTUL" "0e5b_winamp.0.png"
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"

POL_SetupWindow_message "$LNG_SUCCES" "$TYTUL"

POL_SetupWindow_Close
exit

Ändrat av NSLW

grohino Thursday 24 May 2012 at 9:29
grohinoAnonymous

Hi,

Thank you for this script!
Can you tell us what version of winamp can work?
I saw there (http://www.wine-reviews.net/applications/winamp-55-on-linux-with-wine.html) that Winamp 5.5 is fine.

By the way, I'm asking another question.
I want to install Winamp on a iMac I just bought, and use PlayonMac (wich seems to be the best way for running winamp).
You wrote à script for PlayOnLinux. Does your script work with PlayOnMac, and what is the way to make this work?

Thank you for time/answer,

have à nice day!

Grohino
Quentin PÂRIS Thursday 24 May 2012 at 12:36
Quentin PÂRIS
Admin

Do not use this script! It's out to date, and it won't work.

I will rewrite a winamp script if you want soon