@@ -69,7 +69,7 @@ import { showDialogBoxModalAuto } from './dialog/dialog'
69
69
import { legendarySetup } from './storeManagers/legendary/setup'
70
70
import { gameManagerMap } from 'backend/storeManagers'
71
71
import * as VDF from '@node-steam/vdf'
72
- import { readFileSync } from 'fs'
72
+ import { readFileSync , writeFileSync } from 'fs'
73
73
import { LegendaryCommand } from './storeManagers/legendary/commands'
74
74
import { commandToArgsArray } from './storeManagers/legendary/library'
75
75
import { searchForExecutableOnPath } from './utils/os/path'
@@ -826,13 +826,16 @@ export async function verifyWinePrefix(
826
826
827
827
return command
828
828
. then ( ( result ) => {
829
- // This is kinda hacky
830
- const wasUpdated = result . stderr . includes (
831
- wineVersion . type === 'proton'
832
- ? 'Proton: Upgrading prefix from'
833
- : 'has been updated'
834
- )
835
- return { res : result , updated : wasUpdated }
829
+ const currentWinePath = join ( winePrefix , 'current_wine' )
830
+ if (
831
+ ! existsSync ( currentWinePath ) ||
832
+ readFileSync ( currentWinePath , 'utf-8' ) != wineVersion . bin
833
+ ) {
834
+ writeFileSync ( currentWinePath , wineVersion . bin , 'utf-8' )
835
+ return { res : result , updated : true }
836
+ } else {
837
+ return { res : result , updated : false }
838
+ }
836
839
} )
837
840
. catch ( ( error ) => {
838
841
logError ( [ 'Unable to create Wineprefix: ' , error ] , LogPrefix . Backend )
0 commit comments