Index: trunk/wb/install/save.php
===================================================================
--- trunk/wb/install/save.php	(revision 248)
+++ trunk/wb/install/save.php	(revision 249)
@@ -74,6 +74,16 @@
 	}
 }
 
+// Dummy class to allow modules' install scripts to call $admin->print_error
+class admin_dummy
+{
+	var $error='';
+	function print_error($message)
+	{
+		$this->error=$message;
+	}
+}
+
 // Function to workout what the default permissions are for files created by the webserver
 function default_file_mode($temp_dir) {
 	$v = explode(".",PHP_VERSION);
@@ -564,7 +574,6 @@
 	$database->query("INSERT INTO `".TABLE_PREFIX."search` (name) VALUES ('template')");
 		
 	require_once(WB_PATH.'/framework/initialize.php');
-//	$admin = new admin('dummy');
 	
 	// Include the PclZip class file (thanks to 
 	require_once(WB_PATH.'/include/pclzip/pclzip.lib.php');
@@ -582,6 +591,8 @@
 		// Unpack pre-packaged languages
 		
 	}
+	
+	$admin=new admin_dummy();
 	// Load addons into DB
 	$dirs['modules'] = WB_PATH.'/modules/';
 	$dirs['templates'] = WB_PATH.'/templates/';
@@ -593,6 +604,11 @@
 					// Get addon type
 					if($type == 'modules') {
 						load_module($dir.'/'.$file, true);
+						// Pretty ugly hack to let modules run $admin->set_error
+						// See dummy class definition admin_dummy above
+						if ($admin->error!='') {
+							set_error($admin->error);
+						}
 					} elseif($type == 'templates') {
 						load_template($dir.'/'.$file);
 					} elseif($type == 'languages') {
Index: trunk/wb/framework/functions.php
===================================================================
--- trunk/wb/framework/functions.php	(revision 248)
+++ trunk/wb/framework/functions.php	(revision 249)
@@ -680,7 +680,7 @@
 
 // Load module into DB
 function load_module($directory, $install = false) {
-	global $database;
+	global $database,$admin,$MESSAGE;
 	if(file_exists($directory.'/info.php')) {
 		require($directory.'/info.php');
 		if(isset($module_name)) {
