This Python CLI script automates the installation of DXVK, a Vulkan-based translation layer for Direct3D 8, 9, 10, and 11, into a specified game directory. It downloads the specified or latest DXVK release from GitHub and copies the required DLLs to the appropriate location (system32 or syswow64 subdirectories if they exist, or the game directory itself). The script supports both interactive prompts and command-line arguments, making it versatile for running Windows games on Linux with Wine or DXVK Native setups. It also includes auto-detection of the required DXVK version based on game executable dependencies.
- Python 3.9+
- Required Python libraries (listed in
requirements.txt)
-
Clone or Download the Script:
- Clone this repository or download the
install_dxvk.pyandrequirements.txtfiles.
- Clone this repository or download the
-
Install Dependencies:
- Install the required Python libraries:
pip install -r requirements.txt
- Install the required Python libraries:
-
Run the Script:
-
Interactive Mode: Execute the script without arguments to use interactive prompts:
python install_dxvk.py
Follow the prompts to specify:
- Game Directory: Enter the path to the game directory (e.g.,
/home/user/games/MyGame). - Bitness: Choose
x32orx64based on the game's architecture. - DXVK Version: If not auto-detected, select the Direct3D version (1 for D3D8, 2 for D3D9, 3 for D3D10, 4 for D3D11).
- Game Directory: Enter the path to the game directory (e.g.,
-
Command-Line Mode: Run the script with arguments to skip prompts:
python install_dxvk.py --game-dir /path/to/game --bitness x64 --dxvk-version d3d11 --dxvk-release v2.3
Available arguments:
--game-dir: Path to the game directory (e.g.,/home/user/games/MyGame).--bitness: Game architecture (x32orx64).--dxvk-version: DXVK version (d3d8,d3d9,d3d10, ord3d11). If omitted, the script attempts to auto-detect the version.--dxvk-release: Specific DXVK release version (e.g.,v2.3). If omitted, the latest release is used.
-
-
Post-Installation:
- For Wine: Use
winecfgto add native DLL overrides for the installed DLLs (e.g.,d3d9,d3d11,dxgi). - For DXVK Native: Ensure the game loads DLLs from the installed location and set the
DXVK_WSI_DRIVERenvironment variable (e.g.,export DXVK_WSI_DRIVER=SDL2). - Verify DXVK usage by setting:
Then run the game to check if DXVK is active.
export DXVK_HUD=1
- For Wine: Use
- Flexible Input: Supports both interactive prompts and command-line arguments for game directory, bitness, DXVK version, and specific release version.
- Specific Version Installation: Allows installation of a specific DXVK release (e.g.,
v2.2) using the--dxvk-releaseargument. - Auto-Detection of DXVK Version: Automatically detects the required DXVK version (D3D8, D3D9, D3D10, or D3D11) by analyzing
.exefiles in the game directory using thepefilelibrary. - Existing Version Detection: Checks for existing DXVK installations by examining DLLs (
d3d8.dll,d3d9.dll,d3d10core.dll,d3d11.dll,dxgi.dll) and prompts to overwrite if a different version is detected. - Automated Download: Fetches the specified or latest DXVK release from GitHub.
- User-Friendly CLI: Provides clear, colored output using
coloramafor interactive prompts and error messages. - Progress Bar: Displays a download progress bar using
tqdm. - Flexible Installation: Copies DLLs to the game directory's
system32(andsyswow64for x64 if it exists) or directly to the game directory if no subdirectories are found. - Support for Wine and DXVK Native: Works with both Wine-based setups and DXVK Native for game ports.
- Fast JSON Parsing: Uses
orjsonfor efficient parsing of GitHub API responses. - Error Handling: Provides clear error messages for invalid inputs, failed downloads, missing files, or invalid DXVK releases.
- No .exe files found: If auto-detection fails because no
.exefiles are found, the script will prompt for manual DXVK version selection. Ensure the game directory contains the game's executable. - Invalid DXVK release: If the specified
--dxvk-release(e.g.,v2.3) is not found on GitHub, check the available releases at DXVK Releases. - Failed to analyze .exe files: Ensure
pefileis installed (pip install pefile) and that the.exefiles are accessible and not corrupted. - DLLs not loaded by game: Verify DLL overrides in
winecfgfor Wine or check the game's DLL loading path for DXVK Native. - Network errors: Ensure a stable internet connection when downloading DXVK releases.
This project is licensed under the MIT License.