String welcomeText = messages.get("HelloPanel.welcome1") + info.getAppName() + " " + info.getAppVersion() + messages.get("HelloPanel.welcome2"); console.println(welcomeText); ArrayList<Info.Author> authors = info.getAuthors(); if (!authors.isEmpty()) if (info.getAppURL() != null) String urlText = messages.get("HelloPanel.url") + info.getAppURL(); console.println(urlText);
/** * Creates the uninstaller jar file. * * @throws IOException for any I/O error */ private void createOutputJar() throws IOException { // Create the uninstaller directory String dirPath = IoHelper.translatePath(installData.getInfo().getUninstallerPath(), installData.getVariables()); String jarPath = dirPath + File.separator + installData.getInfo().getUninstallerName(); File dir = new File(dirPath); if (!dir.exists() && !dir.mkdirs()) { throw new IOException("Failed to create output path: " + dir); } // Log the uninstaller deletion information uninstallData.setUninstallerJarFilename(jarPath); uninstallData.setUninstallerPath(dirPath); // Create the jar file jarStream = new FileOutputStream(jarPath); jar = new JarOutputStream(new BufferedOutputStream(jarStream)); jar.setLevel(9); uninstallData.addFile(jarPath, true); }
/** * Determines if each pack is to be included in a separate jar. * * @return <tt>true</tt> if {@link Info#getWebDirURL()} is non-null */ protected boolean packSeparateJars() { return info != null && info.getWebDirURL() != null; }
/** * Determines if uninstall data should be written. * <p/> * Uninstall data should be written if {@link com.izforge.izpack.api.data.Info#getUninstallerCondition()} is * empty, or evaluates <tt>true</tt>. * * @return <tt>true</tt> if uninstall data should be written, otherwise <tt>false</tt> */ public boolean isUninstallRequired() { String condition = installData.getInfo().getUninstallerCondition(); return (installData.getInfo().getUninstallerPath() != null) && (condition == null || condition.length() == 0 || rules.isConditionTrue(condition) ); }
Info installationInfo = installData.getInfo(); if (installationInfo.isSingleInstance() && !Boolean.getBoolean("MULTIINSTANCE")) String appName = installationInfo.getAppName(); File file = FileUtil.getLockFile(appName); if (file.exists())
String baseName = installData.getInfo().getInstallerBase(); File installerDir = new File(baseName).getParentFile(); String tempFolder = IoHelper.translatePath(installData.getInfo().getUninstallerPath() + WEB_TEMP_SUB_PATH, installData.getVariables()); File tempDir = new File(tempFolder);
info.setAppName(xmlCompilerHelper.requireContent(xmlCompilerHelper.requireChildNamed(root, "appname"))); info.setAppVersion(xmlCompilerHelper.requireContent(xmlCompilerHelper.requireChildNamed(root, "appversion"))); info.setInstallationSubPath(xmlCompilerHelper.requireContent(subpath)); info.setAppURL(appURL.toString()); info.addAuthor(new Info.Author(name, email)); info.setJavaVersion(xmlCompilerHelper.requireContent(javaVersion)); if (xmlCompilerHelper.validateYesNoAttribute(javaVersion, "strict", YES)) info.setJavaVersionStrict(true); info.setJdkRequired("yes".equals(jdkRequired.getContent())); info.setExpiresDate(expiresDate.getContent()); info.setWebDirURL(xmlCompilerHelper.requireURLContent(webDirURL).toString()); info.setWebDirURL(null); info.setCompressionFormat(compression); logger.info("Pack compression method: " + compression.toName()); info.setSummaryLogFilePath(xmlCompilerHelper.requireContent(slfPath)); info.setWriteInstallationInformation(validateYesNo(writeInstallInfoString));
installData.setVariable(ScriptParserConstant.APP_NAME, info.getAppName()); if (info.getAppURL() != null) installData.setVariable(ScriptParserConstant.APP_URL, info.getAppURL()); installData.setVariable(ScriptParserConstant.APP_VER, info.getAppVersion()); if (info.getUninstallerCondition() != null) installData.setVariable("UNINSTALLER_CONDITION", info.getUninstallerCondition()); String installPath = dir + info.getAppName(); if (info.getInstallationSubPath() != null) installPath = IoHelper.translatePath(dir + info.getInstallationSubPath(), installData.getVariables()); Set<TempDir> tempDirs = info.getTempDirs(); if (null != tempDirs && tempDirs.size() > 0)
/** * Constructs a <tt>GeneratePropertiesAction</tt>. * * @param installData the installation data * @param path the path to write properties to * @throws FileNotFoundException if the file exists but is a directory rather than a regular file, does not exist * but cannot be created, or cannot be opened for any other reason */ public GeneratePropertiesAction(InstallData installData, String path) throws FileNotFoundException { super(installData); Info info = installData.getInfo(); this.options = new Options(); Config config = this.options.getConfig(); config.setEmptyLines(true); config.setHeaderComment(true); config.setFileEncoding(Charset.forName("ISO-8859-1")); this.options.setHeaderComment(Arrays.asList(info.getAppName() + " " + info.getAppVersion())); this.path = path; }
String uninstallerPath = installData.getInfo().getUninstallerPath(); if (uninstallerPath != null && uninstallerPath.startsWith(INSTALL_PATH))
private CompilerData initCompilerData(File jarFile) { Info info = new Info(); if (project != null) { if (autoIncludeDevelopers) { if (project.getDevelopers() != null) { //noinspection unchecked for (Developer dev : project.getDevelopers()) { info.addAuthor(new Info.Author(dev.getName(), dev.getEmail())); } } } if (autoIncludeUrl) { info.setAppURL(project.getUrl()); } } return new CompilerData(comprFormat, kind, installFile.getPath(), null, baseDir.getPath(), jarFile.getPath(), mkdirs, comprLevel, info); }
logger.fine("Lock File Exists, asking user for permission to proceed."); StringBuilder msg = new StringBuilder(); String appName = installData.getInfo().getAppName(); msg.append("The " + appName + " installer you are attempting to run seems to have a copy already running.\n\n"); msg.append("This could be from a previous failed installation attempt or you may have accidentally launched\n");
String jarFile = getInfo().getInstallerBase() + ".pack-" + pack.getName() + ".jar"; packJar = getJarOutputStream(new File(jarFile)); entry = new ZipEntry(streamResourceName); PackCompression comprFormat = getInfo().getCompressionFormat(); if (comprFormat != PackCompression.DEFAULT)
/** * Invoked when the installer has expired. * <p/> * This tells the user why we're canceling. */ protected void showExpired() { String message = "This installer has expired."; if (installData.getInfo().getAppURL() != null) { String urlText = installData.getInfo().getAppURL(); message += "\n\n" + "Please download a new one from " + urlText; } prompt.error(message); } }
final String minimalJavaVersion = compilerData.getExternalInfo().getJavaVersion(); final boolean javaVersionStrict = compilerData.getExternalInfo().getJavaVersionStrict(); for (IXMLElement ixmlElement : data.getChildrenNamed("jar"))
/** * Creates an unpacker to unpack a pack file. * * @param file the pack file to unpack * @param pack the parent pack * @param queue the file queue. May be {@code null} * @param cancellable determines if the unpacker should be cancelled * @return the unpacker * @throws InstallerException for any installer error */ protected FileUnpacker createFileUnpacker(PackFile file, Pack pack, FileQueue queue, Cancellable cancellable) throws InstallerException { PackCompression compressionFormat = getInstallData().getInfo().getCompressionFormat(); FileUnpacker unpacker; if (pack.isLoose()) { unpacker = new LooseFileUnpacker(cancellable, queue, prompt); } else if (file.isPack200Jar()) { unpacker = new Pack200FileUnpacker(cancellable, resources, queue); } else if (compressionFormat != PackCompression.DEFAULT) { unpacker = new CompressedFileUnpacker(cancellable, queue, compressionFormat); } else { unpacker = new DefaultFileUnpacker(cancellable, queue); } return unpacker; }
logger.fine("Subsequent volume size: " + maxVolumeSize); File volume = new File(getInfo().getInstallerBase() + ".pak").getAbsoluteFile(); int volumes = writePacks(packs, volume);
/** * Checks the Java version. * * @return <tt>true</tt> if requirements are met, otherwise <tt>false</tt> */ @Override public boolean check() { String version = getJavaVersion(); String required = installData.getInfo().getJavaVersion(); if (required == null || version == null) { return true; } CompareVersionsMajorCondition comparator = new CompareVersionsMajorCondition(); comparator.setInstallData(installData); comparator.setLeftOperand(version); comparator.setRightOperand(required); comparator.setOperator(ComparisonOperator.GREATEREQUAL); if (!comparator.isTrue()) { versionNotAvailable(version, required); return false; } return true; }
String baseName = installData.getInfo().getInstallerBase(); File installerDir = new File(baseName).getParentFile(); String tempFolder = IoHelper.translatePath(installData.getInfo().getUninstallerPath() + WEB_TEMP_SUB_PATH, installData.getVariables()); String tempFile;
logfile = installData.getInfo().getUninstallerPath() + "/install.log";