You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.7 KiB

  1. #!/bin/bash
  2. function install_utils {
  3. rm -f -r "$download_dir"
  4. mkdir "$download_dir"
  5. pushd "$download_dir"
  6. echo "Installing dfu-programmer"
  7. wget 'http://downloads.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip'
  8. unzip -d dfu-programmer dfu-programmer-win-0.7.2.zip
  9. echo "Installing dfu-util"
  10. wget 'http://dfu-util.sourceforge.net/releases/dfu-util-0.9-win64.zip'
  11. unzip dfu-util-0.9-win64.zip
  12. echo "Installing teensy_loader_cli"
  13. wget 'https://www.pjrc.com/teensy/teensy_loader_cli_windows.zip'
  14. unzip teensy_loader_cli_windows.zip
  15. # This URL has changed and I can't find the new location. Commenting out until we figure out the new URL or determine this isn't needed. -skullY
  16. echo "Installing Atmel Flip"
  17. wget 'http://ww1.microchip.com/downloads/en/DeviceDoc/Flip%20Installer%20-%203.4.7.112.exe'
  18. # This is the JRE-less installer, if we need the larger bundled with JRE installer, use this:
  19. #wget 'http://ww1.microchip.com/downloads/en/DeviceDoc/JRE%20-%20Flip%20Installer%20-%203.4.7.112.exe'
  20. mv Flip\ Installer\ \-\ 3.4.7.112.exe FlipInstaller.exe
  21. echo "Downloading the QMK driver installer"
  22. wget -qO- https://api.github.com/repos/qmk/qmk_driver_installer/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4 | wget -i -
  23. rm -f *.zip
  24. popd > /dev/null
  25. }
  26. function install_drivers {
  27. pushd "$download_dir"
  28. cp -f "$dir/drivers.txt" .
  29. echo
  30. cmd.exe /c "qmk_driver_installer.exe $1 $2 drivers.txt"
  31. popd > /dev/null
  32. }
  33. pushd "$dir"
  34. if [ ! -d "$download_dir" ]; then
  35. install_utils
  36. else
  37. while true; do
  38. echo
  39. echo "The utils seem to already be downloaded."
  40. read -p "Do you want to re-download them and update to the newest version (Y/N) " res
  41. case $res in
  42. [Yy]* ) install_utils; break;;
  43. [Nn]* ) break;;
  44. * ) echo "Invalid answer";;
  45. esac
  46. done
  47. fi
  48. while true; do
  49. echo
  50. echo "Which USB drivers do you want to install?"
  51. echo "(A)all - All supported drivers will be installed"
  52. echo "(C)onnected - Only drivers for connected keyboards (in bootloader/flashing mode)"
  53. echo " will be installed"
  54. echo "(F)force - Like all, but will also override existing drivers for connected"
  55. echo " keyboards"
  56. echo "(N)one - No drivers will be installed,"
  57. echo " flashing your keyboard will most likely not work"
  58. read -p "(A/C/F/N)? " res
  59. case $res in
  60. [Aa]* ) install_drivers --all; break;;
  61. [Cc]* ) install_drivers; break;;
  62. [Ff]* ) install_drivers --all --force; break;;
  63. [Nn]* ) break;;
  64. * ) echo "Invalid answer";;
  65. esac
  66. done
  67. popd > /dev/null