Changeset 274769 in webkit for trunk/Source/JavaScriptCore/shell


Ignore:
Timestamp:
Mar 22, 2021, 12:00:44 PM (4 years ago)
Author:
[email protected]
Message:

AppleWin can't start due to "Failed to determine path to AAS directory." because iTunes changed the registry key
https://bugs.webkit.org/show_bug.cgi?id=219015

Patch by Tyler Wilcock <Tyler Wilcock> on 2021-03-22
Reviewed by Alex Christensen.

It appears that iTunes no longer sets the Apple Application Support
Source/JavaScriptCore:

registry entry. Fall back to trying to find the iTunes installation
directory if the AAS directory is not present.

  • shell/DLLLauncherMain.cpp:

(iTunesDirectory): Added.
(modifyPath):

Tools:

registry entry. Fallback to trying to find the iTunes installation
directory if the AAS directory is not present.

  • win/DLLLauncher/DLLLauncherMain.cpp:

(iTunesDirectory): Added.
(modifyPath):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/shell/DLLLauncherMain.cpp

    r259565 r274769  
    8383}
    8484
     85static std::wstring iTunesDirectory()
     86{
     87    return applePathFromRegistry(L"SOFTWARE\\Apple Computer, Inc.\\iTunes\\", L"InstallDir");
     88}
     89
    8590static bool prependPath(const std::wstring& directoryToPrepend)
    8691{
     
    129134
    130135#else
    131 
    132     const std::wstring& pathPrefix = appleApplicationSupportDirectory();
    133 
    134     if (!directoryExists(pathPrefix)) {
    135         fatalError(programName, L"Failed to determine path to AAS directory.");
    136         return false;
    137     }
    138 
    139     if (prependPath(pathPrefix))
     136    auto modifyPathWith = [&] (const std::wstring& pathPrefix) {
     137        if (!prependPath(pathPrefix)) {
     138            fatalError(programName, L"Failed to modify PATH environment variable.");
     139            return false;
     140        }
    140141        return true;
    141 
    142     fatalError(programName, L"Failed to modify PATH environment variable.");
     142    };
     143
     144    const std::wstring& applicationSupportPathPrefix = appleApplicationSupportDirectory();
     145    if (directoryExists(applicationSupportPathPrefix))
     146        return modifyPathWith(applicationSupportPathPrefix);
     147
     148    const std::wstring& iTunesPathPrefix = iTunesDirectory();
     149    if (directoryExists(iTunesPathPrefix))
     150        return modifyPathWith(iTunesPathPrefix);
     151
     152    fatalError(programName, L"Couldn't find path to Apple Application Support (AAS) or iTunes via the registry.  Do you have iTunes installed?");
    143153    return false;
    144154#endif
Note: See TracChangeset for help on using the changeset viewer.