|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.izforge.izpack.installer.PrivilegedRunner
public class PrivilegedRunner
This class is responsible for allowing the installer to re-launch itself with administrator permissions. The way of achieving this greatly varies among the platforms. The JDK classes are of not help here as there is no way to tell a JVM to run as a different user but to launch a new one.
| Field Summary | |
|---|---|
private boolean |
vetoed
|
| Constructor Summary | |
|---|---|
PrivilegedRunner()
Builds a default privileged runner. |
|
PrivilegedRunner(boolean vetoed)
Builds a privileged runner with a vetoing parameter. |
|
| Method Summary | |
|---|---|
boolean |
canWriteToProgramFiles()
|
private void |
copyStream(java.io.OutputStream out,
java.io.InputStream in)
|
private java.io.File |
extractMacElevator()
|
private java.io.File |
extractVistaElevator()
|
private java.util.List<java.lang.String> |
getElevator(java.lang.String javaCommand,
java.lang.String installer)
|
private java.lang.String |
getInstallerJar()
|
private java.lang.String |
getJavaCommand()
|
private java.lang.String |
getJavaExecutable()
|
boolean |
isElevationNeeded()
Checks if the current user is an administrator or not. |
boolean |
isPlatformSupported()
Checks if the current platform is supported. |
static boolean |
isPrivilegedMode()
|
boolean |
isVetoed()
Tells whether the elevation is vetoed by some of the invoker logic. |
private void |
makeExecutable(java.lang.String path)
|
int |
relaunchWithElevatedRights()
Relaunches the installer with elevated rights. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean vetoed
| Constructor Detail |
|---|
public PrivilegedRunner()
public PrivilegedRunner(boolean vetoed)
vetoed - should the elevation be vetoed?| Method Detail |
|---|
public boolean isVetoed()
true if the elevation is to be vetoed.public boolean isPlatformSupported()
true if the platform is supported, false otherwise.public boolean isElevationNeeded()
true if elevation is needed to have administrator permissions, false otherwise.public boolean canWriteToProgramFiles()
public int relaunchWithElevatedRights()
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
private java.util.List<java.lang.String> getElevator(java.lang.String javaCommand,
java.lang.String installer)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
private java.io.File extractVistaElevator()
throws java.io.IOException
java.io.IOException
private java.io.File extractMacElevator()
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
private void makeExecutable(java.lang.String path)
throws java.lang.InterruptedException,
java.io.IOException
java.lang.InterruptedException
java.io.IOException
private void copyStream(java.io.OutputStream out,
java.io.InputStream in)
throws java.io.IOException
java.io.IOExceptionprivate java.lang.String getInstallerJar()
private java.lang.String getJavaCommand()
private java.lang.String getJavaExecutable()
public static boolean isPrivilegedMode()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||