Skip to content

Commit

Permalink
[Fix] Specify --wrapper only if there are wrappers (#2893)
Browse files Browse the repository at this point in the history
Specify `--wrapper` only if there are wrappers
  • Loading branch information
CommandMC committed Jul 25, 2023
1 parent f83d036 commit 5212c78
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/backend/storeManagers/gog/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,9 @@ export async function launch(
steamRuntime?.length ? [...steamRuntime] : undefined
)

let wineFlag: string[] = ['--wrapper', shlex.join(wrappers)]
let wineFlag: string[] = wrappers.length
? ['--wrapper', shlex.join(wrappers)]
: []

if (!isNative(appName)) {
const {
Expand Down
4 changes: 3 additions & 1 deletion src/backend/storeManagers/legendary/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,9 @@ export async function launch(
steamRuntime?.length ? [...steamRuntime] : undefined
)

let wineFlag: string[] = ['--wrapper', shlex.join(wrappers)]
let wineFlag: string[] = wrappers.length
? ['--wrapper', shlex.join(wrappers)]
: []

if (!isNative(appName)) {
// -> We're using Wine/Proton on Linux or CX on Mac
Expand Down
4 changes: 3 additions & 1 deletion src/backend/storeManagers/nile/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@ export async function launch(
steamRuntime?.length ? [...steamRuntime] : undefined
)

let wineFlag: string[] = ['--wrapper', shlex.join(wrappers)]
let wineFlag: string[] = wrappers.length
? ['--wrapper', shlex.join(wrappers)]
: []

if (!isNative()) {
// -> We're using Wine/Proton on Linux or CX on Mac
Expand Down
2 changes: 1 addition & 1 deletion src/backend/utils/compatibility_layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export function getWineFlags(
switch (wineType) {
case 'wine':
case 'toolkit':
return ['--wine', wineBin, '--wrapper', wrapper]
return ['--wine', wineBin, ...(wrapper ? ['--wrapper', wrapper] : [])]
case 'proton':
return ['--no-wine', '--wrapper', `${wrapper} '${wineBin}' run`]
default:
Expand Down

0 comments on commit 5212c78

Please sign in to comment.