Difference between revisions of "Linux Installation Guide"

From BTAWiki
Jump to navigation Jump to search
(Updated troubleshooting)
Line 1: Line 1:
 
<div id="" class="" style="clear: right; margin: -1em 0 0 10px; float: right; padding: 10px; background: transparent; width: 200px; ">__TOC__</div>
 
<div id="" class="" style="clear: right; margin: -1em 0 0 10px; float: right; padding: 10px; background: transparent; width: 200px; ">__TOC__</div>
  
'''Thanks to Indigo for writing this guide!'''
+
This guide assumes you are running the native linux version BattleTech. If you installed the windows version and got it running through wine, parts of this guide may still be helpful, but it won't work exactly step by step.
  
This guide assumes you are using the native Linux version of BattleTech. If you installed the Windows version, got it running with Proton, and successfully installed BTA, please write up a document similar to this one for your scenario.
+
= 1. Preparation. =
 +
All of these steps are necessary. Seriously, don't skip them - you'll get weird errors later on even if installing the mod seems to succeed at first.
  
= 1. Prepare =
+
== 1.1. Install Wine and winetricks ==
 +
You'll need to install Wine in order to run the installer. On debian-based systems (such as Ubuntu), you can install it with
  
== 1.1. Set some vars we’ll need later to avoid typos ==
+
$ sudo apt-get install wine winetricks
  
Double-check these paths with your local installation, they may be different.
+
Other distributions will have their own commands along similar lines.
  
$ BTA_ROOT="$HOME/src/BATTLETECH/BTA"
+
== 1.2. Install dotnet 4.7.2 ==
=== Steam on Debian ===
+
Installing BTA also requires dotnet 4.7.2. If you fail to install dotnet, you won't notice issues until you try to actually run the game. '''Do not skip this step'''.
  
  $ BT_ROOT="$HOME/.steam/debian-installation/steamapps/common/BATTLETECH"
+
  $ winetricks dotnet472
=== Steam on other distros ===
+
== 1.3. Raising the open files limit ==
 +
Most distributions default to a limit of 1024 open files at once, but you'll need to raise this for your user by editing /etc/security/limits.conf
  
Check your <code>$HOME/.steam</code> directory and modify the above environment variable assignment accordingly.
+
$ sudo nano /etc/security/limits.conf
  
=== GOG ===
+
Insert these lines at the bottom of the file:
  
  $ BT_ROOT="$HOME/GOG Games/BATTLETECH"
+
  *              hard    nofile          32768
== 1.2. Ensure dependencies are installed ==
+
*              soft    nofile          32768
  
{| class="wikitable"
+
You'll need to log out and log back in, or restart your computer for this change to take effect.
! Package*
 
! Purpose
 
|-
 
| wine
 
| run the installer
 
|-
 
| unzip
 
| unzip the installer package
 
|-
 
| jq
 
| allow pathfinder.sh to parse JSON
 
|}
 
  
<nowiki>*</nowiki> Package name may differ on your distribution.
+
= 2. Install BTA =
 
+
== 2.1. Locate your BattleTech install and create Mods directory ==
=== Debian &amp; Friends (Ubuntu, Mint, Pop_OS!, PureOS) ===
 
 
 
$ sudo apt install wine unzip jq
 
=== RedHat &amp; Friends (Fedora, SuSe) ===
 
 
 
$ sudo dnf install wine unzip jq
 
=== Arch &amp; Friends (Manjaro, GamerOS) ===
 
  
$ sudo pacman -S wine unzip jq
+
For Steam on Debian-based distributions, BattleTech is installed at ~/.steam/debian-installation/steamapps/common/BATTLETECH.
== 1.3. Prepare Wine prefix for the BTA installer. ==
 
  
The wine-mono package listed here is for reference only. You can get the most recent version from https://dl.winehq.org/wine/wine-mono/.
+
For GOG installs, the path will be something like `~/GOG Games/BATTLETECH/game`.
 
 
$ mkdir -p "${BTA_ROOT}"
 
$ cd "${BTA_ROOT}"
 
$ wget https://dl.winehq.org/wine/wine-mono/6.1.0/wine-mono-6.1.0-x86.msi
 
$ WINEPREFIX="${BTA_ROOT}/wine64" WINEARCH=win64 wine msiexec /i wine-mono-6.1.0-x86.msi
 
== 1.4. Download the BTA installer and Extract the .zip into <code>${BTA_ROOT}</code> ==
 
 
 
You’ll have to manually download the [https://www.bta3062.com/files/BTAdvancedLauncher.php installer] from BTA3062.com. Save it to your <code>${BTA_ROOT}</code>. Then unzip it.
 
 
 
'''Note:''' The file name for the Launcher may change in the future, adjust the below example to the correct file name as necessary.
 
 
 
$ unzip 'BattleTech Advanced 3062 Installer-452-v10-4-1624553953.zip'
 
 
 
== 1.5. Prepare the Mods directory ==
 
 
 
If you try to run BTA alongside other mods, problems are likely. If the Mods directory already exists, back it up (optional), and delete it.
 
 
 
Clean up and create the Mods directory:
 
 
 
$ rm -rf "${BT_ROOT}/Mods"
 
$ mkdir -p "${BT_ROOT}/Mods"
 
== 1.6. Collect paths for the BTA installer ==
 
 
 
The installer needs to know where to install to. It does not know how to browse into Linux “hidden” paths (such as $HOME/.steam). Instead, you must copy and paste paths into the installer’s file/directory chooser after clicking the “Browse” button.
 
 
 
Also, the installer cannot parse Linux paths. You must convert them to Windows paths and include the Windows drive letter <code>Z:</code>, which is where wine mounts the Linux filesystem as if it were a Windows filesystem.
 
 
 
Collect those Windows paths:
 
 
 
=== Install Target path ===
 
 
 
Examples:
 
 
 
$ echo "Z:${BT_ROOT}/Mods" | sed -e 's#/#\\#g'
 
Z:\home\indigo\.steam\debian-installation\steamapps\common\BATTLETECH\Mods
 
=== Checkout Workspace path ===
 
 
 
$ echo "Z:${BTA_ROOT}" | sed -e 's#/#\\#g'
 
Z:\home\indigo\src\BATTLETECH\BTA
 
=== BattleTech.exe Binary path ===
 
 
 
$ echo "Z:${BT_ROOT}/BattleTech" | sed -e 's#/#\\#g'
 
Z:\home\indigo\.steam\debian-installation\steamapps\common\BATTLETECH\BattleTech
 
= 2. Install BTA =
 
  
== 2.1. Run the installer ==
+
You want the folder containing the BattleTech binary and a folder for BattleTech_Data. For example, on my system:
  
  $ WINEPREFIX="${BTA_ROOT}/wine64" WINEARCH=win64 wine BTAdvancedLauncher.exe
+
  $ ls -l ~/Games/BATTLETECH/game
== 2.2. Click the “Advanced Mode” button. ==
+
total 27788
 +
-rwxrwxr-x  1 bluewinds bluewinds 27147344 Dec 22 13:35 BattleTech
 +
drwx------  8 bluewinds bluewinds    20480 Dec 22 13:49 BattleTech_Data
 +
...more stuff...
  
'''''Click'''''
+
In this directory, you'll need to create a Mods folder.
  
== 2.3. Input the Install Target and Checkout Workspace paths ==
+
mkdir ~/Games/BATTLETECH/game/Mods
  
Click the “Browse” button next to each path and copy/paste the Windows paths you made in step 1.6 into the “Filename” field of the file picker.
+
== 2.2. Setup an installer directory and download the installer. ==
 +
You will need a directory to host the installer and cache '''outside the game directory'''. For purposes of this guide, we'll use BTAInstaller in your home directory, but feel free to use any other location outside of the game directory (and outside of .steam).
  
== 2.4. Run the install ==
+
This location will need at least 40gb of free space. The cache is big.
  
Click the “Update/Install BTA” button. Pay attention to any popups or instructions.
+
$ mkdir ~/BTAInstaller
 +
$ cd ~/BTAInstaller
  
== 2.5. Choose your Advanced Configuration Options ==
+
Download the installer into this directory and unzip it, either using [this link](https://www.bta3062.com/files/BTAdvancedLauncher.php) or by running:
  
Select all the things you want to install. '''You must disable Corgi's PerfFix in order to avoid infinite loading bugs'''. Make sure Fire Option for Linux Users is set to “Old Fire for Linux Users”
+
$ wget https://www.bta3062.com/files/BTAdvancedLauncher.php -O BTAdvancedLauncher.zip
 +
$ unzip BTAdvancedLauncher.zip
  
== 2.6. Wait for it. ==
+
You should end up with BTAdvancedLauncher.exe in your install folder.
  
After installing the mod, the installer will install ModTek. ModTek needs to know where your BattleTech binary lives. The installer cannot find BattleTech.exe and will ask you where to find it. Give it the “BattleTech.exe Binary path” collected earlier. It will not complain when there is not <code>.exe</code> extension on the filename.
+
$ ls -l ~/BTAInstaller
  
== 2.7. Ensure all the paths and symlinks are correct ==
+
-rw-rw-rw- 1 bluewinds bluewinds 42516095 Jan  6 17:14 BTAdvancedLauncher.exe
'''Note:''' This step may not be necessary, depending on your distribution.
+
-rw-rw-r-- 1 bluewinds bluewinds 42295941 Feb  3 13:57 BTAdvancedLauncher.zip
  
At this point the installation for Windows is complete. However, you’re not done. Because HBS was kind enough to provide us with a native binary, and because BTA’s installer runs as if it were a Windows program, we have to create some symlinks to make sure BattleTech can see all the mod files.
+
== 2.3 Configure the installer ==
 +
Run the BTAInstaller:
  
Thankfully some magical creature named “b2cc” has written a script to do this for us. The script is called “pathfinder.sh”. Download and run it.
+
$ wine ~/BTAInstaller/BTAdvancedLauncher.exe
  
$ cd ${BT_ROOT}
+
At the bottom left of the installer, click "Advanced Mode".
$ wget https://gist.githubusercontent.com/b2cc/c312bec251aaecbfedd07e4d4bda512e/raw/f7fdaa5bc458372b421a6a207e93c4d9ea257901/pathfinder.sh
 
$ less pathfinder.sh  # its up to you to make sure script doesn't do anything naughty!
 
$ bash pathfinder.sh -c
 
You should see a lot of console spam and green success words.
 
  
If you do not, ask for help.
+
You can then edit the "Install Target". Hit "Browse", and navigate to the location of the Mods folder you created in step 2.1.
 +
Also edit the "Checkout Workspace". Hit "Browse", and navigate to the installer directory you created in step 2.2.
  
= 3. Okay, that’s it. =
+
== 2.4 Install! ==
 +
You can now click "Update/Install BTA" to start the process.
  
All done. Run the game. Assuming all went well, you can go stomp around and get your dakka dakka pew pew on.
+
When prompted to configure your game, be sure to select "Old Fire / Linux" at the bottom. Select *only* the addons for DLC you own - enabling addons for DLC you haven't installed will lock up the game when you try to play. Multithreading and Corgi's Perfix can improve performance.
  
If for whatever reason things are not working, check the Troubleshooting section.
+
When it asks for the location of the BattleTech Binary ("Unable to locate BattleTech.exe"), navigate to your BattleTech install (see step 2.1) and select the "BattleTech" file.
  
  

Revision as of 06:30, 9 February 2022

This guide assumes you are running the native linux version BattleTech. If you installed the windows version and got it running through wine, parts of this guide may still be helpful, but it won't work exactly step by step.

1. Preparation.

All of these steps are necessary. Seriously, don't skip them - you'll get weird errors later on even if installing the mod seems to succeed at first.

1.1. Install Wine and winetricks

You'll need to install Wine in order to run the installer. On debian-based systems (such as Ubuntu), you can install it with

$ sudo apt-get install wine winetricks

Other distributions will have their own commands along similar lines.

1.2. Install dotnet 4.7.2

Installing BTA also requires dotnet 4.7.2. If you fail to install dotnet, you won't notice issues until you try to actually run the game. Do not skip this step.

$ winetricks dotnet472

1.3. Raising the open files limit

Most distributions default to a limit of 1024 open files at once, but you'll need to raise this for your user by editing /etc/security/limits.conf

$ sudo nano /etc/security/limits.conf

Insert these lines at the bottom of the file:

*               hard    nofile          32768
*               soft    nofile          32768

You'll need to log out and log back in, or restart your computer for this change to take effect.

2. Install BTA

2.1. Locate your BattleTech install and create Mods directory

For Steam on Debian-based distributions, BattleTech is installed at ~/.steam/debian-installation/steamapps/common/BATTLETECH.

For GOG installs, the path will be something like `~/GOG Games/BATTLETECH/game`.

You want the folder containing the BattleTech binary and a folder for BattleTech_Data. For example, on my system:

$ ls -l ~/Games/BATTLETECH/game
total 27788
-rwxrwxr-x   1 bluewinds bluewinds 27147344 Dec 22 13:35 BattleTech
drwx------   8 bluewinds bluewinds    20480 Dec 22 13:49 BattleTech_Data
...more stuff...

In this directory, you'll need to create a Mods folder.

mkdir ~/Games/BATTLETECH/game/Mods

2.2. Setup an installer directory and download the installer.

You will need a directory to host the installer and cache outside the game directory. For purposes of this guide, we'll use BTAInstaller in your home directory, but feel free to use any other location outside of the game directory (and outside of .steam).

This location will need at least 40gb of free space. The cache is big.

$ mkdir ~/BTAInstaller
$ cd ~/BTAInstaller

Download the installer into this directory and unzip it, either using [this link](https://www.bta3062.com/files/BTAdvancedLauncher.php) or by running:

$ wget https://www.bta3062.com/files/BTAdvancedLauncher.php -O BTAdvancedLauncher.zip
$ unzip BTAdvancedLauncher.zip

You should end up with BTAdvancedLauncher.exe in your install folder.

$ ls -l ~/BTAInstaller
-rw-rw-rw- 1 bluewinds bluewinds 42516095 Jan  6 17:14 BTAdvancedLauncher.exe
-rw-rw-r-- 1 bluewinds bluewinds 42295941 Feb  3 13:57 BTAdvancedLauncher.zip

2.3 Configure the installer

Run the BTAInstaller:

$ wine ~/BTAInstaller/BTAdvancedLauncher.exe

At the bottom left of the installer, click "Advanced Mode".

You can then edit the "Install Target". Hit "Browse", and navigate to the location of the Mods folder you created in step 2.1. Also edit the "Checkout Workspace". Hit "Browse", and navigate to the installer directory you created in step 2.2.

2.4 Install!

You can now click "Update/Install BTA" to start the process.

When prompted to configure your game, be sure to select "Old Fire / Linux" at the bottom. Select *only* the addons for DLC you own - enabling addons for DLC you haven't installed will lock up the game when you try to play. Multithreading and Corgi's Perfix can improve performance.

When it asks for the location of the BattleTech Binary ("Unable to locate BattleTech.exe"), navigate to your BattleTech install (see step 2.1) and select the "BattleTech" file.


Troubleshooting

Issue: The BTA Launcher will not run at step 2.1 and you get error message "MESA-INTEL:warning: processor code name Vulkan Support is incomplete"

Likely cause: Older hardware that OpenGL struggles with.

Solution: Run the following command in terminal before running the BTA Launcher with wine:

$ export MESA_GL_VERSION_OVERRIDE=4.5

Issue: The Launcher gives you the error message "non-folder object in selection" when trying to point the Install Target to the correct folder through the Launcher's "browse" button

Likely cause: Unknown

Solution: Edit the BTALauncherSettings.xml to apply the correct path, then restart the launcher to load up the correct path.

Issue: The game loads but the main menu doesn’t say “BattleTech ADVANCED - 3062” and the ModTek version doesn’t show up under the game version next to the CREDITs button

Likely cause: ModTek isn’t patched into the game correctly.

This can happen if dotnet is incorrectly installed or was not installed before the BTA installer was run.

Solution: Install dotnet472 with winetricks and (re)run the installer.

$ winetricks dotnet472

Run the installer, and "Update/Install BTA" again.

Issue: BattleTech refuses to launch/crashes to desktop immediately

Likely cause: Libc library conflict. The system libc is likely newer than, and incompatible with, the libc included in BattleTech’s native Linux distribution.

Solution: Remove libc.so.6 from the BattleTech game directory. This forces BattleTech to use the system libc.

$ mkdir -p "${BTA_ROOT}/../BattleTech_Data/Plugins/x86_64/"
$ mv "${BT_ROOT}/BattleTech_Data/Plugins/x86_64/libc.so.6" "${BTA_ROOT}/../BattleTech_Data/Plugins/x86_64/"

Issue: Not listed here

There are a few Linux users on the BTA Discord channel, you can ask for help in General Chat, message Indigo#8200 directly or open a support ticket with #ticketbot to get help resolving issues with BTA. For general issues with BattleTech on Linux, there are several forums available by searching your favorite search engine.