Skip to content

Commit

Permalink
JNA: try to avoid unzipping jnidispatch.dll from jar on Windows
Browse files Browse the repository at this point in the history
Normally if JNA doesn't find the jnidispatch.dll it tries to extract
it from the jar into a temp folder and load from there.
This is being restriscted on Microsoft Apps for the app-store and this
commit prevents this behaviour.
  • Loading branch information
cmaglie committed Apr 21, 2017
1 parent cc6c68e commit 18f18bf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,18 @@
</copy>
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>

<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/jna-4.2.2.jar" />
<arg value="com/sun/jna/win32-x86/jnidispatch.dll" />
</exec>
<move file="windows/work/lib/jnidispatch.dll" tofile="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
<chmod perm="755" file="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />

<antcall target="assemble">
<param name="target.path" value="windows/work" />
</antcall>
Expand Down
3 changes: 3 additions & 0 deletions build/windows/launcher/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<opt>-splash:"%EXEDIR%/lib/splash.png"</opt>
<opt>-Dsun.java2d.d3d=false</opt>
<opt>-Djna.nosys=true</opt>
<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>-DAPP_DIR="%EXEDIR%"</opt>
</jre>
<versionInfo>
Expand Down
4 changes: 4 additions & 0 deletions build/windows/launcher/config_debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
<runtimeBits>32</runtimeBits>
<opt>-Dsun.java2d.d3d=false</opt>
<opt>-Djna.nosys=true</opt>
<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>-Djna.debug_load=true</opt>
<opt>-DAPP_DIR="%EXEDIR%"</opt>
<opt>-DDEBUG=true</opt>
</jre>
Expand Down

0 comments on commit 18f18bf

Please sign in to comment.