@echo off rem Archive dev run. rustc needs an MSVC toolchain env, so load vcvars64 first. rem The install path differs per machine (Build Tools / Community / VS version), rem so probe the usual spots and fall back to vswhere instead of hardcoding one. rem NOTE: ASCII only in this file - cmd.exe reads it in the OEM codepage. setlocal cd /d "%~dp0.." rem Probe vcvarsall.bat, not vcvars64.bat: a VS install without the C++ workload rem still ships the vcvars64 wrapper but not vcvarsall, and calling it just fails. set "VCVARS=" for %%P in ( "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" "C:\Program Files\Microsoft Visual Studio\18\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" "C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvarsall.bat" "C:\Program Files\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" ) do if not defined VCVARS if exist %%P set "VCVARS=%%~P" if defined VCVARS goto :have_vcvars rem vswhere only reports installs that actually carry the x64 C++ tools set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" if not exist "%VSWHERE%" goto :no_vcvars for /f "usebackq delims=" %%I in (`"%VSWHERE%" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VCVARS=%%I\VC\Auxiliary\Build\vcvarsall.bat" if not exist "%VCVARS%" goto :no_vcvars :have_vcvars call "%VCVARS%" x64 >nul where cargo >nul 2>nul if errorlevel 1 ( echo [dev] cargo not found on PATH - install Rust ^(https://rustup.rs^) and reopen the shell. exit /b 1 ) npm run tauri dev %* exit /b %ERRORLEVEL% :no_vcvars echo [dev] No MSVC toolchain found (vcvarsall.bat missing). echo [dev] Install "Desktop development with C++" (VS Build Tools or VS Community). exit /b 1