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.

@Ahmed-E-86
Copy link

Thanks. That worked.

In order for this to work. You need to install origin on your default wineprefix, and launch any game with --dry-run like this:
legendary launch 8e425d507bd6473dbb927f0fea8ef4f6 --dry-run

You need also to write wine cmd in the terminal before executing start command.

@zineth57
Copy link

The token is only valid for a few minutes, so probably just try again with a fresh one.

Thanks. That worked.

In order for this to work. You need to install origin on your default wineprefix, and launch any game with --dry-run like this:
legendary launch 8e425d507bd6473dbb927f0fea8ef4f6 --dry-run

You need also to write wine cmd in the terminal before executing start command.

Thanks, will try again now :)

@zineth57
Copy link

The token is only valid for a few minutes, so probably just try again with a fresh one.

Thank you so much, it worked!

@hrqmonteiro
Copy link

Hi, i am new to using Legendary, and i can't get it straight what you are saying to do.

I have Origin installed and running, via Lutris

But how do i do this -dry-run command since the Battlefront II doesn't show up when i list the games?

Could someone please list the exact commands i would have to do, instead of the abstract commands, that an experienced legendary user would understand? I would appreciate very much.

@derrod
Copy link
Author

derrod commented Jan 15, 2021

You would need to have at least one game installed and use --dry-run on that. It's not particularly nice, but that's the nature with hacky workarounds.

My tip would be to get Spotify from the store and then install that via Legendary, it's only ~80 Megabytes or so and will work for this purpose.

@stevel024
Copy link

Battlefront doesn't show up as a game list because it's not installed via EPIC. The -dry-run command is supposed to be used as a subcommand to -launch with an existing game that's installed. For me, I just used fortnite since it's free to play and relatively small download if you don't choose to install any of the additional texture packages or language packs.

@beau11627
Copy link

The game reaches 17% downloaded for me and then gives me "Error: The VC++ runtime redistributable package was not installed successfully. Setup cannot continue. (1603)" After researching it seems to be a problem with Microsoft Visual C++ and I can't find a fix for it through wine. Anyone else having this error when attempting the install?

@JakoDel
Copy link

JakoDel commented Jan 16, 2021

The game reaches 17% downloaded for me and then gives me "Error: The VC++ runtime redistributable package was not installed successfully. Setup cannot continue. (1603)" After researching it seems to be a problem with Microsoft Visual C++ and I can't find a fix for it through wine. Anyone else having this error when attempting the install?

Same here

@PaxSov
Copy link

PaxSov commented Jan 16, 2021

I am in the origin wine prefix and if I do the steps it start: command not found

@PoSayDone
Copy link

The game reaches 17% downloaded for me and then gives me "Error: The VC++ runtime redistributable package was not installed successfully. Setup cannot continue. (1603)" After researching it seems to be a problem with Microsoft Visual C++ and I can't find a fix for it through wine. Anyone else having this error when attempting the install?

Having the same issue

@Kiwii
Copy link

Kiwii commented Jan 16, 2021

I am in the origin wine prefix and if I do the steps it start: command not found

Either run wine cmd and enter the command into that, or run this:

wine C:\\\\windows\\\\command\\\\start.exe \"\" "link2ea://launchgame/MtMassive?AUTH_PASSWORD=0&AUTH_TYPE=exchangecode&epicusername=&epicuserid=&epiclocale=en&theme=sws&platform=epic&Hotfix=go"

@bndlfm
Copy link

bndlfm commented Jan 17, 2021

The game reaches 17% downloaded for me and then gives me "Error: The VC++ runtime redistributable package was not installed successfully. Setup cannot continue. (1603)" After researching it seems to be a problem with Microsoft Visual C++ and I can't find a fix for it through wine. Anyone else having this error when attempting the install?

Having the same issue

I was having trouble with this for a couple days, two things that I did were: replacing lutris-wine-6.0RC1 with the one linked in the official lutris discord here & also turned off "Prefer System Libraries"/made sure "Disable Lutris Runtime" wasn't turned on.

I'm not sure which fixed the problem but I'm officially at 20% downloaded now. I suspect that it was turning off "Prefer System Libraries"/"Disable Lutris Runtime" as it's mentioned in the Lutris documentation that Origin can have issues installing vcrun if you aren't using Lutris Runtime.

Hope this helps anyone who comes across it!

@yaffa7
Copy link

yaffa7 commented Jan 18, 2021

The game reaches 17% downloaded for me and then gives me "Error: The VC++ runtime redistributable package was not installed successfully. Setup cannot continue. (1603)" After researching it seems to be a problem with Microsoft Visual C++ and I can't find a fix for it through wine. Anyone else having this error when attempting the install?

Having the same issue

I was having trouble with this for a couple days, two things that I did were: replacing lutris-wine-6.0RC1 with the one linked in the official lutris discord here & also turned off "Prefer System Libraries"/made sure "Disable Lutris Runtime" wasn't turned on.

I'm not sure which fixed the problem but I'm officially at 20% downloaded now. I suspect that it was turning off "Prefer System Libraries"/"Disable Lutris Runtime" as it's mentioned in the Lutris documentation that Origin can have issues installing vcrun if you aren't using Lutris Runtime.

Hope this helps anyone who comes across it!

Can confirm this gets you past 17%

@thegala
Copy link

thegala commented Jan 19, 2021

The game reaches 17% downloaded for me and then gives me "Error: The VC++ runtime redistributable package was not installed successfully. Setup cannot continue. (1603)" After researching it seems to be a problem with Microsoft Visual C++ and I can't find a fix for it through wine. Anyone else having this error when attempting the install?

Having the same issue

I was having trouble with this for a couple days, two things that I did were: replacing lutris-wine-6.0RC1 with the one linked in the official lutris discord here & also turned off "Prefer System Libraries"/made sure "Disable Lutris Runtime" wasn't turned on.
I'm not sure which fixed the problem but I'm officially at 20% downloaded now. I suspect that it was turning off "Prefer System Libraries"/"Disable Lutris Runtime" as it's mentioned in the Lutris documentation that Origin can have issues installing vcrun if you aren't using Lutris Runtime.
Hope this helps anyone who comes across it!

Can confirm this gets you past 17%

What version of wine you are using??
Lutris or system version?

@Ahmed-E-86
Copy link

I normally do not use Lutris, and it does not work at all on Kubuntu 20.10. Do I have to use it to avoid this error?
I have not started downloading the game yet.

@bndlfm
Copy link

bndlfm commented Jan 20, 2021

I'm using 'system' wine which is actually wine staging tkg, You might have to find a PPA on Kubuntu. It's found on Chaotic AUR for filthy arch users like me ;3 . It's important to emphasize that I got it past 17% multiple times now trying to get it to work w/ both lutris wine 6.0rc1 patched version and with system tkg wine. From what I understand lutris wine versions have all the tk-glitch patches applied.

wine --version
wine-6.0.r0.g2414b1da ( TkG Staging Esync Fsync )

I could not get it to run yet because it detects the wrong nvidia driver which is a common error apparently but I was able to get Origin and EGL to cooperate without using the hacky legendary --dry-run shenanigans by installing epic with lutris, installing origin with system wine, and then launching them both with system wine.

I doubt it's relevant but I'm also using the linux-tkg kernel
uname -r
5.10.7-111-tkg-bmq

@Kiwii
Copy link

Kiwii commented Jan 20, 2021

@bndlfm Set nvapi64 to disabled in the libraries tab of winecfg or by exporting WINEDLLOVERRIDES="nvapi64=d".

I can get the game to run on wine-tkg (Tk's official build from the github releases page) on Arch and multiplayer works fine, but if somebody sends me a party invite it just freezes origin (the game continues to work, though). I can invite my Windows friends and get them into a party with me that way but I haven't found a solution to party up with another Linux user, which is quite frustrating.

If anyone knows of a way to join a party without using Origin or a fix for that issue, I'd greatly appreciate it.

@bndlfm
Copy link

bndlfm commented Jan 21, 2021

@bndlfm Set nvapi64 to disabled in the libraries tab of winecfg or by exporting WINEDLLOVERRIDES="nvapi64=d".

I can get the game to run on wine-tkg (Tk's official build from the github releases page) on Arch and multiplayer works fine, but if somebody sends me a party invite it just freezes origin (the game continues to work, though). I can invite my Windows friends and get them into a party with me that way but I haven't found a solution to party up with another Linux user, which is quite frustrating.

If anyone knows of a way to join a party without using Origin or a fix for that issue, I'd greatly appreciate it.

I haven't tried this yet because I just saw your message but I read somewhere that you need to set up a virtual desktop in wine and the use alt + enter to go into windowed mode and use that to accept invites. You might accept them through the origin client but I've read so much about this stuff in the past 4 days that it's hard to even say anymore. I def remember virtual desktop; alt + enter to go to windowed.

I've been having problems with origin hanging my xserver so I understand why you don't want to use it.

I'll let you know when I get a chance to test it myself if you don't see this before then.

@beau11627
Copy link

Alright I got the game installed and I can get it to run but the problem is the crash rate. Only about 5% of the time can I play the game and that's only for about 5 minutes at a time. Something keeps making it crash (I verified the game files already). Terminal outputs this before every crash.
warn: D3D11Texture2D::QueryInterface: Unknown interface query
warn: f8fb5c27-c6b3-4f75-a4c8-439af2ef564c
warn: D3D11Texture2D::QueryInterface: Unknown interface query
warn: f8fb5c27-c6b3-4f75-a4c8-439af2ef564c
warn: D3D11Texture2D::QueryInterface: Unknown interface query

any ideas what this could be or how to fix it?

@bndlfm
Copy link

bndlfm commented Jan 23, 2021

Alright I got the game installed and I can get it to run but the problem is the crash rate. Only about 5% of the time can I play the game and that's only for about 5 minutes at a time. Something keeps making it crash (I verified the game files already). Terminal outputs this before every crash.

how did you install it?

i got it running but there was a dxvk issue with characters and terrain being really dark/black so you couldn't see anything. for some reason origin wasn't connecting to the internet either. By coincidence I saw ea play on steam had a $0.99 trial and then it's pretty cheap for a whole year so I just subbed to that and it works perfect through steam play lol

If I stop my sub i plan on using the proton pfx to run my epic version

@FabioSedia
Copy link

i tried running the game, but i get the "AMD Driver version UNKNOWN: use at least driver version 18.xxxx at amd.com"
I'm using an AMD card, and other games with the same engine like bf1 works fine

@Kiwii
Copy link

Kiwii commented Jan 27, 2021

@FabioSedia Install DXVK to the wine prefix if you haven't and set nvapi and nvapi64 to disabled in winecfg. DXVK should fake an nvidia GPU for the game by default, but if it doesn't for some reason, make a dxvk.conf file in the game's install folder with the content:

dxgi.customDeviceId = 1C81
dxgi.customVendorId = 10DE

@gat02
Copy link

gat02 commented Jan 31, 2021

Does anyone get this error?

"The title is installed in a language that you are not entitled to play, please reinstall the title or sign in with an entitled user."

@TabulateJarl8
Copy link

TabulateJarl8 commented Mar 12, 2021

Does anyone get this error?

"The title is installed in a language that you are not entitled to play, please reinstall the title or sign in with an entitled user."

I got this, not entirely sure how to go about fixing it. Once I hit "Ok", it opens a window titled "Frostbite" which then quickly changes to "Star Wars Battlefront II" and then the window closes. This is my wine output after printing fixme:d3d_shader:shader_glsl_dump_program_source followed by code thousands of times: https://pastebin.com/AxpAEpkr

@ibrokemypie
Copy link

When launching for me origin launches, then the game freezes on a black screen (Title is Star Wars Battlefront II) before crashing a minute or so after with no error I can find. Running the game exe directly works, though launches epic games store and origin which is what I am aiming to avoid

@LeonMusCoden
Copy link

This works surprisingly well. However, I would highly recommend to install DXVK manually after installing Origin.
Simply download the script from the release page and run it in the origin preset: WINEPREFIX=path/to/prefix ./setup_dxvk.sh

@italoghost
Copy link

Does anyone know how is possible to automate the command

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

on Lutris?

I am trying to make Origin as the executable and adding this command to the arguments. Although it starts as an application launched through another launcher, I can't open the game: pressing the play button does nothing.

I can launch the game by running the command on wine cmd, but I loose all the Lutris configurations.

Can someone help me?

@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