Skip to content

Commit

Permalink
Fixed the path from where the hal gets downloaded to NAO to be appdat…
Browse files Browse the repository at this point in the history
…a/openroberta or user home/openroberta
  • Loading branch information
Artem Vinokurov committed May 25, 2018
1 parent 87a5f08 commit 599d3f8
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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/";
}

}

Expand All @@ -68,11 +78,11 @@ public void uploadFile(byte[] binaryfile, String fileName) throws Exception {

}
List<String> 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 ) {
Expand Down
2 changes: 1 addition & 1 deletion Resources/USBInstaller/Linux/install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

version="1.0.3"
version="1.0.4"
dir="$( pwd )"

echo "[Desktop Entry]" > "/usr/share/applications/ORUSBNao.desktop"
Expand Down
4 changes: 2 additions & 2 deletions Resources/USBInstaller/Windows/build.bat
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions Resources/USBInstaller/Windows/setup.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<?define RTMProductVersion="1.0.0" ?>
<?define ProductVersion=1.0.3?>
<?define ProductVersion=1.0.4?>
<?define UpgradeCode="799563e9-08f9-4b92-9747-335577c25a45"?>
<?define ProductCode="379a1a40-7e3e-4a86-980e-fb06aa4ed9be"?>
<?define Manufacturer="Fraunhofer IAIS"?>
Expand Down Expand Up @@ -42,7 +42,7 @@ Property="UPGRADEFOUND" />

<Media Id='1' Cabinet='Setup.cab' EmbedCab='yes' />
<Property Id="InstallationFolder">OpenRobertaNAO</Property>
<Icon Id="OpenRobertaNAO" SourceFile="OpenRobertaNAO-1.0.3.exe" />
<Icon Id="OpenRobertaNAO" SourceFile="OpenRobertaNAO-1.0.4.exe" />
<Property Id="ARPPRODUCTICON" Value="OpenRobertaNAO" />
<WixVariable Id="WixUILicenseRtf" Value="Resources_installer\Apache2.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="Resources_installer\ORBanner.bmp" />
Expand All @@ -53,7 +53,7 @@ Property="UPGRADEFOUND" />
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="OpenRobertaNAO">
<Component Id="ApplicationFiles" Guid="3d140aef-be7d-46f9-90c3-66fec0d27f4a">
<File Id="USBCONNECTION_EXE" Source="OpenRobertaNAO-1.0.3.exe" KeyPath="yes"/>
<File Id="USBCONNECTION_EXE" Source="OpenRobertaNAO-1.0.4.exe" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
Expand All @@ -65,14 +65,14 @@ Property="UPGRADEFOUND" />

<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="8f36c49b-9fb0-4e99-a3c2-94aa3249ef2e">
<Shortcut Id="ApplicationStartMenuShortcut" Name="Open Roberta NAO" Description="Open Roberta NAO" Target="[INSTALLDIR]OpenRobertaNAO-1.0.3.exe" WorkingDirectory="INSTALLDIR" />
<Shortcut Id="ApplicationStartMenuShortcut" Name="Open Roberta NAO" Description="Open Roberta NAO" Target="[INSTALLDIR]OpenRobertaNAO-1.0.4.exe" WorkingDirectory="INSTALLDIR" />
<RemoveFolder Id="RemoveApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\OpenRobertaNAO" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<DirectoryRef Id="DesktopFolder">
<Component Id="ApplicationShortcutDesktop" Guid="2a3ade68-6ffb-4f72-b3ce-f5406657bae0">
<Shortcut Id="ApplicationDesktopShortcut" Name="Open Roberta NAO" Description="Open Roberta NAO" Target="[INSTALLDIR]OpenRobertaNAO-1.0.3.exe" WorkingDirectory="INSTALLDIR" />
<Shortcut Id="ApplicationDesktopShortcut" Name="Open Roberta NAO" Description="Open Roberta NAO" Target="[INSTALLDIR]OpenRobertaNAO-1.0.4.exe" WorkingDirectory="INSTALLDIR" />
<RemoveFolder Id="RemoveDesktopFolder" Directory="DesktopFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\OpenRobertaNAO" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
Expand Down
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.fhg.iais.openroberta</groupId>
<artifactId>OpenRobertaNAO</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<build>
<sourceDirectory>${project.basedir}/OpenRobertaNAO/src/main/java</sourceDirectory>
<scriptSourceDirectory>OpenRobertaNAO/src/main/scripts</scriptSourceDirectory>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.fhg.iais.openroberta</groupId>
<artifactId>OpenRobertaNAO</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<properties>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
<buildTimeStamp>${maven.build.timestamp}</buildTimeStamp>
Expand Down

0 comments on commit 599d3f8

Please sign in to comment.