@@ -597,9 +597,11 @@ export async function initializeCompatibilityLayer() {
597
597
initializationTasks . push ( downloadDefaultWine ( ) )
598
598
}
599
599
600
- if ( isMac ) {
601
- initializationTasks . push ( checkRosettaInstall ( ) )
602
- initializationTasks . push ( setGPTKDefaultOnMacOS ( ) )
600
+ if ( isMac || isLinux ) {
601
+ if ( isMac ) {
602
+ initializationTasks . push ( checkRosettaInstall ( ) )
603
+ }
604
+ initializationTasks . push ( setDefaultCompatibilityLayer ( ) )
603
605
}
604
606
605
607
try {
@@ -616,21 +618,17 @@ export async function downloadDefaultWine() {
616
618
if ( isWindows ) return null
617
619
618
620
try {
619
- // Refresh wine list
620
621
await updateWineVersionInfos ( true )
621
622
622
623
// Get list of available wine versions
623
624
const availableWine = wineDownloaderInfoStore . get ( 'wine-releases' , [ ] )
624
625
625
- // use Wine -GE type if on Linux and GPTK or Wine-Crossover if on Mac
626
+ // use Proton -GE type if on Linux and GPTK or Wine-Crossover if on Mac
626
627
const isGPTKCompatible = isMac ? await isMacSonomaOrHigher ( ) : false
627
628
const results = await Promise . all (
628
629
availableWine . map ( async ( version ) => {
629
630
if ( isLinux ) {
630
- return (
631
- version . type === 'Wine-GE' &&
632
- version . version . includes ( 'Wine-GE-Proton' )
633
- )
631
+ return version . type === 'Proton-GE'
634
632
}
635
633
636
634
if ( isMac ) {
@@ -705,32 +703,46 @@ export async function downloadDefaultWine() {
705
703
}
706
704
}
707
705
708
- export async function setGPTKDefaultOnMacOS ( ) {
709
- const isGPTKCompatible = await isMacSonomaOrHigher ( )
710
- if ( ! isGPTKCompatible ) {
706
+ export async function setDefaultCompatibilityLayer ( ) {
707
+ if ( ! isMac && ! isLinux ) {
711
708
return
712
709
}
713
710
711
+ // For MacOS, check GPTK compatibility
712
+ if ( isMac ) {
713
+ const isGPTKCompatible = await isMacSonomaOrHigher ( )
714
+ if ( ! isGPTKCompatible ) {
715
+ return
716
+ }
717
+ }
718
+
714
719
const { wineVersion : defaultWine } = GlobalConfig . get ( ) . getSettings ( )
715
720
716
- const ignoreList = [ 'crossover' , 'toolkit' ]
721
+ // Get target wine type and prefix name based on platform
722
+ const targetType = isMac ? 'toolkit' : 'proton'
723
+ const prefixName = isMac ? 'GPTK' : 'Proton'
717
724
725
+ // Early return if already using target type
726
+ const ignoreList = [ 'crossover' , 'toolkit' , 'proton' ]
718
727
if (
719
728
ignoreList . includes ( defaultWine . type . toLowerCase ( ) ) ||
720
729
defaultWine . name . includes ( 'Toolkit' )
721
730
) {
722
731
return
723
732
}
724
733
734
+ // Find target wine version
725
735
const wineList = await GlobalConfig . get ( ) . getAlternativeWine ( )
726
- const gptk = wineList . find ( ( wine ) => wine . type === 'toolkit' )
736
+ const targetWine = wineList . find ( ( wine ) => wine . type === targetType )
737
+
738
+ // Set as default if found and valid
739
+ if ( targetWine && existsSync ( targetWine . bin ) ) {
740
+ logInfo ( `Changing wine version to ${ targetWine . name } ` )
741
+ GlobalConfig . get ( ) . setSetting ( 'wineVersion' , targetWine )
727
742
728
- if ( gptk && existsSync ( gptk . bin ) ) {
729
- logInfo ( `Changing wine version to ${ gptk . name } ` )
730
- GlobalConfig . get ( ) . setSetting ( 'wineVersion' , gptk )
731
- // update prefix to use the new one as well
743
+ // Update prefix path
732
744
const installPath = GlobalConfig . get ( ) . getSettings ( ) . defaultInstallPath
733
- const newPrefix = join ( installPath , 'Prefixes' , 'GPTK' )
745
+ const newPrefix = join ( installPath , 'Prefixes' , prefixName )
734
746
GlobalConfig . get ( ) . setSetting ( 'winePrefix' , newPrefix )
735
747
}
736
748
return
0 commit comments