Bn3t

From Mage
Jump to navigation Jump to search

How to install Battle.net quickly and easily, even for a secondary user. The code for bn3t is freely available on Psi, our Git repository.


Prerequisites

If you plan on running Battle.net under its own user account, create it first . This document will assume you created a user named "battleuser". Make sure your primary user can do sudo commands as the secondary user, of the form of:

sudo -u battleuser -- *

This isn't required as you can run the bn3t script in a single-user setup , but this script is vastly overkill for that.

If you're using PulseAudio you may need to allow multiple users to use it at the same time.



Setup

First you'll need to download the bn3t script. It's a bash script that handles half of the logic for maintaining a Battle.net install, which can download the secondary script under the account of your choosing. I recommend installing Wine applications under their own user accounts, so if something goes horribly wrong in the app itself it's easy to kill the whole stack. It also has security benefits as the application can be denied access to your primary user's files.

As an aside, you should never just download and run scripts. For the love of $DEITY at least glance through the code before blindly running it. The latest versions of both can be found here.

Download bn3t scripts

wget https://psi.cynop.me/Caffarius/bn3t/raw/branch/master/bn3t.sh -O ./bn3t.sh
chmod 700 ./bn3t.sh
./bn3t.sh -u battleuser -i

Wineboot/Install DXVK/Setup Battle.net

./bn3t.sh -u battleuser -bxs


Running Battle.net

Just launch Battle.net

./bn3t.sh -u battleuser

Hide to tray (for startup)

./bn3t.sh -u battleuser -t


Running games

To launch a game after you've installed Battle.net and aforementioned game, run the following command:

./bn3t.sh -u battleuser -g test

Substituting "test" for the game of you choice (unless you like glxgears). See -g for the game selections.


So for example, World of WarCraft would be:

./bn3t.sh -u battleuser -g wow


Doing Wonky Things

Certain actions can be processed in the conditional loop. For example, if you wanted to install Battle.net into multiple prefixes for some reason:

./bn3t.sh -u battleuser -p /home/battleuser/1-bnet -bxs -p /home/battleuser/2-bnet -bxs

Or run winetricks three times in a row:

./bn3t.sh -u battleuser -www


Single-user

If you must...

Download and install

wget https://psi.cynop.me/Caffarius/bn3t/raw/branch/master/bn3t.sh -O ./bn3t.sh
chmod 700 ./bn3t.sh
./bn3t.sh -i

Setup Battle.net

./bn3t.sh -bxs

Run Battle.net

./bn3t.sh

Launch Battle.net to tray

./bn3t.sh -t

Launch a game

See -g for the game selections.

./bn3t.sh -g wow


Script options

Usage: ./bn3t.sh -g (game) -u (user) -p (prefix) -a (arch) -dvksbwtnchxi

-g

Launches the game of your choice. Test will launch glxgears.

./bn3t.sh -g test
Game List
Game -g (game) names
glxgears test
Hearthstone wtcg hearth hearthstone hs
Diablo 3 d3 diablo3
StarCraft II sc2 starcraft2
StarCraft sc starcraft
World of WarCraft wow worldofwarcraft
Heroes of the Storm hero heros hots
Overwatch pro ow overwatch
Destiny 2 dst2 destiny2

-u

Runs Battle.net as the user that is specified.

./bn3t.sh -u battleuser

-p

Sets the WINEPREFIX to try to run Battle.net under. By default, this will use:

./bn3t.sh -p /home/${runas_user}/.bnet

-a

Sets the WINEARCH that Battle.net will run under. Options include 32 for 32-bit support and 64 for 64-bit support.

./bn3t.sh -a 64

-d

Turns the debug messages on. This also turns on the verbose messages. Debug is the most verbose setting, offering the slowest performance but the most diagnostic output. Unlike verbose, debug also turns on the debug output of Wine/wineboot/Setup/DXVK upgrades.

./bn3t.sh -d

-v

Turns on verbose messages. This option is redundant if debug is also selected. Shows more script output and also gives the messaging for winetricks.

./bn3t.sh -v

-k

Kill all processes for a user (if it isn't the current user or root). Comes in very handy if something's going wrong and you're running Battle.net as suggested under a secondary user account. Instead of being stuck at a frozen whatever, murder it all.

./bn3t.sh -u battleuser -k

-s

Runs Battle.net setup from /tmp/Battle.net-Setup.exe. If this file does not exist, it will attempt to download it.

./bn3t.sh -s

-b

Wineboot mode. Runs wineboot at the requested prefix (SPECIFY THE PREFIX FIRST IF USING A CUSTOM ONE!). By default this is: /home/${runas_user}/.bnet

./bn3t.sh -p /home/${runas_user}/.bnet -b

-w

Winetricks mode. Runs winetricks under the requested prefix.

./bn3t.sh -w

-m

Twitch Client mode. Runs the Twitch client (and installs it if necessary). Twitch requires .NET to be installed beforehand and Mono seems to have some issues. Make sure to install dotnet472 via winetricks before running Twitch.

./bn3t.sh -m

-t

Attempts to hide Battle.net to the system tray on launch. Specifically for auto-start launches. This is the default action when selecting "Launch Battle.net minimized to the system tray" in Battle.net Settings under Windows upon login.

./bn3t.sh -t

-n

No BS mode. Forcibly doesn't launch an application. Will not launch Battle.net and will ignore any games selected (even test). Useful for the paranoid when running winetricks/wineboot/setup/et al (in fact, bn3t-run will auto-set this when some modes are selected). Often superfluous.

./bn3t.sh -n

-c

Launch a console session as the specified user. This session is dbus connected and setup via xhost, so it's completely capable of launching games and other GUI applications as the specified user.

./bn3t.sh -u battleuser -c

-h

Displays the help message. Basically a less verbose version of this page.

./bn3t.sh -h

-x

Forcibly upgrades DXVK in the specified prefix. DXVK is updated often and can bring very useful performance and functionality upgrades to your Wine install. To force a DXVK upgrade, run:

./bn3t.sh -x

-i

Install the secondary script, bn3t-run. The first script you download basically handles when to clean up extra processes and sanitize input for bn3t-run. The -i option will download and configure the bn3t-run script automatically. By default, bn3t will download this to /home/${runas_user}/.script/bn3t-run.sh.

./bn3t.sh -i