Giter Site home page Giter Site logo

Distribution with Electron about gkm HOT 4 OPEN

sklink avatar sklink commented on July 25, 2024
Distribution with Electron

from gkm.

Comments (4)

tomzx avatar tomzx commented on July 25, 2024

First off, I think it would be best if electron offered such feature out of the box. Relying/Depending on java in a node application/context is pretty bad and gkm was more of a proof of concept than expected to be used in any production application to be honest.

Now, it is true that it would be relatively simple to modify

var gkm = spawn('java', ['-jar', path.join(__dirname, 'lib/gkm.jar')]);

such that it could receive any path to the java binary.

As a side note, gkm could be modified to have start/stop functions which would start/stop the spawned process (or simply drop events). It would make it possible to configure the path to java before it is spawned (as the process is now spawned as soon as you require gkm).

So, something like gkm.setJavaPath(path) could be conceivable or otherwise a config object and a gkm.setConfig({javaPath: path}) method.

from gkm.

sklink avatar sklink commented on July 25, 2024

Seems like anything that occurs while Electron is focused is already covered. I'm not sure Electron could handle anything outside of the window. I'll make an issue for it over there but my guess is it'll be out of scope.

I could remove gkm to avoid relying on Java but it's doing a lot to make the in-game overlay I'm building feel more reactive.

Something like this?
https://gist.github.com/sklink/e75a5ac546fefbe0796ac2009f0b0695

I don't know much about using and managing child processes. .kill('SIGINT') was the first thing to pop up when I searched.

from gkm.

tomzx avatar tomzx commented on July 25, 2024

I agree with you that it is likely this is out of Electron's scope. NW.js however did implement something (see nwjs/nw.js#1735).

As for your gist, yes, something like that would work (don't forget to export setJavaPath). Furthermore, I think you'd want to call .kill() (defaults to SIGTERM) instead of .kill('SIGINT').

from gkm.

mmikhan avatar mmikhan commented on July 25, 2024

@tomzx How do you pack Java with the Electron package so you can use the Local Java path instead of using the Globally installed one?

from gkm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.