setup-win-for-dev.bat 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. REM Parameters vs_buildtools.exe download link and wsdk version
  2. @ECHO OFF
  3. SET wsdk=10SDK.20348
  4. REM Check for disk space
  5. Rem 543210987654321
  6. Set "Blank= "
  7. Set "GB100= 107374182400"
  8. for /f "tokens=2" %%A in (
  9. 'wmic LogicalDisk Get DeviceID^,FreeSpace ^| find /i "C:"'
  10. ) Do Set "FreeSpace=%Blank%%%A"
  11. Set "FreeSpace=%FreeSpace:~-15%"
  12. Echo FreeSpace="%FreeSpace%"
  13. Echo 100 GB="%GB100%"
  14. If "%FreeSpace%" gtr "%GB100%" (
  15. Echo yes enough free space
  16. ) else (
  17. Echo not enough free space - 100GB
  18. exit 5
  19. )
  20. REM Interpret arguments
  21. :loop
  22. IF NOT "%1"=="" (
  23. IF "%1"=="-buildtools_link" (
  24. SET buildtools_link=%2
  25. SHIFT
  26. )
  27. IF "%1"=="-wsdk" (
  28. SET wsdk=%2
  29. SHIFT
  30. )
  31. SHIFT
  32. GOTO :loop
  33. )
  34. @ECHO ON
  35. if not exist "C:\TEMP\" mkdir C:\TEMP
  36. REM Install chocolatey to further install dependencies
  37. set chocolateyUseWindowsCompression='true'
  38. @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" ^
  39. -NoProfile -InputFormat None -ExecutionPolicy Bypass ^
  40. -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
  41. SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  42. REM Install Visual Studio Toolchain
  43. choco install visualstudio2019buildtools --package-parameters "--quiet --wait --norestart --nocache --installPath ""%ProgramFiles(x86)%/Microsoft Visual Studio/2019/Community"" --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.140 --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.MFC.ARM64 --add Microsoft.VisualStudio.Component.Windows%wsdk% --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended"
  44. REM Install Windows SDK
  45. choco install windows-sdk-10-version-2104-all
  46. REM Install nodejs python git and yarn needed dependencies
  47. choco install -y nodejs-lts --version=16.15.0
  48. choco install -y python2 git yarn
  49. choco install python --version 3.7.9
  50. call C:\ProgramData\chocolatey\bin\RefreshEnv.cmd
  51. SET PATH=C:\Python27\;C:\Python27\Scripts;C:\Python39\;C:\Python39\Scripts;%PATH%
  52. REM Setup Depot Tools
  53. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git C:\depot_tools
  54. SET PATH=%PATH%;C:\depot_tools\
  55. REM Add symstore to PATH permanently
  56. setx path "%%path%%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64"