public void perform(TimerEvent ev) {
performAutoCheck(false);
}
});
DelayedTask delayed_task =
UtilitiesImpl.addDelayedTask(
"Update Check",
new Runnable()
{
public void
run()
{
// check for non-writeable app dir on non-vista platforms (vista we've got a chance of
// elevating perms when updating) and warn user. Particularly useful on OSX when
// users haven't installed properly
if ( !( Constants.isWindowsVistaOrHigher || SystemProperties.isJavaWebStartInstance())){
String app_str = SystemProperties.getApplicationPath();
if ( !new File(app_str).canWrite()){
final UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
if ( uiFunctions != null ){
if ( app_str.endsWith( File.separator )){
app_str = app_str.substring(0, app_str.length()-1);
}
final String f_app_str = app_str;
Utils.execSWTThread(
new Runnable()
{
public void
run()
{
UIFunctionsUserPrompter prompt =
uiFunctions.getUserPrompter(
MessageText.getString("updater.cant.write.to.app.title"),
MessageText.getString("updater.cant.write.to.app.details", new String[]{f_app_str}),
new String[]{ MessageText.getString( "Button.ok" )},
0 );
//prompt.setHtml( "http://a.b.c/" );
prompt.setIconResource( "warning" );
prompt.setRemember( "UpdateMonitor.can.not.write.to.app.dir.2", false,
MessageText.getString( "MessageBoxWindow.nomoreprompting" ));
prompt.open(null);
}
},
true );
}
}
}
performAutoCheck(true);
}
});
delayed_task.queue();
}