Skip to content

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.

781 B
Raw Blame
import type { WineInstallation } from 'common/types'

/** GPTK cannot host the Windows Steam client reliably. */
export function isGptkRunner(path: string | undefined): boolean {
  return !!path && /game-porting-toolkit|gptk/i.test(path)
}

/**
 * Wine that should host the Windows Steam runtime: DXMT builds first, then
 * CrossOver, then any other plain Wine. GPTK is never a candidate.
 */
export function selectSteamRuntimeRunner(
  wines: WineInstallation[]
): WineInstallation | undefined {
  const playable = wines.filter((wine) => wine.bin && wine.type !== 'toolkit')
  return (
    playable.find((wine) => wine.type === 'wine' && /dxmt/i.test(wine.name)) ??
    playable.find((wine) => wine.type === 'crossover') ??
    playable.find((wine) => wine.type === 'wine')
  )
}