IJPL-163431: fix App Translocation check on Mac

Translocation affects the IDE installation location, not the system/config locations.

PR #2854

GitOrigin-RevId: d591184c0c3f9a1b51925a33cc09a375e9702b63
This commit is contained in:
Matthew Gharrity
2024-10-17 17:25:26 +00:00
committed by intellij-monorepo-bot
parent b7f8ae68db
commit f85256ae9f
@@ -395,15 +395,16 @@ private fun CoroutineScope.checkSystemDirs(lockSystemDirJob: Job): Job {
return launch {
lockSystemDirJob.join()
val homePath = PathManager.getHomePath()
val configPath = PathManager.getConfigDir()
val systemPath = PathManager.getSystemDir()
if (!span("system dirs checking") { doCheckSystemDirs(configPath, systemPath) }) {
if (!span("system dirs checking") { doCheckSystemDirs(homePath, configPath, systemPath) }) {
exitProcess(AppExitCodes.DIR_CHECK_FAILED)
}
}
}
private suspend fun doCheckSystemDirs(configPath: Path, systemPath: Path): Boolean {
private suspend fun doCheckSystemDirs(homePath: String, configPath: Path, systemPath: Path): Boolean {
if (configPath == systemPath) {
StartupErrorReporter.showError(
BootstrapBundle.message("bootstrap.error.title.settings"),
@@ -412,7 +413,7 @@ private suspend fun doCheckSystemDirs(configPath: Path, systemPath: Path): Boole
return false
}
if (SystemInfoRt.isMac && systemPath.toString().contains(MAGIC_MAC_PATH)) {
if (SystemInfoRt.isMac && homePath.contains(MAGIC_MAC_PATH)) {
StartupErrorReporter.showError(
BootstrapBundle.message("bootstrap.error.title.settings"),
BootstrapBundle.message("bootstrap.error.message.mac.trans")