It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
This guide is now obsolete, and won’t receive any update nor support.
Please go to the following thread if you want an easy way to install Torchlight on Linux:
https://www.gog.com/forum/torchlight/linux_turn_your_exe_installer_inot_a_deb_package/?search=linux

-----

Original message:

Hi!

While we're waiting for GOG to provide the native GNU/Linux version of this excellent Hack & Slash, we have to find a way to have the Windows version run under our distributions.

This guide will help you to build packages for your distribution from the GOG Windows installer.

The scripts used in this guide make use of unzip, wine (>= 1.5.9), wrestool and icotool.

1. Making packages

This first script will create a folder named "torchlight-data" containing all data needed to run Torchlight. You'll have to change the value of TORCHLIGHT_SETUP to the path to GOG installer :

export TORCHLIGHT_SETUP="/path/to/setup_torchlight_*.exe"
export WINEARCH=wine32
export WINEDEBUG=-all
mkdir $HOME/torchlight-data
cd $HOME/torchlight-data
mkdir install-prefix
export WINEPREFIX=$HOME/torchlight-data/install-prefix
wineboot --init
mkdir -p usr/local/games
cd install-prefix/dosdevices
rm *
ln -s ../drive_c c\:
ln -s ../../usr/local/games d\:
cd d\:
cp "$TORCHLIGHT_SETUP" .
wine "$(basename "$TORCHLIGHT_SETUP")"
cd torchlight
wrestool -t 14 -x Torchlight.exe | icotool -x -
mkdir -p ../../share/icons/hicolor/48x48/apps ../../share/icons/hicolor/32x32/apps ../../share/icons/hicolor/24x24/apps ../../share/icons/hicolor/16x16/apps
for i in 16 24 32 48; do
mv *"$i"x"$i"x8.png ../../share/icons/hicolor/"$i"x"$i"/apps/torchlight.png
done
rm *.png
cd $HOME/torchlight-data
rm -Rf "usr/local/games/$(basename "$TORCHLIGHT_SETUP")" install-prefix $HOME/.local/share/applications/wine/Programs/GOG.com/Torchlight/
find $HOME/.local/share/applications/ -depth -type d -empty -delete
In the installer, click "Options" and untick anything but "Torchlight" and EULA and set the path to "D:\torchlight".

/!\ Don't launch the game at the end of the installation. Click "Exit". /!\

This second script will create the launchers allowing you to play Torchlight on Linux :

mkdir -p $HOME/torchlight/usr/local/bin
cd $HOME/torchlight/usr/local/bin
echo "
#!/bin/sh
export WINEDEBUG=-all
export WINEPREFIX=\$HOME/.torchlight/.wine-prefix
mkdir -p \$HOME/.torchlight/.wine-prefix
export WINEARCH=win32
wineboot --init
cd \$HOME/.torchlight/.wine-prefix/dosdevices/
rm *
ln -s ../drive_c c\:
mkdir \$HOME/.torchlight/.wine-prefix/dosdevices/d\:
ln -s \$HOME/.torchlight \$HOME/.torchlight/.wine-prefix/dosdevices/d\:/torchlight
cd \$HOME/.torchlight/
ln -s /usr/local/games/torchlight/* .
rm *.cfg
cp /usr/local/games/torchlight/*.cfg ." > torchlight-init
echo "
#!/bin/sh
export WINEDEBUG=-all
export WINEPREFIX=\$HOME/.torchlight/.wine-prefix
if ! [ -d ~/.torchlight ]; then
sh /usr/local/bin/torchlight-init
fi
cd \$HOME/.torchlight/.wine-prefix/dosdevices/d\:/torchlight
wine Torchlight.exe" > torchlight
chmod a+x *
cd ..
mkdir -p share/applications
echo "[Desktop Entry]
Type=Application
Version=1.0
Name=Torchlight
Icon=torchlight
Exec=torchlight
Categories=Application;Game;" > share/applications/torchlight.desktop
2. Building the packages

As for now there are scripts only for .deb packages (Debian, Ubuntu, Linux Mint...).
More may come later as I learn how to do it (or sooner if you know how to package in other formats and post the method here).

.deb packages

These scripts use fakeroot.

cd $HOME/torchlight-data
mkdir DEBIAN
echo "Package: torchlight-data
Version: 1
Section: non-free
Priority: extra
Architecture: all
Depends:
Installed-Size: 445604
Maintainer: local build
Description: Torchlight - data" > DEBIAN/control
cd $HOME
fakeroot dpkg-deb --build torchlight-data
rm -Rf torchlight-data/
This first build might take some time, the package is around 400M.

cd $HOME/torchlight
mkdir DEBIAN
echo "Package: torchlight
Version: 1
Section: contrib
Priority: extra
Architecture: all
Depends: torchlight-data, wine | wine-unstable | wine:i386 | wine-unstable:i386
Installed-Size: 36
Maintainer: local build
Description: Torchlight - binaries" > DEBIAN/control
cd $HOME
fakeroot dpkg-deb --build torchlight
rm -Rf torchlight/
You can install the resulting packages by launching (as root) :

dpkg -i torchlight-data.deb
dpkg -i torchlight.deb
apt-get install -f
Enjoy!

-----

You can't add any mod to the game installed via this guide yet (actually I haven't tried). I'm going to work into this and update the guide as soon as I find a clean to way to allow modding.

If there is any legal way to find the GNU/Linux binaries (maybe they're included in some patch for the Linux version), please telle me and I'll try to find a way to create a native version from the GOG Windows installer and the Linux binaries.

-----

Please tell me if something doesn't work on your distribution.

-----

More guides can be found there :
https://secure.gog.com/mix/guides_to_install_gog_games_on_gnulinux
Post edited April 10, 2015 by vv221