File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ function createWindow() {
44
44
mainWindow = new BrowserWindow ( {
45
45
width : 1024 ,
46
46
height : 768 ,
47
+ autoHideMenuBar : true ,
47
48
webPreferences : {
48
49
preload : path . join ( __dirname , 'preload.js' ) ,
49
50
nodeIntegration : false ,
Original file line number Diff line number Diff line change @@ -322,12 +322,22 @@ class MinecraftStarter {
322
322
args . push ( '--launch-only' ) ;
323
323
}
324
324
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 = {
327
327
cwd : parentDir ,
328
- stdio : 'inherit' ,
329
328
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 ) ;
331
341
332
342
process . on ( 'error' , ( error ) => {
333
343
console . error ( `Error running executable: ${ error . message } ` ) ;
You can’t perform that action at this time.
0 commit comments