Skip to content

Two fix for future Windows compatibility #6331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<classpathentry kind="lib" path="lib/slf4j-api-1.7.22.jar"/>
<classpathentry kind="lib" path="lib/slf4j-simple-1.7.22.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.50.jar"/>
<classpathentry kind="lib" path="lib/jssc-2.8.0.jar"/>
<classpathentry kind="lib" path="lib/jssc-2.8.0-arduino1.jar"/>
<classpathentry kind="lib" path="lib/rsyntaxtextarea-2.6.1.jar"/>
<classpathentry kind="lib" path="lib/xml-apis-1.3.04.jar"/>
<classpathentry kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>
Expand Down
Binary file renamed app/lib/jssc-2.8.0.jar → app/lib/jssc-2.8.0-arduino1.jar
100644 → 100755
Binary file not shown.
2 changes: 1 addition & 1 deletion arduino-core/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<classpathentry kind="lib" path="lib/jmdns-3.5.1.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.22.jar"/>
<classpathentry kind="lib" path="lib/slf4j-simple-1.7.22.jar"/>
<classpathentry kind="lib" path="lib/jssc-2.8.0.jar"/>
<classpathentry kind="lib" path="lib/jssc-2.8.0-arduino1.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.50.jar"/>
<classpathentry kind="lib" path="lib/commons-exec-1.1.jar"/>
<classpathentry kind="lib" path="../app/lib/commons-codec-1.7.jar"/>
Expand Down
Binary file renamed arduino-core/lib/jssc-2.8.0.jar → arduino-core/lib/jssc-2.8.0-arduino1.jar
100644 → 100755
Binary file not shown.
29 changes: 14 additions & 15 deletions arduino-core/src/processing/app/windows/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.Shell32;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

Expand Down Expand Up @@ -129,11 +130,15 @@ public void openURL(String url) throws Exception {
if (file.exists()) {
// in this case convert the path to a "file:" url
url = file.toURI().toString();

// this allows to open the file on Windows 10 that
// has a more strict permission policy for cmd.exe
}
}
if (url.startsWith("http") || url.startsWith("file:")) {
// this allows to open the file on Windows 10 that
// has a more strict permission policy for cmd.exe
final int SW_SHOW = 5;
Shell32.INSTANCE.ShellExecute(null, null, url, null, null, SW_SHOW);
return;
}

// this is not guaranteed to work, because who knows if the
// path will always be c:\progra~1 et al. also if the user has
Expand All @@ -150,18 +155,12 @@ public void openURL(String url) throws Exception {
// "Access is denied" in both cygwin and the "dos" prompt.
//Runtime.getRuntime().exec("cmd /c " + currentDir + "\\reference\\" +
// referenceFile + ".html");
if (url.startsWith("http") || url.startsWith("file:")) {
// open dos prompt, give it 'start' command, which will
// open the url properly. start by itself won't work since
// it appears to need cmd
Runtime.getRuntime().exec("cmd /c start \"\" \"" + url + "\"");
} else {
// just launching the .html file via the shell works
// but make sure to chmod +x the .html files first
// also place quotes around it in case there's a space
// in the user.dir part of the url
Runtime.getRuntime().exec("cmd /c \"" + url + "\"");
}

// just launching the .html file via the shell works
// but make sure to chmod +x the .html files first
// also place quotes around it in case there's a space
// in the user.dir part of the url
Runtime.getRuntime().exec("cmd /c \"" + url + "\"");
}


Expand Down
27 changes: 27 additions & 0 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,33 @@
<param name="file" value="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
</antcall>

<exec executable="unzip" failonerror="true">
<arg value="-q" />
<arg value="-n" />
<arg value="-j" />
<arg value="-d" />
<arg value="windows/work/lib" />
<arg value="../arduino-core/lib/jssc-2.8.0-arduino1.jar" />
<arg value="libs/windows/jSSC-2.8_x86.dll" />
</exec>
<move file="windows/work/lib/jSSC-2.8_x86.dll" tofile="windows/work/lib/jSSC-2.8_x86.dll" />
<antcall target="make-file-executable">
<param name="file" value="windows/work/lib/jSSC-2.8_x86.dll" />
</antcall>
<exec executable="unzip" failonerror="true">
<arg value="-q" />
<arg value="-n" />
<arg value="-j" />
<arg value="-d" />
<arg value="windows/work/lib" />
<arg value="../arduino-core/lib/jssc-2.8.0-arduino1.jar" />
<arg value="libs/windows/jSSC-2.8_x86_64.dll" />
</exec>
<move file="windows/work/lib/jSSC-2.8_x86_64.dll" tofile="windows/work/lib/jSSC-2.8_x86_64.dll" />
<antcall target="make-file-executable">
<param name="file" value="windows/work/lib/jSSC-2.8_x86_64.dll" />
</antcall>

<antcall target="assemble">
<param name="target.path" value="windows/work" />
</antcall>
Expand Down
3 changes: 2 additions & 1 deletion build/windows/launcher/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<cp>%EXEDIR%/lib/jna-4.2.2.jar</cp>
<cp>%EXEDIR%/lib/jna-platform-4.2.2.jar</cp>
<cp>%EXEDIR%/lib/jsch-0.1.50.jar</cp>
<cp>%EXEDIR%/lib/jssc-2.8.0.jar</cp>
<cp>%EXEDIR%/lib/jssc-2.8.0-arduino1.jar</cp>
<cp>%EXEDIR%/lib/pde.jar</cp>
<cp>%EXEDIR%/lib/rsyntaxtextarea-2.6.1.jar</cp>
<cp>%EXEDIR%/lib/xml-apis-1.3.04.jar</cp>
Expand All @@ -63,6 +63,7 @@
<opt>-Djna.nounpack=true</opt>
<opt>-Djna.boot.library.name=jnidispatch-4.2.2-win32-x86</opt>
<opt>-Djna.boot.library.path="%EXEDIR%"/lib</opt>
<opt>-Djssc.library.path="%EXEDIR%"/lib</opt>
<opt>-DAPP_DIR="%EXEDIR%"</opt>
</jre>
<versionInfo>
Expand Down
3 changes: 2 additions & 1 deletion build/windows/launcher/config_debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<cp>%EXEDIR%/lib/jna-4.2.2.jar</cp>
<cp>%EXEDIR%/lib/jna-platform-4.2.2.jar</cp>
<cp>%EXEDIR%/lib/jsch-0.1.50.jar</cp>
<cp>%EXEDIR%/lib/jssc-2.8.0.jar</cp>
<cp>%EXEDIR%/lib/jssc-2.8.0-arduino1.jar</cp>
<cp>%EXEDIR%/lib/pde.jar</cp>
<cp>%EXEDIR%/lib/rsyntaxtextarea-2.6.1.jar</cp>
<cp>%EXEDIR%/lib/xml-apis-1.3.04.jar</cp>
Expand All @@ -62,6 +62,7 @@
<opt>-Djna.nounpack=true</opt>
<opt>-Djna.boot.library.name=jnidispatch-4.2.2-win32-x86</opt>
<opt>-Djna.boot.library.path="%EXEDIR%"/lib</opt>
<opt>-Djssc.library.path="%EXEDIR%"/lib</opt>
<opt>-Djna.debug_load=true</opt>
<opt>-DAPP_DIR="%EXEDIR%"</opt>
<opt>-DDEBUG=true</opt>
Expand Down