private boolean expired() { Date expiresDate = installData.getInfo().getExpiresDate(); return new Date().after(expiresDate); }
/** * Determines whether the installer expires. * * @return <tt>true</tt> if installer expires, otherwise <tt>false</tt> */ private boolean expires() { return installData.getInfo().getExpiresDate() != null; }
/** * 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); } }
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 uninstallerPath = installData.getInfo().getUninstallerPath(); if (uninstallerPath != null && uninstallerPath.startsWith(INSTALL_PATH))
Info installationInfo = installData.getInfo();
/** * Determines if the JDK is required, and if so, if it exists. * * @return <tt>true</tt> if JDK requirements are met, otherwise <tt>false</tt> */ @Override public boolean check() { boolean result; result = !installData.getInfo().isJdkRequired() || exists() || notFound(); return result; }
@Override public boolean run(InstallData installData, Properties properties) { boolean result = false; String path = properties.getProperty(InstallData.INSTALL_PATH); if (path == null || "".equals(path.trim())) { System.err.println("Missing mandatory target path!"); } else if (TargetPanelHelper.isIncompatibleInstallation(path, installData.getInfo().isReadInstallationInformation())) { System.err.println(getIncompatibleInstallationMsg(installData)); } else { path = installData.getVariables().replace(path); installData.setInstallPath(path); result = true; } return result; }
/** * Returns the stream to a resource. * * @param name the resource name * @return a stream to the resource * @throws ResourceNotFoundException if the resource cannot be found * @throws ResourceInterruptedException if resource retrieval is interrupted * @throws ResourceException for any other resource error */ @Override public InputStream getPackStream(String name) { InputStream result; String webDirURL = installData.getInfo().getWebDirURL(); if (webDirURL == null) { result = getLocalPackStream(name); } else { result = getWebPackStream(name, webDirURL); } return result; }
FileUtil.getLockFile(installData.getInfo().getAppName()).delete(); if (runner.relaunchWithElevatedRights() == 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; }
private void handleInstallPath(InstallData installData, String path) { // Allow for variable substitution of the installpath value path = installData.getVariables().replace(path); if (TargetPanelHelper.isIncompatibleInstallation(path, installData.getInfo().isReadInstallationInformation())) { throw new InstallerException(installData.getMessages().get("TargetPanel.incompatibleInstallation")); } installData.setInstallPath(path); } }
/** * Resolve components. * * @param pico the container */ protected void resolveComponents(MutablePicoContainer pico) { InstallData installData = pico.getComponent(InstallData.class); String className = installData.getInfo().getUnpackerClassName(); Class<IUnpacker> unpackerClass = getClass(className, IUnpacker.class); pico.addComponent(IUnpacker.class, unpackerClass); CustomDataLoader customDataLoader = pico.getComponent(CustomDataLoader.class); try { customDataLoader.loadCustomData(); } catch (InstallerException exception) { throw new ContainerException(exception); } }
/** * 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; }
/** * 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; }
Info info = installData.getInfo(); String welcomeText = messages.get("HelloPanel.welcome1") + info.getAppName() + " " + info.getAppVersion() + messages.get("HelloPanel.welcome2");
Info installInfo = installData.getInfo();