Java Reference
In-Depth Information
L ISTING 7.1 Continued
alreadyInstalledFiles = 0;
Thread t = new Thread(this);
t.start();
new InstallationProgressDialog(this);
}
/**
* launch the installer thread
*/
public void run() {
if (isInstallJre())
installJre();
// install chosen files
File f = new File(destinationDir);
f.mkdirs();
File file;
for (int i = 0; i < resources.length; i++) {
alreadyInstalledFiles++;
try {
copy(resources[i]);
Thread.currentThread().sleep(1000);//XXX only cosmetics: remove it!
} catch (Exception ex) {
System.out.println(“During Installation: “+ex);
}
}
installCustom();
// installation finished
alreadyInstalledFiles = -1;
if (isShowReadme()) {
ReadDialog rd = new ReadDialog(this);
}
installationFinished();
}
/**
* performs the actual files copy
*/
private void copy (String from){
try {
File inputFile = new File(currentDir + SETUP_RES_DIR + from);
File outputFile = new File(destinationDir + from);
Search WWH ::




Custom Search