(targetPath: string, exePath: string)
| 219 | * 检查目标路径是否位于应用安装目录内(或等于安装目录) |
| 220 | */ |
| 221 | export function isInsideAppInstallDir(targetPath: string, exePath: string): boolean { |
| 222 | const installDir = getAppInstallDir(exePath) |
| 223 | const normalizedTarget = normalizePathForCompare(targetPath) |
| 224 | const normalizedInstall = normalizePathForCompare(installDir) |
| 225 | |
| 226 | return normalizedTarget === normalizedInstall || normalizedTarget.startsWith(`${normalizedInstall}${path.sep}`) |
| 227 | } |
no test coverage detected