Package com.instantiations.installer.core

Examples of com.instantiations.installer.core.InstallOptions


  /**
   * Search for unused directories
   */
  protected IStatus run(Context installer) {
    InstallOptions options = installer.getOptions();
    boolean verbose = options.isVerbose();
    if (verbose)
      System.out.println("Scanning for unused directories");
    Collection result = findDirsMatching(verbose);
    StringBuffer buf = new StringBuffer(result.size() * 40);
    for (Iterator iter = result.iterator(); iter.hasNext();) {
      File installDir = (File) iter.next();
      if (buf.length() > 0)
        buf.append(",");
      buf.append(installDir.getPath());
    }
    options.set(OPTION_UNUSED_INSTALL_DIRS, buf.toString());
    return super.run(installer);
  }
View Full Code Here


  /**
   * Queue the installations to be deleted
   */
  protected void prepare() throws Exception {
    InstallOptions options = installer.getOptions();
    boolean verbose = options.isVerbose();
    if (verbose)
      System.out.println("Preparing to delete old unused installations:");
    createCleanDirectoryOperation(installer.getOptions().getStrings(
      ScanUnlinkedInstallsOperation.OPTION_UNLINKED_INSTALL_DIRS), verbose, options);
    createCleanDirectoryOperation(installer.getOptions().getStrings(
View Full Code Here

  /**
   * Search for unlinked installations
   */
  protected IStatus run(Context installer) {
    InstallOptions options = installer.getOptions();
    if (options.isVerbose())
      System.out.println("Scanning for unlinked installations");
    Collection result = new TreeSet();
    try {
      findUnlinkedDirs(rootDir, installer.getOptions(), result);
    }
    catch (ScanFailedException e) {
      System.out.println("Abort scan for unlinked installations because exception occurred");
      e.printStackTrace();
      result.clear();
    }
    StringBuffer buf = new StringBuffer(result.size() * 40);
    for (Iterator iter = result.iterator(); iter.hasNext();) {
      File installDir = (File) iter.next();
      if (buf.length() > 0)
        buf.append(",");
      buf.append(installDir.getPath());
    }
    options.set(OPTION_UNLINKED_INSTALL_DIRS, buf.toString());
    return super.run(installer);
  }
View Full Code Here

  /**
   * Test to scan the Instantiations directory for unlinked directories
   */
  public static void main(String[] args) {
    InstallOptions options = new InstallOptions();
    options.setVerbose(true);
    Installer installer = new Installer(options) {
      protected Class getRequiredAdapterType() {
        return null;
      }
    };
   
    File rootDir = new File(args.length > 0 ? args[0] : "/Program Files/Instantiations");

    ScanUnlinkedInstallsOperation op = new ScanUnlinkedInstallsOperation(rootDir);
    long startTime = System.currentTimeMillis();
    op.run(installer);
    long elapseTime = System.currentTimeMillis() - startTime;

    String[] paths = options.getStrings(OPTION_UNLINKED_INSTALL_DIRS);
    System.out.println(paths.length + " unlinked install directories found in " + elapseTime + " milliseconds");
    for (int i = 0; i < paths.length; i++)
      System.out.println("  " + trimmedPath(paths[i], rootDir));
  }
View Full Code Here

   * Run the installer
   *
   * @param args command line arguments
   */
  protected void run(String[] args) throws Exception {
    options = new InstallOptions(getClass(), "install.properties");
    options.set("InstallDir", new File(Platform.getVarString("ProgramFiles"), options.getString("InstallDirName")).getAbsolutePath());
    options.setUninstall(isUninstaller());
    options.setAllowOverwrite(true);
    options.setNoOverwriteWarningDuringInstall(true);
    options.setBoolean(ChooseLocationStep.OPTION_SUPPRESS_ALREADY_INSTALLED_WARNING, true);
View Full Code Here

TOP

Related Classes of com.instantiations.installer.core.InstallOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.