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

Remove CrossOver support on Linux #1404

Merged
merged 2 commits into from
Jun 12, 2022
Merged
Changes from all commits
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
72 changes: 25 additions & 47 deletions electron/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,55 +153,33 @@ abstract class GlobalConfig {
public async getCrossover(): Promise<Set<WineInstallation>> {
const crossover = new Set<WineInstallation>()

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
}

Expand Down