Skip to content

Instantly share code, notes, and snippets.

@t-mat
Created March 1, 2026 11:15
Show Gist options
  • Select an option

  • Save t-mat/958f779dbe284b851ebce5b2b0ebc256 to your computer and use it in GitHub Desktop.

Select an option

Save t-mat/958f779dbe284b851ebce5b2b0ebc256 to your computer and use it in GitHub Desktop.
@echo off
setlocal EnableDelayedExpansion
set "NUGET_DIR=%~dp0nuget"
set "DXC_DIR=!NUGET_DIR!\Microsoft.Direct3D.DXC\build\native\bin\x64"
set "DXC=!DXC_DIR!\dxc.exe"
REM --- Obtain nuget.exe ---
if not exist "!NUGET_DIR!" mkdir "!NUGET_DIR!"
if not exist "!NUGET_DIR!\nuget.exe" (
echo dxc.bat - Downloading nuget.exe...
curl -sSL https://aka.ms/nugetclidl -o "!NUGET_DIR!\nuget.exe" || (
echo dxc.bat - ERROR: Failed to download nuget.exe
exit /b 1
)
)
REM --- Install DXC package ---
if not exist "!DXC!" (
echo dxc.bat - Installing Microsoft.Direct3D.DXC...
pushd "!NUGET_DIR!"
.\nuget.exe install Microsoft.Direct3D.DXC -Version 1.9.2602.17 -ExcludeVersion || (
popd
echo dxc.bat - ERROR: Failed to install DXC package
exit /b 1
)
popd
)
if not exist "!DXC!" (
echo dxc.bat - ERROR: dxc.exe not found: !DXC!
exit /b 1
)
REM --- Execute DXC ---
echo dxc %*
"!DXC!" %*
exit /b %ERRORLEVEL%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment