File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " wh3mm" ,
3
3
"productName" : " wh3mm" ,
4
- "version" : " 2.12.0 " ,
4
+ "version" : " 2.12.1 " ,
5
5
"description" : " WH3 Mod Manager" ,
6
6
"main" : " .webpack/main" ,
7
7
"scripts" : {
Original file line number Diff line number Diff line change @@ -252,23 +252,25 @@ if (!gotTheLock) {
252
252
} catch ( e ) { }
253
253
254
254
if ( ! checkWH3RunningInterval ) {
255
- checkWH3RunningInterval = setInterval ( async ( ) => {
255
+ const isGameRuningCheck = async ( ) => {
256
256
try {
257
257
// if a game crashes you can end up with a tiny running process of the game, that's why we have a memory filter here
258
258
exec (
259
- `tasklist /fi "MEMUSAGE gt 10000" | findstr ${ gameToProcessName [ appData . currentGame ] } ` ,
260
- ( error ) => {
261
- const isWH3Running = ! error ;
259
+ `tasklist /fi "IMAGENAME eq ${ gameToProcessName [ appData . currentGame ] } " /fi "MEMUSAGE gt 10000" ` ,
260
+ ( _ , stdout ) => {
261
+ const isWH3Running = ! stdout . startsWith ( "INFO: " ) ;
262
262
if ( appData . isWH3Running != isWH3Running ) {
263
263
appData . isWH3Running = isWH3Running ;
264
264
windows . mainWindow ?. webContents . send ( "setIsWH3Running" , appData . isWH3Running ) ;
265
265
}
266
+ if ( checkWH3RunningInterval ) checkWH3RunningInterval . refresh ( ) ;
266
267
}
267
268
) ;
268
269
} catch ( e ) {
269
270
console . log ( "psList coroutine error:" , e ) ;
270
271
}
271
- } , 500 ) ;
272
+ } ;
273
+ checkWH3RunningInterval = setTimeout ( isGameRuningCheck , 500 ) ;
272
274
}
273
275
} ) ;
274
276
} ;
You can’t perform that action at this time.
0 commit comments