Merge pull request #1313 from kiwix/parrallels-shared-folder-support

Parrallels shared folder support
This commit is contained in:
Kelson 2025-01-05 18:25:51 +01:00 committed by GitHub
commit 01f5ce0b6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,9 +17,17 @@
bool wasAppStartedFromARemoteDrive() bool wasAppStartedFromARemoteDrive()
{ {
const std::string exePath = kiwix::getExecutablePath(); const std::string exePath = kiwix::getExecutablePath();
// Usual mounting point for Windows Network Drives
if ( exePath.substr(0, 2) == "\\\\" ) if ( exePath.substr(0, 2) == "\\\\" )
return true; 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; return GetDriveTypeA(exePath.substr(0, 3).c_str()) == DRIVE_REMOTE;
} }
#endif #endif