Skip to content

Commit 826dd0e

Browse files
author
Simeon Kummer
committed
hide menu bar, hide cmd
1 parent df70ec7 commit 826dd0e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ function createWindow() {
4444
mainWindow = new BrowserWindow({
4545
width: 1024,
4646
height: 768,
47+
autoHideMenuBar: true,
4748
webPreferences: {
4849
preload: path.join(__dirname, 'preload.js'),
4950
nodeIntegration: false,

src/minecraftStarter.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,22 @@ class MinecraftStarter {
322322
args.push('--launch-only');
323323
}
324324

325-
// Spawn the process
326-
const process = spawn(args[0], args.slice(1), {
325+
// Spawn options to prevent cmd window on Windows
326+
const spawnOptions = {
327327
cwd: parentDir,
328-
stdio: 'inherit',
329328
detached: true
330-
});
329+
};
330+
331+
// On Windows, hide the console window
332+
if (process.platform === 'win32') {
333+
spawnOptions.windowsHide = true;
334+
spawnOptions.stdio = 'ignore';
335+
} else {
336+
spawnOptions.stdio = 'inherit';
337+
}
338+
339+
// Spawn the process
340+
const process = spawn(args[0], args.slice(1), spawnOptions);
331341

332342
process.on('error', (error) => {
333343
console.error(`Error running executable: ${error.message}`);

0 commit comments

Comments
 (0)