@echo off

mkdir src

echo Downloading SDR# ...
httpget http://sdrsharp.com/downloads/sdr-nightly.zip src\sdr-nightly.zip

echo Downloading SDR#'s RTLSDR Plugin ...
httpget http://sdrsharp.com/downloads/sdr-nightly-rtlsdr.zip src\sdr-nightly-rtlsdr.zip

echo Downloading RTLSDR Driver
httpget http://sdr.osmocom.org/trac/raw-attachment/wiki/rtl-sdr/RelWithDebInfo.zip src\RelWithDebInfo.zip

echo Downloading Zadig
httpget http://sdrsharp.com/downloads/zadig.zip src\zadig.zip

mkdir tmp

unzip -o src\sdr-nightly.zip -d sdrsharp

unzip -o src\sdr-nightly-rtlsdr.zip -d tmp
move tmp\SDRSharp.RTLSDR.dll sdrsharp
move tmp\msvcr100.dll sdrsharp
move tmp\libusb-1.0.dll sdrsharp
move tmp\libusb0.dll sdrsharp
move /Y tmp\config\SDRSharp.exe.config sdrsharp

unzip -o src\RelWithDebInfo.zip -d tmp
move tmp\rtl-sdr-release\x32\rtlsdr.dll sdrsharp

unzip -o src\zadig.zip -d tmp
move tmp\zadig.exe sdrsharp

rmdir src /S /Q
rmdir tmp /S /Q
