From 23696b6a3ba018f60dfded01f4c3a763b576baae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathis=20Dr=C3=B6ge?= Date: Sun, 29 May 2022 00:34:09 +0200 Subject: [PATCH] Remove CrossOver support on Linux --- electron/config.ts | 72 ++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/electron/config.ts b/electron/config.ts index d848e1b52f..7f135ff9b2 100644 --- a/electron/config.ts +++ b/electron/config.ts @@ -153,55 +153,33 @@ abstract class GlobalConfig { public async getCrossover(): Promise> { const crossover = new Set() - if (isMac) { - await execAsync( - 'mdfind kMDItemCFBundleIdentifier = "com.codeweavers.CrossOver"' - ).then(async ({ stdout }) => { - stdout.split('\n').forEach((crossoverMacPath) => { - const infoFilePath = join(crossoverMacPath, 'Contents', 'Info.plist') - if (crossoverMacPath && existsSync(infoFilePath)) { - const info = plistParse( - readFileSync(infoFilePath, 'utf-8') - ) as PlistObject - const version = info['CFBundleShortVersionString'] || '' - const crossoverWineBin = join( - crossoverMacPath, - 'Contents', - 'SharedSupport', - 'CrossOver', - 'bin', - 'wine' - ) - crossover.add({ - bin: crossoverWineBin, - name: `CrossOver - ${version}`, - type: 'crossover', - ...this.getWineExecs(crossoverWineBin) - }) - } - }) - }) - } else if (!isWindows && !isFlatpak) { - // Linux - const crossoverWineBin = '/opt/cxoffice/bin/wine' - if (!existsSync(crossoverWineBin)) { - return crossover - } - const crossoverVersion = ( - await execAsync(crossoverWineBin + ' --version') - ).stdout - .toString() - .split('\n')[2] - .split(':')[1] - .trim() - crossover.add({ - bin: crossoverWineBin, - name: `CrossOver - ${crossoverVersion}`, - type: 'crossover', - ...this.getWineExecs(crossoverWineBin) - }) + if (!isMac) { + return crossover } + await execAsync( + 'mdfind kMDItemCFBundleIdentifier = "com.codeweavers.CrossOver"' + ).then(async ({ stdout }) => { + stdout.split('\n').forEach((crossoverMacPath) => { + const infoFilePath = join(crossoverMacPath, 'Contents/Info.plist') + if (crossoverMacPath && existsSync(infoFilePath)) { + const info = plistParse( + readFileSync(infoFilePath, 'utf-8') + ) as PlistObject + const version = info['CFBundleShortVersionString'] || '' + const crossoverWineBin = join( + crossoverMacPath, + 'Contents/SharedSupport/CrossOver/bin/wine' + ) + crossover.add({ + bin: crossoverWineBin, + name: `CrossOver - ${version}`, + type: 'crossover', + ...this.getWineExecs(crossoverWineBin) + }) + } + }) + }) return crossover }