Pierce01 / MinecraftLauncher-core

Lightweight module that downloads and runs Minecraft using javascript / NodeJS
MIT License
356 stars 81 forks source link

How do I show the log in my electron app instead of in console? #105

Closed FormalSnake closed 1 year ago

FormalSnake commented 1 year ago

When my app is compiled, minecraft never seems to launch, unless I launch my compiled app from console (mac) So I want to show the log of the minecraft launcher in my electron app, doesn't matter if it's the entire electron log or not.

Like in prism launcher

Screenshot 2023-03-20 at 13 00 44
Bricklou commented 1 year ago

Hi,

if you check the doc here, you'll see that the launch method return a NodeJS child process. You can try to plug your log window on it to retrieve the logs and the game status.

FormalSnake commented 1 year ago

at the monent, i am trying to do it like this:

launcher.on("data", (e) =>
        mainWindow.webContents.send("asynchronous-message", e)
      );

Could this work?

Bricklou commented 1 year ago

yes, it is also possible to use this method.

FormalSnake commented 1 year ago

Allright, thanks!