3 dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
4 download_dir=~/qmk_utils
5 avrtools=avr8-gnu-toolchain
6 armtools=gcc-arm-none-eabi
9 echo "Installing dependencies needed for the installation (quazip)"
10 pacman --needed -S msys/unzip msys/p7zip
12 source "$dir/win_shared_install.sh"
14 function install_avr {
16 wget "http://www.atmel.com/images/avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe"
17 7z x avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe
18 rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe
21 function install_arm {
22 wget -O gcc-arm-none-eabi.zip "https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-win32.zip?product=GNU%20ARM%20Embedded%20Toolchain,ZIP,,Windows,6-2017-q2-update"
23 unzip -d gcc-arm-none-eabi gcc-arm-none-eabi.zip
24 rm gcc-arm-none-eabi.zip
27 function extract_flip {
29 7z -oflip x FlipInstaller.exe
34 if [ -f "FlipInstaller.exe" ]; then
36 echo "Extracting flip"
40 if [ ! -d "$avrtools" ]; then
43 echo "The AVR toolchain is not installed."
44 echo "This is needed for building AVR based keboards."
45 read -p "Do you want to install it? (Y/N) " res
47 [Yy]* ) install_avr; break;;
49 * ) echo "Invalid answer";;
55 echo "The AVR toolchain is already installed"
56 read -p "Do you want to reinstall? (Y/N) " res
58 [Yy]* ) install_avr; break;;
60 * ) echo "Invalid answer";;
65 if [ ! -d "$armtools" ]; then
68 echo "The ARM toolchain is not installed."
69 echo "This is needed for building ARM based keboards."
70 read -p "Do you want to install it? (Y/N) " res
72 [Yy]* ) install_arm; break;;
74 * ) echo "Invalid answer";;
80 echo "The ARM toolchain is already installed"
81 read -p "Do you want to reinstall? (Y/N) " res
83 [Yy]* ) install_arm; break;;
85 * ) echo "Invalid answer";;
92 echo "******************************************************************************"
93 echo "Installation completed!"
94 echo "You need to open a new batch command prompt for all the utils to work properly"
95 echo "******************************************************************************"