Repair Windows with DISM and SFC before running the official DirectX End-User Runtime again, because the legacy-runtime installer is currently failing rather than merely reporting that DirectX is outdated.
1. Repair the Windows component store
- Open Start, type Command Prompt, right-click it, and select Run as administrator.
- Run these commands in order:
DISM.exe /Online /Cleanup-image /Restorehealth
sfc /scannow
- Do not close the window until SFC reaches 100%.
- Restart Windows.
DISM repairs the Windows image used as the source for system files; SFC then checks and replaces missing or damaged protected files. Microsoft specifies running DISM before SFC.^1^
If SFC reports that it found corruption but could not repair everything, do not proceed to manually replace DLLs; note the exact result for the repair-install fallback below.
2. Install the legacy DirectX components
After restarting, download and run Microsoft’s DirectX End-User Runtime Web Installer:
DirectX End-User Runtime Web Installer
Files such as d3dx9_43.dll and D3DCompiler_43.dll are optional, side-by-side components from the legacy DirectX SDK. They are not necessarily included just because Windows reports DirectX 11 or 12.^2^
Installing this package does not downgrade or replace the DirectX version built into Windows; it adds legacy libraries required by some games.^3^
After installation:
- Restart Windows.
- Launch GTA V Story Mode first.
- If GTA V starts, launch FiveM. FiveM’s “Early Exit Trap” may have been secondary to GTA V failing to load its required runtime.
Do not download individual DLL files from third-party DLL sites or copy arbitrary versions into System32, SysWOW64, or the game directory. Loading an unexpected DLL from a searched location can introduce DLL-preloading and code-execution risks.^4^
If the DirectX installer still fails
Test for background-software interference
Perform a clean boot, then run the DirectX installer again:
- Search for msconfig and open System Configuration.
- Under Services, select Hide all Microsoft services, then Disable all.
- Under Startup, select Open Task Manager and disable enabled startup applications.
- Restart and run the installer.
- Restore normal startup afterward.
If installation succeeds in the clean-boot environment, re-enable services and startup items in groups to identify the conflict. If it still fails, background software is not the cause.^5^
Windows N edition only
Check Settings → System → About → Windows specifications → Edition. If the edition name ends in N, install:
Settings → System → Optional features → View features → Media Feature Pack → Add, then restart.
This is conditional on having an N edition; a matching case involving the same missing legacy DLLs and DirectX installation failure was resolved by installing Media Feature Pack.^6^
Final fallback
If DISM/SFC cannot repair Windows or the installer continues failing even in a clean boot, use a Windows repair reinstall before considering Reset this PC. On supported Windows 11 systems, look under:
Settings → System → Recovery → Fix problems using Windows Update → Reinstall now
That option may be absent on managed PCs, Windows versions earlier than Windows 11’s 2022 annual update, or systems without the February 2024 optional update or later.^7^
If further diagnosis is needed before repairing Windows, open %WINDIR%\DXError.log and %WINDIR%\DirectX.log immediately after the failed installation and provide the final error block, with usernames or other personal paths removed.
References
- Use the System File Checker tool to repair missing or corrupted system files | Microsoft Support
- Framework package dependencies
- How to install the latest version of DirectX | Microsoft Support
- Secure loading of libraries to prevent DLL preloading attacks | Microsoft Support
- How to perform a clean boot in Windows | Microsoft Support
- Unable to load C:\WINDOWS\system32\xactengine2_0.dll error when downloading directx runtimes - Microsoft Q&A
- Fix issues by reinstalling the current version of Windows | Microsoft Support