final AESemaphore sem = new AESemaphore( "vmopt" );
final UpdateException[] error = { null };
installer.installNow(
new UpdateInstallerListener()
{
public void
reportProgress(
String str )
{
}
public void
complete()
{
sem.release();
}
public void
failed(
UpdateException e )
{
error[0] = e;
sem.release();
}
});
sem.reserve();
if ( error[0] != null ){
throw( error[0] );
}
}
}
}else{
// redirect in place, might be second user so migrate if needed
if ( old_shared_options.exists() && !local_options.exists()){
if ( !FileUtil.copyFile( old_shared_options, local_options )){
Debug.out( "Failed to copy " + old_shared_options + " to " + local_options );
}
}
}
}else{
// no options
if ( FileUtil.canReallyWriteToAppDirectory()){
if ( !FileUtil.writeStringAsFile( shared_options, redirect + "\r\n" )){
Debug.out( "Failed to write to " + shared_options );
}
}else{
// insufficient perms
UpdateInstaller installer = getInstaller( azureus_core );
// retry later
if ( installer == null ){
return;
}
if ( !informUpdateRequired()){
return;
}
installer.addResource( "redirect", new ByteArrayInputStream( ( redirect + "\r\n" ).getBytes( "UTF-8" )));
installer.addMoveAction( "redirect", shared_options.getAbsolutePath());
final AESemaphore sem = new AESemaphore( "vmopt" );
final UpdateException[] error = { null };
installer.installNow(
new UpdateInstallerListener()
{
public void
reportProgress(
String str )
{