From d604bde054c34ef505a157a017b1c19239f2ba11 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 29 Mar 2006 06:13:14 +0000 Subject: [PATCH] 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. --- src/java/com/threerings/getdown/launcher/Getdown.java | 8 ++++++++ src/java/com/threerings/getdown/messages.properties | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/java/com/threerings/getdown/launcher/Getdown.java b/src/java/com/threerings/getdown/launcher/Getdown.java index 43f0ef7..8ce1b62 100644 --- a/src/java/com/threerings/getdown/launcher/Getdown.java +++ b/src/java/com/threerings/getdown/launcher/Getdown.java @@ -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()) { diff --git a/src/java/com/threerings/getdown/messages.properties b/src/java/com/threerings/getdown/messages.properties index 818eb42..04a1322 100644 --- a/src/java/com/threerings/getdown/messages.properties +++ b/src/java/com/threerings/getdown/messages.properties @@ -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.