PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/installer/NonInteractiveInstall.java

#
Java | 65 lines | 33 code | 10 blank | 22 comment | 4 complexity | 49a8a8aa0d18e2a693cf26a7a2cee8a9 MD5 | raw file
 1/*
 2 * NonInteractiveInstall.java
 3 * Copyright (C) 1999, 2000, 2001 Slava Pestov
 4 *
 5 * This program is free software; you can redistribute it and/or
 6 * modify it under the terms of the GNU General Public License
 7 * as published by the Free Software Foundation; either version 2
 8 * of the License, or any later version.
 9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 */
19
20package installer;
21
22import java.io.*;
23import java.util.Vector;
24
25/*
26 * Performs non-interactive installation.
27 */
28public class NonInteractiveInstall
29{
30	public NonInteractiveInstall(String installDir, String binDir)
31	{
32		installer = new Install();
33
34		OperatingSystem os = OperatingSystem.getOperatingSystem();
35
36		int compCount = installer.getIntProperty("comp.count");
37		Vector components = new Vector(compCount);
38
39		for(int i = 0; i < compCount; i++)
40		{
41			String fileset = installer.getProperty("comp." + i + ".fileset");
42
43			String osDep = installer.getProperty("comp." + i + ".os");
44			if(osDep != null)
45			{
46				if(!OperatingSystem.getOperatingSystem()
47					.getClass().getName().endsWith(osDep))
48				{
49					continue;
50				}
51			}
52
53			components.addElement(fileset);
54		}
55
56		ConsoleProgress progress = new ConsoleProgress();
57		InstallThread thread = new InstallThread(
58			installer,progress,installDir,binDir,
59			0 /* XXX */,components);
60		thread.start();
61	}
62
63	// private members
64	private Install installer;
65}