From 4ad96c60abc4d9e0de983d38b8126bc902178782 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Thu, 25 Feb 2016 23:53:44 -0500 Subject: [PATCH 1/8] Add script to setup the PATH variable on Windows --- setup-path-win.bat | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 setup-path-win.bat diff --git a/setup-path-win.bat b/setup-path-win.bat new file mode 100644 index 00000000..4fbf9a87 --- /dev/null +++ b/setup-path-win.bat @@ -0,0 +1,9 @@ +@echo off +setx /M path "%PATH%;C:\MinGW\bin" > nul 2>&1 +if NOT ["%errorlevel%"]==["0"] ( + echo FAILED. Rerun with administrator privileges. + pause +) else ( + echo Success! + pause +) From 37c8a232764d8c614d6e1183e80bab89d901cbee Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Fri, 26 Feb 2016 00:29:55 -0500 Subject: [PATCH 2/8] Include MSYS directory in Windows path --- setup-path-win.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-path-win.bat b/setup-path-win.bat index 4fbf9a87..49fb00e1 100644 --- a/setup-path-win.bat +++ b/setup-path-win.bat @@ -1,5 +1,5 @@ @echo off -setx /M path "%PATH%;C:\MinGW\bin" > nul 2>&1 +setx /M path "%PATH%;C:\MinGW\bin;C:\MinGW\msys\1.0\bin" > nul 2>&1 if NOT ["%errorlevel%"]==["0"] ( echo FAILED. Rerun with administrator privileges. pause From b7a94a1f0094649779559cc65fd2fe7b91061d0a Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Fri, 26 Feb 2016 01:53:18 -0500 Subject: [PATCH 3/8] Added Windows environment setup script --- setup-environment-win.bat | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 setup-environment-win.bat diff --git a/setup-environment-win.bat b/setup-environment-win.bat new file mode 100644 index 00000000..ae803da6 --- /dev/null +++ b/setup-environment-win.bat @@ -0,0 +1,28 @@ +@echo off +setx /M test test > nul 2>&1 +if NOT ["%errorlevel%"]==["0"] ( + echo FAILED. Rerun with administrator privileges. + pause + exit +) + +mingw-get install mingw32-make-bin mingw32-gcc-bin msys-wget-bin msys-unzip-bin +cd \MinGW\bin + +REM It would be somewhat better to use symlinks, but then it wouldn't work in XP or Vista. +copy mingw32-make.exe make.exe + +mkdir temp +cd temp +wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip +unzip dfu-programmer-win-0.7.2.zip +copy dfu-programmer.exe .. + +wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip +unzip libusb-win32-bin-1.2.6.0.zip +cp libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll + +pnputil -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf + +cd .. +rm -rf temp \ No newline at end of file From 06de9628be3ba17e1d6753b9af21c7072d4badd9 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Wed, 2 Mar 2016 12:25:21 -0500 Subject: [PATCH 4/8] Removed unneeded lines from setup script --- keyboard/planck/PCB_GUIDE.md | 17 +++++++++++++++-- setup-environment-win.bat | 5 +---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index 3daf0e00..d2ff7033 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -4,8 +4,21 @@ ### Windows -1. Install [WinAVR Tools](http://sourceforge.net/projects/winavr/) for AVR GCC compiler. -2. Install [DFU-Programmer][dfu-prog] (the -win one). +Options +1. Vagrant (overkill, lack of trust, no driver concerns) +2. Chocolatey / dfu-programmer (more dev work required) +3. Chocolatey / flip +4. Write a batch script that installs dfu-programmer on the path, installs make with MinGW, and uses pnputil to install the proper driver https://technet.microsoft.com/en-us/library/cc732377%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396#BKMK_Anchor2 +4. Look up altenatives ( + +* Install [MHV AVR Tools](https://github.com/jackhumbert/qmk_firmware). Disable smatch, but be sure to leave the option to add the tools to the PATH checked. +* Install the latest version of [the Atmel AVR **8-bit** toolchain](http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx) +* Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The script depends on the default location. +* Right-click on the setup-path-win batch script at the root of the project and select "Run as administrator". Press the spacebar to dismiss the success message. +* + +1. Install [Chocolatey](https://chocolatey.org/). It's a package manager for Windows that will make it easy to set up the complete build environment. To install Chocolatey, run the following command in a command line window with administrator privileges (search for command prompt, right-click on it, and select "Run as administrator"). `@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin` +2. Install DFU-Programmer by running (the -win one). 3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. ### Mac diff --git a/setup-environment-win.bat b/setup-environment-win.bat index ae803da6..1fbd35a6 100644 --- a/setup-environment-win.bat +++ b/setup-environment-win.bat @@ -6,12 +6,9 @@ if NOT ["%errorlevel%"]==["0"] ( exit ) -mingw-get install mingw32-make-bin mingw32-gcc-bin msys-wget-bin msys-unzip-bin +mingw-get install msys-wget-bin msys-unzip-bin cd \MinGW\bin -REM It would be somewhat better to use symlinks, but then it wouldn't work in XP or Vista. -copy mingw32-make.exe make.exe - mkdir temp cd temp wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip From c03d10d676ebbeabf838d4cf111567fd122214c5 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Wed, 2 Mar 2016 12:48:10 -0500 Subject: [PATCH 5/8] Added logging to setup script --- setup-environment-win.bat | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/setup-environment-win.bat b/setup-environment-win.bat index 1fbd35a6..91b6c91e 100644 --- a/setup-environment-win.bat +++ b/setup-environment-win.bat @@ -6,20 +6,36 @@ if NOT ["%errorlevel%"]==["0"] ( exit ) +echo ------------------------------------------ +echo Installing wget and unzip +echo ------------------------------------------ mingw-get install msys-wget-bin msys-unzip-bin cd \MinGW\bin mkdir temp -cd temp +cd temp +echo ------------------------------------------ +echo Installing dfu-programmer. +echo ------------------------------------------ wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip unzip dfu-programmer-win-0.7.2.zip copy dfu-programmer.exe .. +echo ------------------------------------------ +echo Downloading driver +echo ------------------------------------------ wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip unzip libusb-win32-bin-1.2.6.0.zip cp libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll +echo ------------------------------------------ +echo Installing driver. Accept prompt. +echo ------------------------------------------ pnputil -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf cd .. -rm -rf temp \ No newline at end of file +rm -rf temp + +echo ------------------------------------------ +echo Finished! +pause \ No newline at end of file From 240f8d9fe0a6dbd7f51b1bd4cb93d884b6870ce1 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Wed, 2 Mar 2016 12:54:53 -0500 Subject: [PATCH 6/8] Renamed scripts to show order --- setup-path-win.bat => 1-setup-path-win.bat | 0 setup-environment-win.bat => 2-setup-environment-win.bat | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename setup-path-win.bat => 1-setup-path-win.bat (100%) rename setup-environment-win.bat => 2-setup-environment-win.bat (100%) diff --git a/setup-path-win.bat b/1-setup-path-win.bat similarity index 100% rename from setup-path-win.bat rename to 1-setup-path-win.bat diff --git a/setup-environment-win.bat b/2-setup-environment-win.bat similarity index 100% rename from setup-environment-win.bat rename to 2-setup-environment-win.bat From 45933e84f178ae92506f4c1bfdc5a8dc30e587d2 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Wed, 2 Mar 2016 13:02:13 -0500 Subject: [PATCH 7/8] Added documentation for new Windows scripts --- keyboard/planck/PCB_GUIDE.md | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index d2ff7033..e396747d 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -3,23 +3,11 @@ ## Setting up the environment ### Windows - -Options -1. Vagrant (overkill, lack of trust, no driver concerns) -2. Chocolatey / dfu-programmer (more dev work required) -3. Chocolatey / flip -4. Write a batch script that installs dfu-programmer on the path, installs make with MinGW, and uses pnputil to install the proper driver https://technet.microsoft.com/en-us/library/cc732377%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396#BKMK_Anchor2 -4. Look up altenatives ( - -* Install [MHV AVR Tools](https://github.com/jackhumbert/qmk_firmware). Disable smatch, but be sure to leave the option to add the tools to the PATH checked. -* Install the latest version of [the Atmel AVR **8-bit** toolchain](http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx) -* Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The script depends on the default location. -* Right-click on the setup-path-win batch script at the root of the project and select "Run as administrator". Press the spacebar to dismiss the success message. -* - -1. Install [Chocolatey](https://chocolatey.org/). It's a package manager for Windows that will make it easy to set up the complete build environment. To install Chocolatey, run the following command in a command line window with administrator privileges (search for command prompt, right-click on it, and select "Run as administrator"). `@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin` -2. Install DFU-Programmer by running (the -win one). -3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. +1. Install [MHV AVR Tools](https://github.com/jackhumbert/qmk_firmware). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. +2. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. +3. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. +4. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. +5. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete! ### Mac From 140a311e652829cb8c774d3d3bb4acdb7c9f9954 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Wed, 2 Mar 2016 13:06:33 -0500 Subject: [PATCH 8/8] Fix link to MHV AVR Tools --- keyboard/planck/PCB_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index e396747d..797cee2e 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -3,7 +3,7 @@ ## Setting up the environment ### Windows -1. Install [MHV AVR Tools](https://github.com/jackhumbert/qmk_firmware). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. +1. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. 2. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. 3. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. 4. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up.