Add support of macOS Parallels shared drive

This commit is contained in:
Emmanuel Engelhart 2024-12-31 11:29:18 +01:00
parent 7295e5b5ea
commit fdd0e8cf90
No known key found for this signature in database
GPG Key ID: 120B30D020B553D3

View File

@ -17,9 +17,17 @@
bool wasAppStartedFromARemoteDrive()
{
const std::string exePath = kiwix::getExecutablePath();
// Usual mounting point for Windows Network Drives
if ( exePath.substr(0, 2) == "\\\\" )
return true;
// Support macOS Parallels shared folders.
// See https://kb.parallels.com/130138
if ( exePath.substr(0, 7) == "C:\\Mac\\" )
return true;
// Last chance to identify as remote drive
return GetDriveTypeA(exePath.substr(0, 3).c_str()) == DRIVE_REMOTE;
}
#endif