home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / VALIDATE.SCRIPT < prev    next >
Encoding:
Text File  |  2000-05-24  |  3.7 KB  |  91 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3. // @Modified build 290 cm19990427 - added JDK1.2 notes
  4. // @Modified build 355 cm20000524 - removed JDK1.2 notes
  5.  
  6. /**
  7. @Tool: validate~iterates over all the entries in the ApplicationHelpers 
  8. map file and checks each path to see if it exists. 
  9. @Note: This script only checks to see if the path exists. It does not know if 
  10. the path is to the correct file or folder.
  11. @EndNote:
  12. @Example: Example output from the validate script:
  13. Checking file paths in ApplicationHelpers
  14. Path for key "html-help" is valid: D:\html\Htmlib95.hlp
  15. Path for key "NavigatorBrowser" is valid: H:\Netscape 4.03\Program\netscape.exe
  16. Path for key "msj-jview" is valid: C:\SDK-Java.20\bin\jview.exe
  17. Path for key "msj-jactivex" is valid: C:\SDK-Java.20\bin\jactivex.exe
  18. Path for key "jdk-runapplication_release" is valid: E:\Jdk1.1.4\bin\java.exe
  19. Path for key "jdk-appletviewer_debug" is valid: E:\Jdk1.1.4\bin\appletviewer_g.exe
  20. Path for key "jdk-runapplicationwindow" is valid: E:\Jdk1.1.4\bin\javaw.exe
  21. Path for key "jdk-compiler_debug" is valid: E:\Jdk1.1.4\bin\javac_g.exe
  22. Path for key "jdk-compiler_release" is valid: E:\Jdk1.1.4\bin\javac.exe
  23. Path for key "msj-jvc" is valid: C:\SDK-Java.20\bin\jvc.exe
  24. Path for key "msj-msjavah" is valid: C:\SDK-Java.20\bin\msjavah.exe
  25. Path for key "jdk-debugger" is valid: E:\Jdk1.1.4\bin\jdb.exe
  26. Path for key "jdk-runapplicationwindow_debug" is valid: E:\Jdk1.1.4\bin\javaw_g.exe
  27. Path for key "jdk-runapplication" is valid: E:\Jdk1.1.4\bin\java.exe
  28. Path for key "jdk-classes.zip" is valid: E:\Jdk1.1.4\lib\classes.zip
  29. Path for key "jdk-runapplication_debug" is valid: E:\Jdk1.1.4\bin\java_g.exe
  30. Path for key "msj-classvue" is valid: C:\SDK-Java.20\bin\classvue.exe
  31. Path for key "jdk-appletviewer" is valid: E:\Jdk1.1.4\bin\appletviewer.exe
  32. Path for key "msj-appletviewer" is valid: C:\SDK-Java.20\bin\appletviewer.exe
  33. Path for key "jdk-bin_directory" is valid: E:\Jdk1.1.4\bin
  34. Path for key "msj-bin_directory" is valid: C:\SDK-Java.20\bin
  35. Path for key "jdk-runapplicationwindow_release" is valid: E:\Jdk1.1.4\bin\javaw.exe
  36. Path for key "jdk-compiler" is valid: E:\Jdk1.1.4\bin\javac.exe
  37. Path for key "InternetExplorerBrowser" is valid: C:\Ie4\Iexplore.exe
  38. Path for key "jdk-javah" is valid: E:\Jdk1.1.4\bin\javah.exe
  39. Path for key "jdk-appletviewer_release" is valid: E:\Jdk1.1.4\bin\appletviewer.exe
  40. Path for key "msj-wjview" is valid: C:\SDK-Java.20\bin\wjview.exe
  41. Path for key "java-help" is valid: G:\Dippy\api.hlp
  42. Path for key "msj-jexegen" is valid: C:\SDK-Java.20\bin\jexegen.exe
  43. Path for key "DefaultHtmlBrowser" is valid: F:\Program Files\Microsoft Internet Explorer 4\Iexplore.exe
  44. No invalid files were found!
  45. @Note: These paths checked by this script are stored in the MapFile 
  46. "ApplicationHelpers.map" which is located in your Ide/Data folder. 
  47. @EndNote:
  48. @EndTool: 
  49. @Summary: validate~checks configuration data
  50. */
  51.  
  52. var output = getOutput();
  53.  
  54. function DoCommand()
  55. {
  56.     output.clear();
  57.     output.writeLine("Checking file paths in ApplicationHelpers");
  58.     var count = 0;
  59.     var helpers = getMapFile("ApplicationHelpers");
  60.     var position = helpers.getHeadPosition();
  61.     while(position.valid)
  62.     {
  63.         var association = helpers.getNext(position);
  64.         var file = association.value;
  65.         if (file.type == "File" && !file.exists)
  66.         {
  67.             output.writeLine("The path for " + association.key + " is not valid");
  68.             count += 1;
  69.         }
  70.         else
  71.         {
  72.             output.writeLine("Path for key \"" + association.key + "\" is valid: " +
  73.                 file.path);
  74.         }
  75.     }
  76.     
  77.     if (count == 0)
  78.     {
  79.         output.writeLine("No invalid files were found!");
  80.     }
  81.     else
  82.     {
  83.         if (count == 1)
  84.             output.writeLine("" + count + " path is not valid.");
  85.         else
  86.             output.writeLine("" + count + " paths are not valid.");
  87.     }
  88. }
  89.  
  90. !!/Script
  91.