public DownloadRecord postInstall() throws IOException {
if(downloadRecord == null)
throw new IllegalStateException("software has not been downloaded");
if(!(stagedData instanceof StagedSoftware))
return null;
PostInstallAttributes postInstall =
((StagedSoftware) stagedData).getPostInstallAttributes();
if(postInstall == null)
return (null);
String path = downloadRecord.getPath();
try {
StagedData dAttrs = postInstall.getStagedData();
if(dAttrs != null) {
postInstallRecord = doDownload(dAttrs, true);
path = postInstallRecord.getPath();
}
ExecDescriptor execDesc = postInstall.getExecDescriptor();
if(execDesc != null) {
if(!execDesc.getCommandLine().startsWith(File.separator))
execDesc = Util.extendCommandLine(path, execDesc);
ServiceExecutor svcExecutor = new ServiceExecutor();
ProcessManager manager = svcExecutor.exec(execDesc);
manager.manage();
//manager.waitFor();
manager.destroy(false);
}
if(postInstall.getStagedData()!=null &&
postInstall.getStagedData().removeOnDestroy()) {
if(postInstallRecord != null) {
FileUtils.remove(new File(FileUtils.makeFileName(postInstallRecord.getPath(),
postInstallRecord.getName())));
}
if(postInstallExtractList != null) {