This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-14
Channels
- # announcements (2)
- # aws (1)
- # babashka (18)
- # babashka-sci-dev (103)
- # beginners (165)
- # calva (51)
- # cider (8)
- # circleci (1)
- # clj-kondo (22)
- # clj-on-windows (2)
- # cljdoc (1)
- # cljfx (31)
- # cljs-dev (16)
- # clojure (81)
- # clojure-europe (71)
- # clojure-nl (7)
- # clojure-uk (11)
- # clojurescript (20)
- # code-reviews (26)
- # conjure (1)
- # contributions-welcome (1)
- # core-async (15)
- # cursive (8)
- # datomic (8)
- # defnpodcast (2)
- # eastwood (24)
- # emacs (10)
- # events (1)
- # fulcro (4)
- # funcool (31)
- # graalvm (43)
- # graphql (8)
- # honeysql (9)
- # introduce-yourself (1)
- # jobs (12)
- # kaocha (3)
- # lsp (28)
- # malli (4)
- # meander (4)
- # membrane (7)
- # off-topic (64)
- # other-languages (3)
- # pedestal (1)
- # polylith (31)
- # portal (5)
- # re-frame (4)
- # reitit (1)
- # releases (5)
- # rum (2)
- # schema (2)
- # sci (34)
- # shadow-cljs (21)
- # vscode (1)
Is there a good process for automatic updates? @vlaaad Taking a look it seems that jpackage doesn't offer this out of the box. I found update4j which seems like it might be a solution but have to dig further on that.
Hi! Afaik, there is no good process for automatic updates. On the JVM level. When I was working on Defold editor (clj desktop app), we had to implement it ourselves. It also had some issues with overwriting files on Windows which is not allowed by os if it's executed
@grounded_sage You can jpackage a clj
tool instead of your actual app and make it lookup latest release and download + run it :D
Okay. Yea I guess that is a solution. Don't like it but don’t really see many if any options otherwise.
Using tools-deps on a client is actually sorta kinda like browsers lookup/cache web app resources
To dig a bit deeper on this for my comprehension. Do you mean being able to reference the source and build on the client or fetch the Jar/s. Or both. I'm not really sure yet what the different trade offs would be here. With payload size, client side compute, security.
btw I've been thinking about using tools.deps a bit and I think there might be a problem with this approach, though it might be possible to side-step it — tools.deps uses systemwide git for git deps, end users might not have it
Good point on the git. @skynet shared some code that does the Jar fetching. https://clojurians.slack.com/archives/CGHHJNENB/p1642196059014600?thread_ts=1642195307.013300&channel=CGHHJNENB&message_ts=1642196059.014600 Also mentioned it could be a library and I do think that would be valuable. At the very least a dedicated public repo would be a good way to aggregate some discussion and implementations on the best way to handle this.
I’ve thought about it for a bit more and I see another downside — you can’t update the JDK
that reminded me that we struggled with this in Defold where we needed to update the JDK — on Windows the OS held some files open and that disallowed overwriting them, so we had to install JDKs in different locations…
ah yes updating the JDK is another thing to consider.
This is what Electron is using it seems. https://github.com/Squirrel. I'm currently digging around to see if it's a viable solution.
I'm wondering if it's possible to do a GraalVM native binary which can be the installer. Was reading that JavaFX doesn't play nice with it but Gluon has it working.. we could then have a minimal custom UI and then handle installing the JRE and .jar
separately.
Rereading what you said before... you managed to solve the JDK updates at Defold?
that's the updater code, but every auto-updated system is 2 parts — client that downloads and release process... it's also there, but it's python, and deals with internal setup and aws and stuff
Of course with the downside that it requires internet connection to start it the first time
I find this an acceptable trade off
Yea at the moment I have tools.build to build the jar file and also call on jpackage for the distributions. But going to have to rethink how I structure it because automatic updates is preferable.
you can do auto updates even when using jpackage
by replacing the .jar
file. if you need to replace it somewhere that has special permissions on Windows you can use something like https://github.com/jpassing/elevate
Do you know any example projects in the wild that do this? @skynet I’ve done a bit of searching but at the moment think I'll just end up doing a bit of hacking next week. I come from more js environment so this whole environment is new to me
I do it in a project here https://github.com/skynet-gh/skylobby/blob/a606f4d/src/clj/spring_lobby.clj#L2260-L2309 with some helper fns here https://github.com/skynet-gh/skylobby/blob/master/graal/clj/skylobby/util.clj#L477-L525
this works on Windows using the normal jpackage install run by .exe
, but can also be used if running from a .jar
You've saved me hours of frustration. I'll be diving into the code deeper next week. Thank you.
no problem, let me know if you have any issues. maybe there should be a library that does this kind of thing
Oh yea. I do think this would be a valuable library.
My thinking is definitely leaning towards having a minimal install updated shell and then just swapping out the jar for the remainder of the application