<job id="install">
<script language="javascript">

var xFSO = WScript.CreateObject("Scripting.FileSystemObject");
var xShell = WScript.CreateObject("WScript.Shell");

try
{
   WScript.Echo("Fibre Channel Driver Boot Support for the Rapid Deployment Pack 1.40 OR 1.50");

   // determine and verify source
   var szaSourceRoot = WScript.ScriptFullName.slice(0, WScript.ScriptFullName.lastIndexOf("\\"));
   if (!xFSO.FolderExists(szaSourceRoot + "\\w2k") || !xFSO.FolderExists(szaSourceRoot + "\\wnet"))
      throw(new Error(0, "The source files could not be found."));

   // determine and verify destination
   var szaAltirisRoot = xShell.RegRead("HKLM\\SOFTWARE\\Altiris\\eXpress\\InstallDir");
   var szaDestinationRoot140 = szaAltirisRoot + "\\deploy\\cds\\compaq\\ss.640";
   var szaDestinationRoot150 = szaAltirisRoot + "\\deploy\\cds\\compaq\\ss.700";
   if (xFSO.FolderExists(szaDestinationRoot150 + "\\w2k") || xFSO.FolderExists(szaDestinationRoot150 + "\\wnet"))
   {      
   
   // copy files to the ss.700 folder
      xFSO.CopyFolder(szaSourceRoot + "\\w2k", szaDestinationRoot150 + "\\w2k");
      xFSO.CopyFolder(szaSourceRoot + "\\wnet", szaDestinationRoot150 + "\\wnet");
   }
   else
   if (xFSO.FolderExists(szaDestinationRoot140 + "\\w2k") || xFSO.FolderExists(szaDestinationRoot140 + "\\wnet"))
   {
         
   // copy files to the ss.640 folder
      xFSO.CopyFolder(szaSourceRoot + "\\w2k", szaDestinationRoot140 + "\\w2k");
      xFSO.CopyFolder(szaSourceRoot + "\\wnet", szaDestinationRoot140 + "\\wnet");
   }
   else
   {
     throw(new Error(0, "The destination folders do not exist."));
   }

   WScript.Echo("Success");
}
catch (e)
{
   WScript.Echo("ERROR: " + e.description);
}

</script>
</job>
