diff --git a/bin/linux/restart.py b/bin/linux/restart.py index 5633f1289aff..5d49a22c3820 100755 --- a/bin/linux/restart.py +++ b/bin/linux/restart.py @@ -17,10 +17,8 @@ while os.getppid() == pid: time.sleep(0.5) if len(sys.argv) > 3: - os.spawnv(os.P_WAIT, sys.argv[3], sys.argv[3:]) + to_launch = sys.argv[3:] + os.spawnv(os.P_WAIT, to_launch[0], to_launch) -to_launch = sys.argv[2] -if sys.platform == 'darwin': - os.execv('/usr/bin/open', ['/usr/bin/open', to_launch]) -else: - os.execv(to_launch, [to_launch]) +to_launch = ['/usr/bin/open', sys.argv[2]] if sys.platform == 'darwin' else [sys.argv[2]] +os.execv(to_launch[0], to_launch) diff --git a/platform/platform-impl/src/com/intellij/util/Restarter.java b/platform/platform-impl/src/com/intellij/util/Restarter.java index 69610eb6cbe9..4eb4a60bcbde 100644 --- a/platform/platform-impl/src/com/intellij/util/Restarter.java +++ b/platform/platform-impl/src/com/intellij/util/Restarter.java @@ -41,11 +41,15 @@ public class Restarter { public static boolean isSupported() { if (SystemInfo.isWindows) { - return JnaLoader.isLoaded() && new File(PathManager.getBinPath(), "restarter.exe").exists(); + return JnaLoader.isLoaded() && + new File(PathManager.getBinPath(), "restarter.exe").exists(); } + if (SystemInfo.isMac) { - return PathManager.getHomePath().contains(".app") && new File(PathManager.getBinPath(), "restarter").canExecute(); + return PathManager.getHomePath().contains(".app") && + new File(PathManager.getBinPath(), "restarter").canExecute(); } + if (SystemInfo.isUnix) { return JnaLoader.isLoaded() && CreateDesktopEntryAction.getLauncherScript() != null &&