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

Installation with app #14

Open
nsainaney opened this issue Sep 9, 2022 · 7 comments
Open

Installation with app #14

nsainaney opened this issue Sep 9, 2022 · 7 comments

Comments

@nsainaney
Copy link

Hi @shermp,
I'm the author of https://kobli.me and @pgaskin suggested I take a look at this tool to help solve an issue my users are having with refreshing the library (https://www.reddit.com/r/kobo/comments/x6slpv/comment/ined3mk/?utm_source=share&utm_medium=web2x&context=3)

I understand that your documentation discourages app developers from installing NickelDBus together with their apps. I also understand that NickelDBus is a shared dependency that could be used by many apps.

I believe the reason you're discouraging packaging NickelDBus with applications is that it could overwrite a newer version of NickelDBus on the device. The downside of checking if NickelDBus is already installed and downloading it post-install is the device would have to restart a second time. Is this correct? Any thoughts about this?

@shermp
Copy link
Owner

shermp commented Sep 9, 2022

Yeah, installing NDB as part of your application can potentially overwrite newer versions, which is why I don't recommend it.

You can see how I handled this problem in Kobo-UNCaGED here and here.

I basically perform the check in the NickelMenu config, and copy the included NickelDBus tgz if NDB is not found (or the installed version is too low). Unfortunately, that does require a reboot.

If you have any ideas of a more elegant way of handling this, I'm all ears!

@nsainaney
Copy link
Author

Thanks for sharing your example solution. For my app, I have a web app that generates and installs the KoboRoot.tgz.

I detect if the browser supports File System Access API (chrome, edge, opera, safari). the browser app (with the user's permission) is able to read the contents of /mnt/onboard (and sub) folders so I would be able to check to see if NDB is already installed, check its version, and generate a koblime app KoboRoot.tgz with or without NDB accordingly. I already generate KoboRoot.tgz dynamically as the archive contains a user-dependent auth token.

Of course, if your browser doesn't support File System Access, I'll use the technique you have above which will result in a second boot. I don't know enough about how Nickel works to know if there is a way to get it to rescan and load plugins without a reboot so I thought I'd ask here.

Thanks!

@shermp
Copy link
Owner

shermp commented Sep 9, 2022

The Nickel* series of plugins are pretending to be Qt image format plugins, so they are directly loaded by Qt when the application starts, in this case, at Nickel startup. Hence the requirement for a reboot.

I've actually had ideas for a dynamic plugin loader floating around inside my head for a while, but I doubt it will ever amount to anything...

@nsainaney
Copy link
Author

Makes sense.

Just a thought: Given that I HAVE to generate KoboRoot.tgz dynamically and that this file isn't supposed to be stored or shared for later use, I can call curl -L -s -H 'Accept: application/json' https://github.com/shermp/NickelDBus/releases/latest and make sure I'm ALWAYS installing the latest version of NickelDBus so I believe it's safe for me to package koblime with NickelDBus.

Would you have any objections to this?

@shermp
Copy link
Owner

shermp commented Sep 9, 2022

Probably would work. I have no plans at this stage to remove deprecated features, although that policy can always be subject to change...

As you can probably tell, I haven't worked on this a while, and the next version isn't imminent, so...

@pgaskin
Copy link
Collaborator

pgaskin commented Sep 9, 2022

I've actually had ideas for a dynamic plugin loader floating around inside my head for a while, but I doubt it will ever amount to anything...

Yeah, that is also blocked by multi-hook and hook unloading support in NH.

One thing I have been experimenting with is supporting multiple side-by-side installations of plugins (possibly signed), optionally pinning to something other than the latest via a config file.

@nsainaney
Copy link
Author

nsainaney commented Sep 10, 2022

I opted for the dynamic KoboRoot.tgz generation. I posted a note here on r/kobo thanking both of you (@pgaskin @shermp) for your kind help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants