Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Cache installed wine version on prefix #4027

Merged
merged 4 commits into from
Nov 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/backend/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import { showDialogBoxModalAuto } from './dialog/dialog'
import { legendarySetup } from './storeManagers/legendary/setup'
import { gameManagerMap } from 'backend/storeManagers'
import * as VDF from '@node-steam/vdf'
import { readFileSync } from 'fs'
import { readFileSync, writeFileSync } from 'fs'
import { LegendaryCommand } from './storeManagers/legendary/commands'
import { commandToArgsArray } from './storeManagers/legendary/library'
import { searchForExecutableOnPath } from './utils/os/path'
Expand Down Expand Up @@ -826,13 +826,16 @@ export async function verifyWinePrefix(

return command
.then((result) => {
// This is kinda hacky
const wasUpdated = result.stderr.includes(
wineVersion.type === 'proton'
? 'Proton: Upgrading prefix from'
: 'has been updated'
)
return { res: result, updated: wasUpdated }
const currentWinePath = join(winePrefix, 'current_wine')
if (
!existsSync(currentWinePath) ||
readFileSync(currentWinePath, 'utf-8') != wineVersion.bin
) {
writeFileSync(currentWinePath, wineVersion.bin, 'utf-8')
return { res: result, updated: true }
} else {
return { res: result, updated: false }
Etaash-mathamsetty marked this conversation as resolved.
Show resolved Hide resolved
}
})
.catch((error) => {
logError(['Unable to create Wineprefix: ', error], LogPrefix.Backend)
Expand Down
Loading