https://github.com/purejava/winsparkle-java
Java bindings for WinSparkle
https://github.com/purejava/winsparkle-java
appcast java software-update sparkle update windows
Last synced: 19 days ago
JSON representation
Java bindings for WinSparkle
- Host: GitHub
- URL: https://github.com/purejava/winsparkle-java
- Owner: purejava
- License: mit
- Created: 2022-10-02T11:55:16.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2026-01-10T10:03:48.000Z (21 days ago)
- Last Synced: 2026-01-11T03:12:55.749Z (21 days ago)
- Topics: appcast, java, software-update, sparkle, update, windows
- Language: Java
- Homepage:
- Size: 7.87 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# winsparkle-java

[](https://github.com/purejava/winsparkle-java/blob/master/LICENSE)
[](https://central.sonatype.com/search?q=winsparkle-java&smo=true&namespace=org.purejava)
Java bindings for WinSparkle in 100% pure Java
# Requires
Java 22
# Usage
The bindings come in two flavors:
## Dependency *including* WinSparkle.dll 0.9.1
```java
org.purejava
winsparkle-java
1.3.2
```
WinSparkle.dll gets loaded by the bindings. You don't need to worry about that.
## Dependency *excluding* WinSparkle.dll 0.9.1
```java
org.purejava
winsparkle-java-without-dll
1.3.2
```
You need to place WinSparkle.dll in the Java library path yourself and the bindings take care of loading the dll from there.
All of the API function names are the same as the [original WinSparkle project](https://github.com/vslavik/winsparkle).
## Initialize WinSparkle
Your app must call `win_sparkle_init()` somewhere to initialize WinSparkle and perform the check. The best place to do it is as soon after startup as possible, but no sooner than the app's main window is shown. WinSparkle may show its UI soon after this call, so it’s important that the user can immediately associate its updates popup window with your app.
Before calling `win_sparkle_init()`, you must set the appcast URL with `win_sparkle_set_appcast_url()`:
```java
// Initialize WinSparkle as soon as the app itself is initialized, right
// before entering the event loop:
winsparkle_h.win_sparkle_set_appcast_url("https://winsparkle.org/example/appcast.xml");
winsparkle_h.win_sparkle_init();
```
Finally, you should shut WinSparkle down cleanly when the app exits:
```java
winsparkle_h.win_sparkle_cleanup();
```
## A note on callbacks
WinSparkle provides a lot of useful callbacks. Using them requires a shared session and to allocate the memory for a callback (aka setting the pointer to a function that is executed as the callback) in the shared session:
```java
// Declare a variable for the session
private MemorySession session;
// Open the session on initializing WinSparkle
session = MemorySession.openShared();
// Pass the session to the static method of the callback when memory for the callback is allocated
win_sparkle_did_not_find_update_callback_t.allocate(yourCallback, session);
// Close the session when WinSparkle is shut down
session.close();
```
# Copyright
Copyright (C) 2022 Ralph Plawetzki
The winsparkle-java logo is made from [Icon Fonts](http://www.onlinewebfonts.com/icon) and is licensed by CC BY 3.0