<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");

   // 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 szaDestinationRoot = szaAltirisRoot + "\\deploy\\cds\\compaq\\ss.640";
   if (!xFSO.FolderExists(szaDestinationRoot + "\\w2k") || !xFSO.FolderExists(szaDestinationRoot + "\\wnet"))
      throw(new Error(0, "The destination folder does not exist."));

   // copy files
   xFSO.CopyFolder(szaSourceRoot + "\\w2k", szaDestinationRoot + "\\w2k");
   xFSO.CopyFolder(szaSourceRoot + "\\wnet", szaDestinationRoot + "\\wnet");

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

</script>
</job>
