You can install basic DX9 via winget. Code: winget install Microsoft.DirectX --accept-package-agreements --accept-source-agreements
I really like this thing. It installs faster compared to the original installer. If possible could you please publish the code? Thank you!