Skip to content

Commit

Permalink
Fixup verifyWinePrefix for Proton... again (#1388)
Browse files Browse the repository at this point in the history
  • Loading branch information
CommandMC authored May 28, 2022
1 parent 099ec05 commit 9d4912a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions electron/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ export async function verifyWinePrefix(
mkdirSync(winePrefix, { recursive: true })
}

if (wineVersion.type === 'proton' && existsSync(join(winePrefix, 'pfx'))) {
return { res: { stdout: '', stderr: '' }, updated: false }
}

// If the registry isn't available yet, things like DXVK installers might fail. So we have to wait on wineboot then
const systemRegPath =
wineVersion.type === 'proton'
Expand All @@ -333,6 +337,9 @@ export async function verifyWinePrefix(
return game
.runWineCommand('wineboot --init', '', haveToWait)
.then((result) => {
if (wineVersion.type === 'proton') {
return { res: result, updated: true }
}
// This is kinda hacky
const wasUpdated = result.stderr.includes('has been updated')
return { res: result, updated: wasUpdated }
Expand Down

0 comments on commit 9d4912a

Please sign in to comment.