Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 26 additions & 11 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,44 @@ Install newest version [here](https://www.python.org/downloads/).

# Compilers

You will need GCC and Clang compilers.
You will need GCC and Clang compilers and some components of Visual Studio (Yes, patching game engine that was originally built with Visual Studio requires it's components).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix grammar: use possessive "its" instead of contraction "it's".

The phrase "requires it's components" should be "requires its components" (possessive form, not contraction).

✏️ Proposed fix
-You will need GCC and Clang compilers and some components of Visual Studio (Yes, patching game engine that was originally built with Visual Studio requires it's components).
+You will need GCC and Clang compilers and some components of Visual Studio (Yes, patching game engine that was originally built with Visual Studio requires its components).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
You will need GCC and Clang compilers and some components of Visual Studio (Yes, patching game engine that was originally built with Visual Studio requires it's components).
You will need GCC and Clang compilers and some components of Visual Studio (Yes, patching game engine that was originally built with Visual Studio requires its components).
🤖 Prompt for AI Agents
In `@SETUP.md` at line 8, Update the sentence in SETUP.md to use the possessive
"its" instead of the contraction "it's": change "requires it's components" to
"requires its components" so the line reads "You will need GCC and Clang
compilers and some components of Visual Studio (Yes, patching game engine that
was originally built with Visual Studio requires its components)."


## Clang

Clang compiler installation:
* Goto [github releases of llvm](https://github.com/llvm/llvm-project/releases/tag/llvmorg-18.1.8)
* Download **clang+llvm-18.1.8-x86_64-pc-windows-msvc.tar.xz**
* Unpack into preferred location

* Goto [github releases of llvm](https://github.com/llvm/llvm-project/releases)
* Download latest one with **-x86_64-pc-windows-msvc** suffix (or installer **-win64.exe**)
* Install into preferred location
* You need path to `/bin/clang++.exe`

## Visual Studio

* Goto [Visual Studio]( https://visualstudio.microsoft.com) official website
* Download latest version and install it
* Via *Visual Studio Installer* install 'Desktop development with C++'

## GCC

GCC compiler installation:
* Install [MSYS2](https://www.msys2.org/)
* Install GCC x32/x64 via MSYS console:
* x32: pacman -S mingw-w64-i686-gcc
* x64: pacman -S mingw-w64-x86_64-gcc

* Install [chocolatey](https://chocolatey.org/)
* Run `choco install mingw --x86 -y --no-progress` which is gonna be installed at `C:\ProgramData\mingw64`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use formal language in documentation.

Replace the informal "gonna be" with "will be" for better documentation quality.

✏️ Proposed fix
-* Run `choco install mingw --x86 -y --no-progress` which is gonna be installed at `C:\ProgramData\mingw64`.
+* Run `choco install mingw --x86 -y --no-progress` which will be installed at `C:\ProgramData\mingw64`.

As per coding guidelines: The word 'gonna' is informal and should be avoided in documentation.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* Run `choco install mingw --x86 -y --no-progress` which is gonna be installed at `C:\ProgramData\mingw64`.
* Run `choco install mingw --x86 -y --no-progress` which will be installed at `C:\ProgramData\mingw64`.
🧰 Tools
🪛 LanguageTool

[style] ~30-~30: The word ‘gonna’ is informal.
Context: ... mingw --x86 -y --no-progresswhich is gonna be installed atC:\ProgramData\mingw64...

(GONNA)

🤖 Prompt for AI Agents
In `@SETUP.md` at line 30, Update the informal phrasing in the README/SETUP text
by replacing "gonna be installed at `C:\ProgramData\mingw64`" with the formal
wording "will be installed at `C:\ProgramData\mingw64`" so the sentence reads:
"Run `choco install mingw --x86 -y --no-progress` which will be installed at
`C:\ProgramData\mingw64`."

* You need paths to `/mingw32/bin/g++.exe` and `/mingw32/bin/ld.exe`
Comment on lines +29 to 31
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, locate and read the SETUP.md file to understand the full context
fd -t f "SETUP.md" | head -5

Repository: FAForever/fa-python-binary-patcher

Length of output: 86


🏁 Script executed:

# Read the SETUP.md file to see lines 29-31 in context
cat -n SETUP.md

Repository: FAForever/fa-python-binary-patcher

Length of output: 2331


🌐 Web query:

Chocolatey mingw package installation path --x86 flag C:\ProgramData

💡 Result:

With Chocolatey installed in the default location, %ChocolateyInstall is C:\ProgramData\chocolatey. (docs.chocolatey.org)

For the community mingw (MinGW-w64) package, the package script extracts the archive into an install folder inside the package’s tools directory, i.e. typically:

  • 64-bit default install path (most common):
    C:\ProgramData\chocolatey\lib\mingw\tools\install\... (community.chocolatey.org)
  • The --x86 flag tells Chocolatey to use the 32-bit download (url) instead of the 64-bit download (url64bit), but it still extracts under that same ...\lib\mingw\tools\install\ folder. (community.chocolatey.org)

To confirm on your machine, check:

  • %ChocolateyInstall%\lib\mingw\tools\install
  • or run in PowerShell: Write-Host $env:ChocolateyInstall (docs.chocolatey.org)

Citations:


🌐 Web query:

Chocolatey mingw package tools install directory structure mingw32 mingw64

💡 Result:

For Chocolatey packages, the extracted “real” files typically live under:

  • %ChocolateyInstall%\lib\<package>\tools\install\... (default %ChocolateyInstall% is C:\ProgramData\chocolatey).

mingw / MinGW-w64 (Chocolatey package name: mingw)

The toolchain is placed under the package’s tools\install\mingw64\..., e.g.:

  • C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin (compiler/binutils, etc.) [1]
  • You may also see subtrees like ...\mingw64\opt\bin\... referenced by Chocolatey shims (e.g., python.exe) [2]
  • GCC’s versioned libs/headers are under paths like ...\mingw64\lib\gcc\x86_64-w64-mingw32\<ver>\... [3]

So, for this package, mingw64 is the directory you normally add to PATH (or let Chocolatey shims handle).

Packages that provide both mingw32 and mingw64

Some Chocolatey packages (e.g., WinLibs-based ones) extract both architectures side-by-side and then use:

  • <installDir>\mingw32\bin
  • <installDir>\mingw64\bin [4]

This is where the “mingw32 and mingw64 directory structure” usually comes from.

Sources: [1] [2] [3] [4]


🌐 Web query:

Chocolatey mingw --x86 flag 32-bit binaries mingw32 directory

💡 Result:

  • --x86 (aka --forcex86) tells Chocolatey to force the 32‑bit build even on a 64‑bit Windows machine. [1]
  • For the Chocolatey mingw package, the install script unpacks into the package’s tools\install folder (under Chocolatey’s lib\mingw directory). [2]
    • Typical path: C:\ProgramData\chocolatey\lib\mingw\tools\install\
  • The 32‑bit MinGW-w64 binaries will then be under the mingw32 tree, i.e.:
    • C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin\ [2]
  • On a 64‑bit machine, using --x86 makes the mingw package use its i686 (32‑bit) download (url), instead of the url64bit (x86_64) download. [2]

Sources: [1] Chocolatey install command docs (option --x86). [2] Chocolatey mingw package install script showing tools\install location and 32/64-bit URLs.


Line 30: Incorrect installation path.

choco install mingw --x86 does not install to C:\ProgramData\mingw64. The actual installation path is C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin\ (when using the --x86 flag for 32-bit binaries). Update line 30 to reflect the correct Chocolatey installation location and provide the full path to the executables.

Additionally, replace the informal "gonna be" with "will be" on line 30.

🧰 Tools
🪛 LanguageTool

[style] ~30-~30: The word ‘gonna’ is informal.
Context: ... mingw --x86 -y --no-progresswhich is gonna be installed atC:\ProgramData\mingw64...

(GONNA)

🤖 Prompt for AI Agents
In `@SETUP.md` around lines 29 - 31, Update the incorrect Chocolatey installation
path on line containing "C:\ProgramData\mingw64" to the correct Chocolatey
install location
"C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin\" and explicitly
reference the full executable paths
"C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin\g++.exe" and
"C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw32\bin\ld.exe"; also
replace the informal phrase "gonna be installed" with "will be installed" in
that same line.


After everything installed you need to clone patches repo (right now only 4z0t's fork is compatible).
# Patcher

After everything installed you need to clone patches repo.

Now you can setup build script:

```bat
python main.py [Path to patches folder] [Path to clang++.exe] [Path to ld.exe] [Path to g++.exe]
```
After you successfully build, you have to test what you've got somehow.

After you successfully build, you have to test what you've got.
You have 2 options:

* Running patched game with files from FAF client gamedata
* Running patched game with files from FAF repo

Expand All @@ -40,4 +55,4 @@ In preferences set default C++ formatter to `ms-vscode.cpptools`.

# Decompiler

TODO
TODO