--- chatroom.install	2006/09/03 01:47:45	1.15
+++ chatroom.install	2006/09/26 11:56:25	1.16
@@ -1,5 +1,5 @@
 <?php
-/* $Id: chatroom.install,v 1.15 2006/09/03 01:47:45 justinrandell Exp $ */
+/* $Id: chatroom.install,v 1.16 2006/09/26 11:56:25 darrenoh Exp $ */
 /**
  * Implementation of hook_install()
  */
@@ -118,12 +118,11 @@
   else {
     $cache_dir = file_directory_temp() .'/drupal_chat_cache';
     $errors = array();
-    $path = realpath(dirname($_SERVER['SCRIPT_FILENAME'])) .'/chatroomread.php';
-    if (!file_exists($path)) {
-      $errors[] = "Please copy chatroomread.php from the chatroom module directory into your Drupal base directory"; 
-    } 
+    $source = realpath(dirname($_SERVER['SCRIPT_FILENAME'])) . '/modules/chatroom/chatroomread.php';
+    $dest = realpath(dirname($_SERVER['SCRIPT_FILENAME'])) . '/chatroomread.php';
+    copy($source, $dest);
     if (!@is_dir($cache_dir)) {
-      $errors[] = "$cache_dir directory does not exist. Please create it"; 
+      mkdir($cache_dir);
     }
     if (!@is_writable($cache_dir)) {
       $errors[] = "$cache_dir directory is not writable by php. Please correct this";
