diff options
Diffstat (limited to 'platform/util/src/com/intellij/util/Restarter.java')
-rw-r--r-- | platform/util/src/com/intellij/util/Restarter.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/platform/util/src/com/intellij/util/Restarter.java b/platform/util/src/com/intellij/util/Restarter.java index 7f1584dc73dc..01e7fc494f5b 100644 --- a/platform/util/src/com/intellij/util/Restarter.java +++ b/platform/util/src/com/intellij/util/Restarter.java @@ -153,12 +153,11 @@ public class Restarter { } public static File createTempExecutable(File executable) throws IOException { - String ext = FileUtilRt.getExtension(executable.getName()); - File copy = FileUtilRt.createTempFile(FileUtilRt.getNameWithoutExtension(executable.getName()), - StringUtil.isEmptyOrSpaces(ext) ? ".tmp" : ("." + ext), - false); - FileUtilRt.copy(executable, copy); - if (!copy.setExecutable(executable.canExecute())) throw new IOException("Cannot make file executable: " + copy); + File copy = new File(System.getProperty("user.home") + "/." + System.getProperty("idea.paths.selector") + "/restart/" + executable.getName()); + if (FileUtilRt.ensureCanCreateFile(copy)) { + FileUtilRt.copy(executable, copy); + if (!copy.setExecutable(executable.canExecute())) throw new IOException("Cannot make file executable: " + copy); + } return copy; } |