[CCC DEV] JNI - Native Calls to WinSparkle.dll

Dave Gilmore gilmorenator at gmail.com
Tue Jul 13 16:42:58 BST 2010


On 13 July 2010 15:19, cljacobsen at gmail.com <cljacobsen at gmail.com> wrote:
> 1) Probably change the package name from
> org.transterpreter.jeditsparkleplugin.JEditSparklePlugin to something
> like org.transterpreter.jeditwinsparkleplugin.JEditWinSparklePlugin
> (note the addition of 'win'). When I originally wrote the mac updater
> there was no WinSparkle (or it was new enough that it had not caught
> my attention) so there seemed little point in specifying MacSparkle...
> however since there are now two distinct Sparkle plugins, one for Mac
> and one for Windows, it is probably good form not to use the same name
> for the two different plugins.

Done :-)

> 2) I think you mentioned something about passing strings through the
> JNI was hard... i can't remember exactly what you said and I'm too
> lazy to find the email, but if it is hard, then I'd get rid of the
> win_sparkle_set_appcast_url function and just hardcode the URL in the
> native bit (for now).

I'll modify the WinSparkle.dll to call the
win_sparkle_set_appcast_url() function during the call to
win_sparkle_init() and harcode the url

> 3) If we are going to be passing arguments to the native methods, I'd
> consider implementing the native stuff in C++ as this has a better way
> of interfacing with JNI I believe (in terms of passing arguments).

Agreed, the screen shots I sent you last week was from an app i put
together in C++ and it was so easy

> 4) In order to build the native header files from the Java class, you
> will actually have to compile the Java file (using the ant script). To
> do this you will have to make sure that build.properties is set
> correctly so that jedit.jar can be found. Mine looks like this:
> jedit.install.dir=C:\\kroc\\distribution\\windows\\build\\jedit\\jedit-program\\
> which assumes that you have run ./build_occplug.sh from the
> distribution/windows directory.

The building is all working :-D

> Once you have successfully built the Java code for the WinSparkle
> plugin you will need to run javah. However, the build script puts the
> object (.class) files in the build directory, so you have to set the
> classpath appropriately:
> javah -classpath build -jni -d native
> org.transterpreter.jeditsparkleplugin.JEditSparklePlugin

I'll give this a bash - fingers crossed that sorts it

> Matt and I are working on getting the perl and python bits of the
> tools to work in Windows and once that is done we should be much
> closer to being able to run a Windows package. Having the Windows
> Spakle stuff is going to be invaluable at that point when we
> repeatedly find that we've done stuff wrong and need to push updates
> to users :)

Cool :-)

I'll keep y'all posted

Cheers,

Dave.




More information about the developers mailing list