From 8d09b8c953e208976e688fc015a11e8d941d8c3d Mon Sep 17 00:00:00 2001 From: Stephen Dade Date: Sat, 18 Jul 2015 14:18:12 +1000 Subject: [PATCH 1/4] Windows Installer: Added protobuf to installer --- windows/droneapiWinBuild.bat | 23 +++++++++++++++++++++++ windows/droneapi_installer.iss | 2 ++ 2 files changed, 25 insertions(+) diff --git a/windows/droneapiWinBuild.bat b/windows/droneapiWinBuild.bat index dc680a230..5d15dd694 100644 --- a/windows/droneapiWinBuild.bat +++ b/windows/droneapiWinBuild.bat @@ -9,6 +9,29 @@ for /f "tokens=*" %%a in ( set VERSION=%%a ) +rem -----Get protobuf and unzip----- +C:\python27\scripts\pip.exe install --download .\ protobuf +rem get the protobuf fullname +for /f "tokens=*" %%a in ( + 'dir /B protobuf-*' + ) do ( + set PROTOBUFFULL=%%a + ) + +rem Use 7zip to unzip files. Works for both 32 and 64 bit versions +"C:\Program Files\7-zip\7z.exe" x -y %PROTOBUFFULL% +"C:\Program Files\7-zip\7z.exe" x -y .\dist\protobuf* +"C:\Program Files (x86)\7-zip\7z.exe" x -y %PROTOBUFFULL% +"C:\Program Files (x86)\7-zip\7z.exe" x -y .\dist\protobuf* + +rem get the protobuf fullname +for /f "tokens=*" %%a in ( + 'dir /A:D /B protobuf-*' + ) do ( + set PROTOBUFDIR=%%a + ) +xcopy /E /Y %PROTOBUFDIR%\google .\google\ + rem -----Build the Installer----- "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" /dMyAppVersion=%VERSION% -compile droneapi_installer.iss diff --git a/windows/droneapi_installer.iss b/windows/droneapi_installer.iss index dc347aa17..9e82a7159 100644 --- a/windows/droneapi_installer.iss +++ b/windows/droneapi_installer.iss @@ -32,6 +32,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Files] Source: "..\droneapi\*"; DestDir: "{code:GetMAVProxyPath}\droneapi"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\examples\*"; DestDir: "{code:GetMAVProxyPath}\examples"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "google\*"; DestDir: "{code:GetMAVProxyPath}\google"; Flags: ignoreversion recursesubdirs createallsubdirs + ; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; Check if MAVProxy is installed (if so, get the install path) From b3512de379aaef671d5ec38b65ff2b1630ad13f9 Mon Sep 17 00:00:00 2001 From: Tim Ryan Date: Fri, 24 Jul 2015 12:56:41 -0700 Subject: [PATCH 2/4] Updates windows builder script for compat and not to pause. --- windows/droneapiWinBuild.bat | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/windows/droneapiWinBuild.bat b/windows/droneapiWinBuild.bat index 5d15dd694..dac2fe89d 100644 --- a/windows/droneapiWinBuild.bat +++ b/windows/droneapiWinBuild.bat @@ -34,6 +34,4 @@ xcopy /E /Y %PROTOBUFDIR%\google .\google\ rem -----Build the Installer----- -"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" /dMyAppVersion=%VERSION% -compile droneapi_installer.iss - -pause +"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" /dMyAppVersion=%VERSION% droneapi_installer.iss From 805771496dc53ef2021319230420b7466ea1839c Mon Sep 17 00:00:00 2001 From: Tim Ryan Date: Fri, 24 Jul 2015 13:00:25 -0700 Subject: [PATCH 3/4] Enables Windows SITL tests to use mavproxy.exe --- tests/sitl/__main__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/sitl/__main__.py b/tests/sitl/__main__.py index c7e6b91ce..375b06c2f 100755 --- a/tests/sitl/__main__.py +++ b/tests/sitl/__main__.py @@ -163,7 +163,18 @@ def lets_run_a_test(name): timeout = 5*60 try: - p = Popen([sys.executable, '-m', 'MAVProxy.mavproxy', '--logfile=' + tempfile.mkstemp()[1], '--master=tcp:127.0.0.1:5760'], + if sys.platform == 'win32': + try: + # Try to find installed Python MAVProxy module. + import imp + imp.find_module('MAVProxy') + mavprog = [sys.executable, '-m', 'MAVProxy.mavproxy'] + except: + # Uses mavproxy.exe instead. + mavprog = ['mavproxy'] + else: + mavprog = [sys.executable, '-m', 'MAVProxy.mavproxy'] + p = Popen(mavprog + ['--logfile=' + tempfile.mkstemp()[1], '--master=tcp:127.0.0.1:5760'], cwd=testpath, env=newenv, stdin=PIPE, stdout=PIPE, stderr=PIPE if not mavproxy_verbose else None) bg.append(p) From 6a29e71ffa924be7f44fda98e7ab3b989066323d Mon Sep 17 00:00:00 2001 From: Tim Ryan Date: Fri, 24 Jul 2015 13:00:35 -0700 Subject: [PATCH 4/4] Updates Appveyor tests to use Windows installer. --- appveyor.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index bf793a0bd..d567c78c6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,11 +20,26 @@ install: - cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 wheel numpy & endlocal" - cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 install nose numpy psutil mock & endlocal" - cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & pip2 install git+https://github.com/3drobotics/dronekit-sitl-runner.git & endlocal" + + - cmd: choco install innosetup + - cmd: cd windows & droneapiWinBuild.bat + - ps: | + Invoke-WebRequest "http://firmware.diydrones.com/Tools/MAVProxy/MAVProxySetup-latest.exe" -OutFile MAVProxySetup-latest.exe + .\MAVProxySetup-latest.exe /VERYSILENT /LOG=setup-mavproxy.log + while (!(Test-Path "setup-mavproxy.log")) { Start-Sleep 1 } + while(!(Select-String -path 'setup-mavproxy.log' -pattern 'Log closed' -quiet)){ Start-Sleep 1 }; + rm ~\AppData\Local\MAVProxy\mavinit.scr + - ps: | + $setup = gi .\windows\Output\DroneKitsetup-*.exe + & $setup /VERYSILENT /LOG=setup-dronekit.log + while (!(Test-Path "setup-dronekit.log")) { Start-Sleep 1 } + while(!(Select-String -path 'setup-dronekit.log' -pattern 'Log closed' -quiet)){ Start-Sleep 1}; + build_script: + - cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;c:\\Program Files (x86)\\MAVProxy;%PATH% & python -m tests.sitl & endlocal" - cmd: 'setlocal & python setup.py install & endlocal' - cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & nosetests tests\\web & endlocal" - cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & nosetests tests\\unit & endlocal" - - cmd: "setlocal & SET PATH=%PYTHON%;c:\\Python27\\Scripts;%PATH% & python -m tests.sitl & endlocal" clone_depth: 10 test: 'off' branches: