Skip to content

Instantly share code, notes, and snippets.

@derrod
Last active April 18, 2024 06:31
Show Gist options
  • Save derrod/333fb5218002347435b7f31d532cbd01 to your computer and use it in GitHub Desktop.
Save derrod/333fb5218002347435b7f31d532cbd01 to your computer and use it in GitHub Desktop.
Star Wars Battlefront II on Linux via Legendary

Installing Star Wars: Battlefront II with Legendary

The game is not installed or downloaded via Epic, instead the Epic Games Launcher launches Origin to link your account to install the game. This can be done manually to still be able to install and download the game without the Epic Games Launcher.

Installing Origin

Origin needs to be installed and working for this, please consult https://github.com/lutris/docs/blob/master/Origin.md for how to get it running on Linux via Lutris.

On Windows Origin just needs to be installed and ideally updated to the current version.

Linking your account & installing the game

In order to link your account you need something called an "exchange code", this can be obtained via legendary by copying the parameters used to launch a game, which in turn can be easily obtained via --dry-run.

Tip: If you do not have any games installed obtain Spotify from the Epic Games Store website, it is only around 80 Megabytes in size and quickly downloaded.

Note: The code is only valid for a few minutes, so if you have issues try again with a fresh one. It can also help to have Origin already running.

When launching a game with the --dry-run option you will get a command line something like this:

wine Game.exe -AUTH_LOGIN=unused -AUTH_PASSWORD=000102030405060708090a0b0c0d0e0f -AUTH_TYPE=exchangecode -epicapp=AppName -epicenv=Prod -EpicPortal -epicusername=Name -epicuserid=0f0e0d0c0b0a09080706050403020100 -epiclocale=en

To link the account, copy the AUTH_PASSWORD, epicusername and epicuserid into the following command, then run it from within a cmd (in your Origin WINE prefix):

start "" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=<AUTH_PASSWORD>&AUTH_TYPE=exchangecode&epicusername=<epicusername>&epicuserid=<epicuserid>&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

Based on the example above the final command should look something like this (with your credentials instead, obviously):

start "" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=000102030405060708090a0b0c0d0e0f&AUTH_TYPE=exchangecode&epicusername=Name&epicuserid=0f0e0d0c0b0a09080706050403020100&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

This should open a Window from Origin asking you to link your Origin and Epic accounts, afterwards the game should start installing via Origin (if the game is not installable, try restarting Origin).

Note: You may get a prompt asking you to register a product code, simply dismiss this as the game will already be registered to your account at that point and will be downloadable from your Origin library.

Launching the game

Attempting to launch the game via Origin directly will attempt to launch the Epic Launcher, instead you will have to use a similar command to the one above to run the game:

start "" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=0&AUTH_TYPE=exchangecode&epicusername=&epicuserid=&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

Note that only the password parameter here cannot be empty, but it does not need to be valid. Origin will launch the game afterwards.

@Hadrianneue
Copy link

if anyone is having trouble try the following: (prefix must have origin installed on it)

WINEDLLOVERRIDES="nvapi, nvapi64=d" WINEPREFIX="/mnt/gamedisk/EGS/Origin/" wine64 "/mnt/gamedisk/EGS/Origin/drive_c/Program Files (x86)/Origin/EALink.exe" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=0&AUTH_TYPE=exchangecode&epicusername=myusername&epicuserid=myepicuserid&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

The env WINEDLLOVERRIDES="nvapi, nvapi64=d" is useful If game fails to launch with message "outdated nvidia drivers...".

also i've omitted but i'm using wine-ge.

@italoghost maybe useful to you :)

@italoghost
Copy link

if anyone is having trouble try the following: (prefix must have origin installed on it)

WINEDLLOVERRIDES="nvapi, nvapi64=d" WINEPREFIX="/mnt/gamedisk/EGS/Origin/" wine64 "/mnt/gamedisk/EGS/Origin/drive_c/Program Files (x86)/Origin/EALink.exe" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=0&AUTH_TYPE=exchangecode&epicusername=myusername&epicuserid=myepicuserid&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

The env WINEDLLOVERRIDES="nvapi, nvapi64=d" is useful If game fails to launch with message "outdated nvidia drivers...".

also i've omitted but i'm using wine-ge.

@italoghost maybe useful to you :)

THANK YOU! I could never have imagined that I had to use the "EALink.exe" instead of the "Origin.exe". Using it opened the game just fine!

I will create an tutorial for those who are trying to launch the game on Lutris.

@stujii
Copy link

stujii commented Sep 20, 2023

For some reason I have a problem launching the game (installation is successful). At the end of the instructions it is stated that AUTH=PASSWORD does not have to be valid, the main thing is that it is not empty (as far as I understand). But in my case, the game simply does not start - an empty EA authorization window appears. The only way to run the game is to enter the current AUTH=PASSWORD, which I get with the spotify command launch --dry-run, but the problem is that it is updated every time after starting the game... So, every time before starting the game I need to get an up-to-date authentication password?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment