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

fix: add default path for crossover on macOS #3728

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

WangEdward
Copy link

If user disabled Spotlight, mdfind will not work. /Applications/CrossOver.app is the default install location for CrossOver, therefore adding it here as a backup.

Fixes #3025


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

If user disabled spotlight, `mdfind` will not work.
Fixes Heroic-Games-Launcher#3025
@flavioislima
Copy link
Member

flavioislima commented Apr 28, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@WangEdward
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

crossoverMacPath.add(crossoverAppPath)
}

// search for crossover installed around the system
await execAsync(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested to see if it won't duplicate the entry on the wine list?

Copy link
Author

@WangEdward WangEdward May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it on my machine with Spotlight disabled; it has only one entry of crossover.

I cannot test for duplicates as I do not have Spotlight (mdfind) enabled.

However, since crossoverMacPath is a Set, it should ignore duplicate entries.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good point.
I will try to test on a macOS this week just to be sure.

@ahmed2m
Copy link

ahmed2m commented May 11, 2024

Can you include the same for Whisky? The same thing not finding it if spotlight index disabled. Ref. Discord thread

@WangEdward
Copy link
Author

WangEdward commented May 11, 2024

Can you include the same for Whisky? The same thing not finding it if spotlight index disabled. Ref. Discord thread

I could not open the Discord link you provided(maybe because I am not in that certain channel). But I assume the default install path for Whisky is /Applications/Whisky.app. If that's the case, then I can easily add the default path to the getWhisky method.

However, the implementation of getWhisky in #3358 is kinda weird. The wine executable is at ${userHome}/Library/Application Support/com.isaacmarovitz.Whisky/Libraries/Wine/bin/wine64, which is not inside the Whisky.app. Looking for the .app file just to extract version info seems a little bit too redundant and inaccurate to me; maybe just using the version output by wine64 would be better?🤔 I would like to hear from Heroic's maintainers about their opinion on this.

@ahmed2m
Copy link

ahmed2m commented May 11, 2024

I have no idea about the wine path but the main issue to start with relies on this line mdfind kMDItemCFBundleIdentifier = "com.isaacmarovitz.Whisky" which uses the spotlight indexes (I believe this is just to find the Whisky.app in /Applications/).

@WangEdward

This comment was marked as resolved.

@ahmed2m
Copy link

ahmed2m commented May 11, 2024

Works I guess, but it's not really the Whisky version, for reference following are the output of the command and what's currently displayed in Heroic settings.

Screenshots

CleanShot 2024-05-11 at 17 19 55@2x

CleanShot 2024-05-11 at 17 22 19@2x

WangEdward added a commit to WangEdward/HeroicGamesLauncher that referenced this pull request May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[macOS] Alternative way to find Wine and GPTK binaries
3 participants