Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Support compiling application bundles that compose can use to auto-update applications #1043

Open
ScottPierce opened this issue Aug 11, 2021 · 6 comments
Assignees
Labels
desktop enhancement New feature or request question Not a bug, but question or comment

Comments

@ScottPierce
Copy link
Contributor

There are several external libraries that allow Java applications to do auto-update with bundles (i.e. https://github.com/update4j/update4j ), but it seems that it's very difficult to use these currently with Compose in order to achieve the auto-updating functionality.

After messing around with the various options, it seems like the best solution is to have the Compose team provide something that would allow the compose desktop applications to update themselves when provided with a file bundle, or something of the sort.

@akurasov akurasov added desktop enhancement New feature or request question Not a bug, but question or comment labels Aug 12, 2021
@akurasov akurasov self-assigned this Aug 12, 2021
@akurasov
Copy link
Contributor

akurasov commented Aug 12, 2021

it seems that it's very difficult to use these currently with Compose

what are the difficulties?

@ScottPierce
Copy link
Contributor Author

The owner of update4j proposed a solution last night. You can find the conversation here - update4j/update4j#149

I got a bit lost in the update4j documentation but I'll try implementing the proposed solution this weekend.

Can someone comment on the name changes for the jars? i.e. animation-core-desktop-1.0.0-alpha2-779ffac333be01750e1babf4c38565e.jar What is the hash that's added to the end of the jar name?

@sonder-joker
Copy link
Contributor

sonder-joker commented Aug 13, 2021

I also foucus on it. I'm develop a application can install plugin.

@sonder-joker
Copy link
Contributor

The owner of update4j proposed a solution last night. You can find the conversation here - update4j/update4j#149

I got a bit lost in the update4j documentation but I'll try implementing the proposed solution this weekend.

Can someone comment on the name changes for the jars? i.e. animation-core-desktop-1.0.0-alpha2-779ffac333be01750e1babf4c38565e.jar What is the hash that's added to the end of the jar name?

I found it generate by this
https://github.com/JetBrains/compose-jb/blob/1561b2736f1e62ad0d61214e8a96342fb841f0a6/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/files/fileUtils.kt#L15

@akurasov akurasov added the Saved label Nov 1, 2021
@ScottPierce
Copy link
Contributor Author

I think this should be something that the gradle plugin provides to us. Some thoughts I wrote down in slack:

It’s lots of simple problems to solve that are complex when combined together I think. Lots of smaller questions come up:

  • How does the app hook in and provide its own custom update UI?
  • How do you do this on windows?
  • How do you allow not only for the classes to be updated, but the JVM as well?

The solution I’ve played around with in my head is to download all the changed files from the previous version, and then downloading a small Kotlin Native executable for the specific platform, and then running that native executable, killing the current process, having the native executable swap out all the files, and then restarting the application.

It’s also theoretically possible though to live update the application without even killing the process if you are only updating classes. I’ve tried this though, and it’s much more complicated than I’d hoped.

@igordmn igordmn removed the Saved label Nov 11, 2022
@okushnikov
Copy link

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop enhancement New feature or request question Not a bug, but question or comment
Projects
None yet
Development

No branches or pull requests

5 participants