in src/main/resources/patch/Agreement.java [106:138]
private void showBundleNotice() {
String lib = new File(PathUtil.getJarPathForClass(getClass())).getParent();
File textAgreement = new File(lib + "/../data/config/options/BundleAgreement.html");
if (!textAgreement.exists()) System.out.println("BundleAgreement.html not found");
File bundleAgreement = new File(lib + "/../data/config/options/bundleAgreement");
if (!bundleAgreement.exists()) {
try {
String text = new String(FileUtil.loadFileText(textAgreement));
if (text.isEmpty()) {
throw new IOException("Cannot read from BundleAgreement.html");
}
showAgreementText("IntelliJ Scala Bundle Agreement", text);
File optionsDirectory = bundleAgreement.getParentFile();
if (!optionsDirectory.exists() && !optionsDirectory.mkdirs()) {
throw new IOException("Cannot create directory: " + bundleAgreement.getAbsolutePath());
}
try (BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(bundleAgreement))) {
stream.write("accepted".getBytes(StandardCharsets.UTF_8));
}
}
catch (Exception e) {
System.out.println(e.getMessage());
//noinspection CallToPrintStackTrace
e.printStackTrace();
System.exit(INSTALLATION_CORRUPTED);
}
}
}