| 81 | } |
| 82 | |
| 83 | bool isSystemProtected(const wstring &dir) |
| 84 | { |
| 85 | // We're not doing any actual 'system protected' checks here. The user should be installing |
| 86 | // to 'Program Files'. Any other system-protected location is an anti-pattern. |
| 87 | |
| 88 | // make_preferred to normalize the path separator. |
| 89 | filesystem::path fsDir(dir); |
| 90 | const auto targetDir = removeSeparator(fsDir.make_preferred()); |
| 91 | const auto programFiles = Utils::programFilesFolder(); |
| 92 | return ::PathIsPrefix(programFiles.c_str(), dir.c_str()); |
| 93 | } |
| 94 | |
| 95 | } |
no test coverage detected