diff --git a/OpenRobertaNAO/src/main/java/de/fhg/iais/roberta/connection/NAOCommunicator.java b/OpenRobertaNAO/src/main/java/de/fhg/iais/roberta/connection/NAOCommunicator.java index 1ca25f7..53377f4 100644 --- a/OpenRobertaNAO/src/main/java/de/fhg/iais/roberta/connection/NAOCommunicator.java +++ b/OpenRobertaNAO/src/main/java/de/fhg/iais/roberta/connection/NAOCommunicator.java @@ -12,6 +12,7 @@ import java.util.Scanner; import java.util.logging.Logger; +import org.apache.commons.lang3.SystemUtils; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.net.ftp.FTPReply; @@ -36,12 +37,21 @@ public class NAOCommunicator { private final JSch jsch = new JSch(); private final FTPClient ftpClient = new FTPClient(); + private String halZipPath; + private String workingDirectory; public NAOCommunicator(String ip, String username, String password) { this.ip = ip; this.username = username; this.password = password; // this.ftpClient.setConnectTimeout(20000); + if ( SystemUtils.IS_OS_WINDOWS ) { + this.halZipPath = System.getenv("APPDATA") + "/OpenRoberta/roberta.zip"; + this.workingDirectory = System.getenv("APPDATA") + "/OpenRoberta/"; + } else { + this.halZipPath = System.getProperty("user.home") + "/OpenRoberta/roberta.zip"; + this.workingDirectory = System.getProperty("user.home") + "/OpenRoberta/"; + } } @@ -68,11 +78,11 @@ public void uploadFile(byte[] binaryfile, String fileName) throws Exception { } List fileNames = new ArrayList<>(); - fileNames.add(System.getProperty("user.dir") + "/roberta/__init__.py"); - fileNames.add(System.getProperty("user.dir") + "/roberta/blockly_methods.py"); - fileNames.add(System.getProperty("user.dir") + "/roberta/original_hal.py"); - fileNames.add(System.getProperty("user.dir") + "/roberta/speech_recognition_module.py"); - fileNames.add(System.getProperty("user.dir") + "/roberta/face_recognition_module.py"); + fileNames.add(this.workingDirectory + "/roberta/__init__.py"); + fileNames.add(this.workingDirectory + "/roberta/blockly_methods.py"); + fileNames.add(this.workingDirectory + "/roberta/original_hal.py"); + fileNames.add(this.workingDirectory + "/roberta/speech_recognition_module.py"); + fileNames.add(this.workingDirectory + "/roberta/face_recognition_module.py"); byte[] fileContents; try { for ( String fname : fileNames ) { diff --git a/Resources/USBInstaller/Linux/install.sh b/Resources/USBInstaller/Linux/install.sh index 94ffa14..ec32e51 100644 --- a/Resources/USBInstaller/Linux/install.sh +++ b/Resources/USBInstaller/Linux/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -version="1.0.3" +version="1.0.4" dir="$( pwd )" echo "[Desktop Entry]" > "/usr/share/applications/ORUSBNao.desktop" diff --git a/Resources/USBInstaller/Windows/build.bat b/Resources/USBInstaller/Windows/build.bat index c20bba1..15a3fd3 100644 --- a/Resources/USBInstaller/Windows/build.bat +++ b/Resources/USBInstaller/Windows/build.bat @@ -1,4 +1,4 @@ "%WIX%bin\candle.exe" setup.wxs -"%WIX%bin\light.exe" -out OpenRobertaNAOSetupDE_1.0.3.msi -ext WixUIExtension -cultures:de-DE setup.wixobj -"%WIX%bin\light.exe" -out OpenRobertaNAOSetupEN_1.0.3.msi -ext WixUIExtension -cultures:en-US setup.wixobj +"%WIX%bin\light.exe" -out OpenRobertaNAOSetupDE_1.0.4.msi -ext WixUIExtension -cultures:de-DE setup.wixobj +"%WIX%bin\light.exe" -out OpenRobertaNAOSetupEN_1.0.4.msi -ext WixUIExtension -cultures:en-US setup.wixobj @pause diff --git a/Resources/USBInstaller/Windows/setup.wxs b/Resources/USBInstaller/Windows/setup.wxs index 297b17e..6e0522e 100644 --- a/Resources/USBInstaller/Windows/setup.wxs +++ b/Resources/USBInstaller/Windows/setup.wxs @@ -1,7 +1,7 @@ - + @@ -42,7 +42,7 @@ Property="UPGRADEFOUND" /> OpenRobertaNAO - + @@ -53,7 +53,7 @@ Property="UPGRADEFOUND" /> - + @@ -65,14 +65,14 @@ Property="UPGRADEFOUND" /> - + - + diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index d6cf5c7..9c55851 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -3,7 +3,7 @@ 4.0.0 de.fhg.iais.openroberta OpenRobertaNAO - 1.0.3 + 1.0.4 ${project.basedir}/OpenRobertaNAO/src/main/java OpenRobertaNAO/src/main/scripts diff --git a/pom.xml b/pom.xml index ffeda82..75d1550 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 de.fhg.iais.openroberta OpenRobertaNAO - 1.0.3 + 1.0.4 yyyy-MM-dd HH:mm:ss ${maven.build.timestamp}