1 15 16 30 package ixenon.free.nodes; 31 32 import java.io.*; 33 import java.util.*; 34 import java.awt.*; 35 import java.awt.event.*; 36 37 import javax.swing.*; import javax.swing.event.*; import javax.swing.tree.*; 41 import ixenon.free.swing.*; import ixenon.free.install.*; 44 49 public class CheckSuperuser extends AbstractInstallable 50 implements Installable 51 { 52 57 public CheckSuperuser ( String nodeName ) 58 { 59 super( nodeName, null, true ); 60 } 61 62 66 public Component getVisualComponent() 67 { 68 return (null); 69 } 70 71 72 76 public Component getConfigurableComponent() 77 { 78 return (null); 79 } 80 81 88 public void install() throws InstallException 89 { 90 FreeInstallerApplication theApp = 91 FreeInstallerApplication.getInstance(); 92 93 String osname = System.getProperty("os.name"); 94 95 String username = System.getProperty("user.name"); 98 99 if ( osname.startsWith("Windows 95") || 100 osname.startsWith("Windows 98") || 101 osname.startsWith("OS/2") ) { 102 theApp.printWarning( "CheckSuperuser can perform a security check for "+osname ); 105 } 106 else if ( osname.startsWith("Windows NT") || 107 osname.startsWith("Windows 2000")) { 108 if ( !osname.equals("Adminstrator") && 110 !osname.equals("adminstrator") ) 111 throw new InstallException( 112 "Regrettably, to install the software package:"+ 113 theApp.getProductName()+ 114 " you must be NT `administrator' user." ); 115 } 116 else { 117 if ( !osname.equals("root") ) 119 throw new InstallException( 120 "Regrettably, to install the software package:"+ 121 theApp.getProductName()+ 122 " you must be `root' user." ); 123 } 124 } 126 127 130 public void uninstall() throws InstallException 131 { 132 } 134 135 138 public void cleanup() throws InstallException 139 { 140 } 142 } 143 144 146 147 | Popular Tags |