Skip to content

Commit 18f18bf

Browse files
committed
JNA: try to avoid unzipping jnidispatch.dll from jar on Windows
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.
1 parent cc6c68e commit 18f18bf

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

build/build.xml

+12
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,18 @@
10021002
</copy>
10031003
<delete dir="${staging_folder}/arduino-builder-windows" includeemptydirs="true"/>
10041004

1005+
<exec executable="unzip" failonerror="true">
1006+
<arg value="-q" />
1007+
<arg value="-n" />
1008+
<arg value="-j" />
1009+
<arg value="-d" />
1010+
<arg value="windows/work/lib" />
1011+
<arg value="../arduino-core/lib/jna-4.2.2.jar" />
1012+
<arg value="com/sun/jna/win32-x86/jnidispatch.dll" />
1013+
</exec>
1014+
<move file="windows/work/lib/jnidispatch.dll" tofile="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
1015+
<chmod perm="755" file="windows/work/lib/jnidispatch-4.2.2-win32-x86.dll" />
1016+
10051017
<antcall target="assemble">
10061018
<param name="target.path" value="windows/work" />
10071019
</antcall>

build/windows/launcher/config.xml

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
<opt>-splash:"%EXEDIR%/lib/splash.png"</opt>
6161
<opt>-Dsun.java2d.d3d=false</opt>
6262
<opt>-Djna.nosys=true</opt>
63+
<opt>-Djna.nounpack=true</opt>
64+
<opt>-Djna.boot.library.name=jnidispatch-4.2.2-win32-x86</opt>
65+
<opt>-Djna.boot.library.path="%EXEDIR%"/lib</opt>
6366
<opt>-DAPP_DIR="%EXEDIR%"</opt>
6467
</jre>
6568
<versionInfo>

build/windows/launcher/config_debug.xml

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
<runtimeBits>32</runtimeBits>
6060
<opt>-Dsun.java2d.d3d=false</opt>
6161
<opt>-Djna.nosys=true</opt>
62+
<opt>-Djna.nounpack=true</opt>
63+
<opt>-Djna.boot.library.name=jnidispatch-4.2.2-win32-x86</opt>
64+
<opt>-Djna.boot.library.path="%EXEDIR%"/lib</opt>
65+
<opt>-Djna.debug_load=true</opt>
6266
<opt>-DAPP_DIR="%EXEDIR%"</opt>
6367
<opt>-DDEBUG=true</opt>
6468
</jre>

0 commit comments

Comments
 (0)