I made a game with Unity and now I want to make a game launcher for it. I already start and I have a problem now. I use electron with Html, Css and want to use JS in the backend. I have an button with an ID and in JS I have an event handler for it.
Thats the inportant part of Html:
<img id="startGame" class="instances-icon1" src="assets/icons8-add-48.png">
And thats the important part of Javascript:
const updateURL = 'https://www.dropbox.com/sh/smphut3qh3z40p6/AACHccLIURSjFd3a1vHrMmq4a?dl=1';
const executablePath = 'C:\Users\Linus\Documents\Bluci Runners\exe';
document.getElementById("startGame").addEventListener("click", function() {
fetch(updateURL).then(res => res.blob()).then(blob => fs.createWriteStream(executablePath).write(blob));
console.log("Succes!");
})
The dropbox link is where Js shall download the game. My problem is that the event handler isnt working.