Hi,
i want to execute a setup.exe installer which installes a software on vista with java 1.6.
The user is not an administrator. When i try to start the process i get the error message:
CreateProcess error=740
which indicates, that the user has not enough rights for starting the process.
Can i submit a flag or an option to indicate, the the process should execute with administrator rights? Vista itself does have this functionality inside the menu toolbar. Can i use this function in Java.
I call the following code
Runtime rt = Runtime.getRuntime();
Process process;
try {
String fileToExecute = new File(mFolder, mSetupFiles[0]).getCanonicalPath();
if (logger.isDebugEnabled()) {
logger.debug("Execute runtime process");
}
process = rt.exec(fileToExecute, null, mFolder);
process.getErrorStream().close();
process.getInputStream().close();
process.getOutputStream().close();
if (logger.isDebugEnabled()) {
logger.debug("Wait until process is finished");
}
process.waitFor();
} catch (IOException e) {
throw new StartException(e);
} catch (InterruptedException e) {
throw new StartException(e);
}