From f85256ae9f713c208942e64e180cd1fd81e3467a Mon Sep 17 00:00:00 2001 From: Matthew Gharrity Date: Thu, 17 Oct 2024 16:43:49 +0200 Subject: [PATCH] IJPL-163431: fix App Translocation check on Mac Translocation affects the IDE installation location, not the system/config locations. PR #2854 GitOrigin-RevId: d591184c0c3f9a1b51925a33cc09a375e9702b63 --- .../src/com/intellij/platform/ide/bootstrap/startup.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/startup.kt b/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/startup.kt index ce085a2ccc38..230bf1c1c1c1 100644 --- a/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/startup.kt +++ b/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/startup.kt @@ -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")