From eadd6cfccaebdabde5434affff391f65c2bf7516 Mon Sep 17 00:00:00 2001 From: mcmartin Date: Sat, 11 Nov 2006 15:57:31 +0000 Subject: [PATCH] Better error message than "Kernel failed to load!" git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2495 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/options.c | 9 +++++---- sc2/src/options.h | 1 + sc2/src/sc2code/starcon.c | 7 ++++++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index caacad1cf..d88a3c13b 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.6: +- Better error message for 'Kernel failed to load' (#917) - Michael - Pushbutton for connecting to netplay, in anticipation of a full configuration dialog later - Michael - Cleanup of comm.c - SvdB diff --git a/sc2/src/options.c b/sc2/src/options.c index 8e938cdd9..afa11a381 100644 --- a/sc2/src/options.c +++ b/sc2/src/options.c @@ -53,6 +53,8 @@ uio_DirHandle *configDir; uio_DirHandle *saveDir; uio_DirHandle *meleeDir; +char baseContentPath[PATH_MAX]; + uio_DirList *availableAddons; extern uio_Repository *repository; @@ -116,7 +118,6 @@ prepareContentDir (const char *contentDirName, const char **addons) { const char *testFile = "version"; const char *loc; - char path[PATH_MAX]; if (contentDirName == NULL) { @@ -140,16 +141,16 @@ prepareContentDir (const char *contentDirName, const char **addons) exit (EXIT_FAILURE); } - if (expandPath (path, sizeof path, loc, EP_ALL_SYSTEM) == -1) + if (expandPath (baseContentPath, sizeof baseContentPath, loc, EP_ALL_SYSTEM) == -1) { log_add (log_Fatal, "Fatal error: Could not expand path to content " "directory: %s", strerror (errno)); exit (EXIT_FAILURE); } - log_add (log_Debug, "Using '%s' as base content dir.", path); + log_add (log_Debug, "Using '%s' as base content dir.", baseContentPath); - mountContentDir (repository, path, addons); + mountContentDir (repository, baseContentPath, addons); } void diff --git a/sc2/src/options.h b/sc2/src/options.h index c0f5ed9c7..117b98393 100644 --- a/sc2/src/options.h +++ b/sc2/src/options.h @@ -46,6 +46,7 @@ extern uio_DirHandle *contentDir; extern uio_DirHandle *configDir; extern uio_DirHandle *saveDir; extern uio_DirHandle *meleeDir; +extern char baseContentPath[PATH_MAX]; extern uio_DirList *availableAddons; diff --git a/sc2/src/sc2code/starcon.c b/sc2/src/sc2code/starcon.c index 22e494226..c7db6d5a0 100644 --- a/sc2/src/sc2code/starcon.c +++ b/sc2/src/sc2code/starcon.c @@ -35,6 +35,8 @@ #include "libs/tasklib.h" #include "libs/log.h" +#include "uqmversion.h" +#include "options.h" // Open or close the periodically occuring QuasiSpace portal. // A seperate thread is always inside this function when the player @@ -275,7 +277,10 @@ while (--ac > 0) } else { - log_add (log_Fatal, "Kernel failed to load!"); + log_add (log_Fatal, "\n *** FATAL ERROR: Could not load basic content ***\n\nUQM requires at least the base content pack to run properly."); + log_add (log_Fatal, "This file is typically called uqm-%d.%d.0.uqm. UQM was expecting it", UQM_MAJOR_VERSION, UQM_MINOR_VERSION); + log_add (log_Fatal, "in the %s/packages directory.", baseContentPath); + log_add (log_Fatal, "Either your installation did not install the content pack at all, or it\ninstalled it in a different directory.\n\nFix your installation and rerun UQM.\n\n *******************\n"); } FreeKernel ();