summaryrefslogtreecommitdiff
path: root/2-setup-environment-win.bat
blob: 91b6c91e39388b86a8b6305f9f34f1b4c6b16479 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@echo off
setx /M test test > nul 2>&1
if NOT ["%errorlevel%"]==["0"] (
	echo FAILED. Rerun with administrator privileges.
	pause
	exit
) 

echo ------------------------------------------
echo Installing wget and unzip
echo ------------------------------------------
mingw-get install msys-wget-bin msys-unzip-bin
cd \MinGW\bin

mkdir 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

echo ------------------------------------------
echo Finished!
pause