2-setup-environment-win.bat 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. @echo off
  2. setx /M test test > nul 2>&1
  3. if NOT ["%errorlevel%"]==["0"] (
  4. echo FAILED. Rerun with administrator privileges.
  5. pause
  6. exit
  7. )
  8. echo ------------------------------------------
  9. echo Installing wget and unzip
  10. echo ------------------------------------------
  11. mingw-get install msys-wget-bin msys-unzip-bin
  12. cd \MinGW\bin
  13. mkdir temp
  14. cd temp
  15. echo ------------------------------------------
  16. echo Installing dfu-programmer.
  17. echo ------------------------------------------
  18. wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip
  19. unzip dfu-programmer-win-0.7.2.zip
  20. copy dfu-programmer.exe ..
  21. echo ------------------------------------------
  22. echo Downloading driver
  23. echo ------------------------------------------
  24. wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip
  25. unzip libusb-win32-bin-1.2.6.0.zip
  26. cp libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll
  27. echo ------------------------------------------
  28. echo Installing driver. Accept prompt.
  29. echo ------------------------------------------
  30. pnputil -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf
  31. cd ..
  32. rm -rf temp
  33. echo ------------------------------------------
  34. echo Finished!
  35. pause