Check whether we can write to our install directory before going any further

and report a useful error message in the event that we cannot.
This commit is contained in:
Michael Bayne
2006-03-29 06:13:14 +00:00
parent 536a566a2d
commit d604bde054
2 changed files with 12 additions and 0 deletions
@@ -88,6 +88,14 @@ public class Getdown extends Thread
return;
}
// determine whether or not we can write to our install directory
File instdir = _app.getLocalPath("");
if (!instdir.canWrite()) {
updateStatus(MessageUtil.tcompose("m.readonly_error", instdir));
_dead = true;
return;
}
try {
_dead = false;
if (detectProxy()) {
@@ -60,6 +60,10 @@ m.init_error = The application has failed to launch due to the following \
error:\n{0}\n\nPlease visit\n{1} for \
information on how to handle such problems.
m.readonly_error = The directory in which this application is installed:\n \n\
{0}\n \nis read-only. Please install the applicaton into a directory where \
you have write access.
m.missing_resource = The application has failed to launch due to a \
missing resource:\n{0}\n\nPlease visit\n{1} for information on how to handle such problems.