All modern Windows operating systems include DirectX by default so you shouldn't ever really need to "install" DirectX as a software program, per se.
However, Microsoft frequently releases updated versions of DirectX and installing the latest updates may be the fix to a DirectX problem you're having or may give performance increases in your games and graphics programs.
Follow the easy steps below to update DirectX in Windows.
Click the link in the search results named DirectX End-User Runtime Web Installer or DirectX End-User Runtimes (MONTH YEAR).
Note: Typically, the DirectX End-User Runtime Web Installer link will be your best option since it's the latest release and only installs the DirectX files you are missing. Some users prefer to download and install the entire DirectX package by choosing the DirectX End-User Runtimes (MONTH YEAR) link with the latest month and year available.
Note: The DirectX SDK download options are not recommended.
Complete the DirectX installation by following any directions from Microsoft's website or from the DirectX installation program.
Note: This DirectX download will install on Windows 8, Windows 7, Windows Vista, or Windows XP. Whatever files are missing - be them DirectX 11, DirectX 10, DirectX 9, etc. - will be replaced as necessary. See Tip #1 at the bottom of the page for more information about DirectX in specific versions of Windows.
Restart your computer, even if you're not prompted to do so.
After restarting your computer, test to see if updating to the latest version of DirectX corrected the problem you were having.
DirectX 11 is supported in Windows 8 and Windows 7. In Windows Vista, DirectX 11 is only supported after installation of a "platform update" available here for 32-bit versions of Vista and here for 64-bit versions.
DirectX 10 is supported in Windows 8, Windows 7, and Windows Vista.
DirectX 9 is supported in Windows 8, Windows 7, Windows Vista, and Windows XP. This is the latest version of DirectX that's compatible with Windows XP.
However, as I mentioned in Step 3, the same DirectX download applies to all versions of Windows, no matter what the maximum DirectX version is supported.