electron-game-launcher icon indicating copy to clipboard operation
electron-game-launcher copied to clipboard

Game launcher

Open jinzagon opened this issue 4 years ago • 3 comments

Hello. Not an issue really I just wanted to ask you as you vae some experience in electronJS. I'm creating my own gaming launcher using electron JS, everything working smoothly. But I don't know how to open executable from "a href" tag. I mean I have a list of games, and each game has it own "a href" for a local executable. I can launch them in firefox using a plugin that allow it, but how can I do it in electron ?

What I tried so far is disabling the websecurity as mentionned somewhere but didn't work. Any ideas ?

jinzagon avatar Aug 30 '20 21:08 jinzagon

you can use the shell function is electron by using it on the renderer under the onclick or href

function open(){

shell.openItem('path to executable');

}


<a href="javascript:shell.openItem('path to executable');">

bluethefoxofficial avatar Jan 06 '21 18:01 bluethefoxofficial

Thank you ! But with this method, wouldn't closing the electron application result in killing the child process ?

jinzagon avatar Jan 14 '21 07:01 jinzagon

Thank you ! But with this method, wouldn't closing the electron application result in killing the child process ?

Heya, not sure you are still looking for an answer, but a modified version (newer versions have shell.openExternal()) will not close the launched program. I assume the opened program is not actually a child process, so it is not dependant or anything.

https://github.com/xanderfrangos/electron-game-launcher/assets/73738591/71d24e27-795c-425e-b2d7-43a0ef722e11

RichardKanshen avatar Feb 27 '24 19:02 RichardKanshen