Spotify on Linux: Easy Edition

Here's a script I just wrote that installs Spotify on Linux with Wine. Works great with Wine 1.3.24 on Gentoo Linux x86_64 with PulseAudio (which works great and isn't choppy or anything).

P.S. In the Spotify installer, don't tell it to start when done.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

# Download spotify and winetricks
wget http://download.spotify.com/Spotify%20Installer.exe -O /tmp/spotify.exe
wget http://winetricks.org/winetricks -O /tmp/winetricks
chmod +x /tmp/winetricks

# Configure $WINEPREFIX
export WINEPREFIX="$HOME/.wine-spotify"
wineboot

# Set some various registry keys (Spotify recommends you use 44100/Emulation)
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\Drivers /v Audio /t REG_SZ /d pulse /f
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DirectSound /v DefaultSampleRate /t REG_SZ /d 44100 /f
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DirectSound /v HardwareAcceleration /t REG_SZ /d Emulation /f

# Install some required packages (IE6 may provide WinInet, if so then it's safe to remove that)
/tmp/winetricks wininet ie6 corefonts tahoma winhttp wmp10 secur32

# Copy the WMP10 MP3 decoder on top of Wine's, tell Wine to use it instead.
cp -fv $WINEPREFIX/drive_c/windows/system32/l3codecp.acm $WINEPREFIX/drive_c/windows/system32/winemp3.acm
wine reg add HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides /v winemp3.acm /t REG_SZ /d native,builtin /f

# Install Spotify.
wine /tmp/spotify.exe

# Remove temporary files
rm /tmp/spotify.exe
rm /tmp/winetricks