I’m curious does anyone understand how the running...
# compose-desktop
s
I’m curious does anyone understand how the running of the Mac application with Compose for Desktop works? In the .app folder that’s generated for a mac application, there is a
Contents/MacOS/<app name>
file that is a unix binary. Somehow this unix binary is starting up the JVM, and running the JVM inside the same process as the unix binary (at least that’s what it looks like is happening externally). How is this possible? I’m asking because I’m wondering if I could replace the unix binary with a Kotlin Native application that checks for and watches for app updates, and then can restart my application to force an update if necessary.
r
You can instantiate a JVM from C/C++ code, but I wouldn't be surprised if that "binary" was just a script. But more importantly why do you need to replace that file to perform updates?
e
if you're not updating via the app store, https://sparkle-project.org/ is more or less the community-chosen framework for macos app updates
m
Generally, forcibly restarting the app whilst the user is using it, would not be very well received. Users can lose their work. The usual model is an update is applied in the background and the user is then notified that they can restart the app at their convenience (now or later buttons). That's what Sparkle does.
s
Restarting the app this way is the exception not the rule. @ephemient I found sparkle a bit of a headache to interact with from the JVM. Or rather I couldn't figure out how reasonably.
@romainguy I don't need to. It just seems to be the ideal place to handle the update from if it's possible or convenient. Then I wouldn't even have to restart the process technically.