private static Path prepare() throws IOException {
    var binPath = PathManager.getBinPath();
    assert Files.isDirectory(Path.of(binPath)) : "Invalid bin path: '" + binPath + "'";

    var iconPath = AppUIUtilKt.findAppIcon();
    if (iconPath == null) throw new RuntimeException(ApplicationBundle.message("desktop.entry.icon.missing", binPath));

    var starter = Restarter.getIdeStarter();
    if (starter == null) throw new RuntimeException(ApplicationBundle.message("desktop.entry.script.missing", binPath));

    var names = ApplicationNamesInfo.getInstance();
    var name = names.getFullProductNameWithEdition();
    var content = ExecUtil.loadTemplate(CreateDesktopEntryAction.class.getClassLoader(), "entry.desktop", Map.of(
      "$NAME$", name,
      "$SCRIPT$", StringUtil.wrapWithDoubleQuote(starter.toString()),
      "$ICON$", iconPath,
      "$COMMENT$", StringUtil.notNullize(names.getMotto(), name),
      "$WM_CLASS$", AppUIUtil.INSTANCE.getFrameClass()));
    var entryFile = Path.of(PathManager.getTempPath(), getDesktopEntryName());
    Files.writeString(entryFile, content);
    return entryFile;
  }
private static Path prepare()