@@ -59,16 +59,12 @@ public W3InstallationData(WurstLanguageServer languageServer, boolean shouldAskF
5959 public W3InstallationData (WurstLanguageServer languageServer , File wc3Path , boolean shouldAskForPath ) {
6060 this .languageServer = languageServer ;
6161 this .shouldAskForPath = shouldAskForPath ;
62- if (!Orient .isWindowsSystem ()) {
63- WLogger .warning ("Game path configuration only works on windows" );
64- discoverExePath ();
65- discoverVersion ();
66- return ;
67- }
6862
69- loadFromPath (wc3Path );
63+ if (Orient .isWindowsSystem () || Orient .isMacSystem ()) {
64+ loadFromPath (wc3Path );
65+ }
7066
71- if (!gameExe .isPresent ()) {
67+ if (!gameExe .isPresent () || ! version . isPresent () ) {
7268 WLogger .warning ("The provided wc3 path wasn't suitable. Falling back to discovery." );
7369 discoverExePath ();
7470 discoverVersion ();
@@ -77,7 +73,19 @@ public W3InstallationData(WurstLanguageServer languageServer, File wc3Path, bool
7773
7874 private void loadFromPath (File wc3Path ) {
7975 try {
80- gameExe = Optional .ofNullable (WinGameExeFinder .fromDirIgnoreVersion (wc3Path ));
76+ if (Orient .isWindowsSystem ()) {
77+ gameExe = Optional .ofNullable (WinGameExeFinder .fromDirIgnoreVersion (wc3Path ));
78+ } else if (Orient .isMacSystem ()) {
79+ // WC3 Reforged on macOS: <installDir>/x86_64/Warcraft III.app/Contents/MacOS/Warcraft III
80+ // Older layout: <installDir>/Warcraft III.app/Contents/MacOS/Warcraft III
81+ File x64 = new File (wc3Path , "x86_64/Warcraft III.app/Contents/MacOS/Warcraft III" );
82+ File x32 = new File (wc3Path , "Warcraft III.app/Contents/MacOS/Warcraft III" );
83+ if (x64 .exists ()) {
84+ gameExe = Optional .of (x64 );
85+ } else if (x32 .exists ()) {
86+ gameExe = Optional .of (x32 );
87+ }
88+ }
8189 } catch (NotFoundException e ) {
8290 WLogger .severe (e );
8391 }
0 commit comments