svn-gvsig-desktop / trunk / build / distribution / IzPack / src / lib / com / izforge / izpack / uninstaller / Uninstaller.java @ 21757
History | View | Annotate | Download (2.25 KB)
1 |
/*
|
---|---|
2 |
* $Id: Uninstaller.java 5819 2006-06-14 07:29:09Z cesar $
|
3 |
* IzPack
|
4 |
* Copyright (C) 2001-2004 Julien Ponge
|
5 |
*
|
6 |
* File : Uninstaller.java
|
7 |
* Description : The uninstaller class.
|
8 |
* Author's email : julien@izforge.com
|
9 |
* Author's Website : http://www.izforge.com
|
10 |
*
|
11 |
* This program is free software; you can redistribute it and/or
|
12 |
* modify it under the terms of the GNU General Public License
|
13 |
* as published by the Free Software Foundation; either version 2
|
14 |
* of the License, or any later version.
|
15 |
*
|
16 |
* This program is distributed in the hope that it will be useful,
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
* GNU General Public License for more details.
|
20 |
*
|
21 |
* You should have received a copy of the GNU General Public License
|
22 |
* along with this program; if not, write to the Free Software
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
24 |
*/
|
25 |
package com.izforge.izpack.uninstaller; |
26 |
|
27 |
import javax.swing.plaf.metal.MetalLookAndFeel; |
28 |
|
29 |
import com.izforge.izpack.gui.IzPackMetalTheme; |
30 |
import java.lang.reflect.Method; |
31 |
|
32 |
/**
|
33 |
* The uninstaller class.
|
34 |
*
|
35 |
* @author Julien Ponge
|
36 |
*/
|
37 |
public class Uninstaller |
38 |
{ |
39 |
|
40 |
/**
|
41 |
* The main method (program entry point).
|
42 |
*
|
43 |
* @param args The arguments passed on the command line.
|
44 |
*/
|
45 |
public static void main(String[] args) |
46 |
{ |
47 |
try
|
48 |
{ |
49 |
Class clazz = Uninstaller.class;
|
50 |
Method target =
|
51 |
clazz.getMethod("uninstall", new Class[] { String[].class }); |
52 |
new SelfModifier(target).invoke(args);
|
53 |
} catch (Exception ioeOrTypo) |
54 |
{ |
55 |
System.err.println(ioeOrTypo.getMessage());
|
56 |
ioeOrTypo.printStackTrace(); |
57 |
System.err.println("Unable to exec java as a subprocess."); |
58 |
System.err.println("The uninstall may not fully complete."); |
59 |
uninstall(args); |
60 |
} |
61 |
} |
62 |
|
63 |
public static void uninstall(String[] args) |
64 |
{ |
65 |
try
|
66 |
{ |
67 |
MetalLookAndFeel.setCurrentTheme(new IzPackMetalTheme()); |
68 |
new UninstallerFrame();
|
69 |
} catch (Exception err) |
70 |
{ |
71 |
System.err.println("- Error -"); |
72 |
err.printStackTrace(); |
73 |
System.exit(0); |
74 |
} |
75 |
} |
76 |
} |