home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Configuration / MSJ.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  4.2 KB  |  130 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: MSJ~displays a open folder dialog to let you select 
  6. your MSJ (Microsoft SDK Java) directory. 
  7. @Image: Open Folder Dialog showing a Microsoft SDK Java directory@select_MSJ_Directory.gif
  8. @EndTool: 
  9. @Summary: MSJ~sets the path to your MSJ directory
  10. */
  11.  
  12. var gOutput = getOutput();
  13. var gHelpers = getMapFile("ApplicationHelpers");
  14. var gOptions = getMapFile("MSJToolsStandardOptions");
  15.  
  16. function DoCommand()
  17. {
  18.   var msj_bin_directory = gHelpers.lookup("msj-bin_directory");
  19.   if (msj_bin_directory && msj_bin_directory.exists)
  20.   {
  21.     var compilePath = newFile(msj_bin_directory.path + "\\jvc.exe");
  22.     if (compilePath.exists)
  23.     {
  24.       var to = msj_bin_directory.path.length - 4;
  25.       var msj_directory_path = msj_bin_directory.path.substring(0, to);
  26.       if (confirm("Your current MSJ directory is: " + msj_directory_path + 
  27.         "\". Do you want to change to a new directory?"))
  28.       {
  29.         SetNewDirectory();
  30.       }
  31.     }
  32.   }
  33.   else
  34.   {
  35.     SetNewDirectory();
  36.   }
  37. }
  38.  
  39. function SetNewDirectory()
  40. {
  41.   gOutput.clear(); 
  42.   
  43.   var directory = chooseDirectory("Locate your Microsoft Java SDK directory (sdk-java)");
  44.   if (directory)
  45.   {
  46.     var test = newFile(directory + "\\jvc.exe");
  47.     if (test.exists) // Remove "\\bin"
  48.     {
  49.       var to = directory.length - 4;
  50.       directory = directory.substring(0, to);
  51.     }
  52.     
  53.     var msj_bin_directory = newFile(directory + "\\bin");
  54.     var jvcPath = newFile(directory + "\\bin\\jvc.exe");
  55.     if (msj_bin_directory.exists && jvcPath.exists)
  56.     {
  57.       gHelpers.add("msj-bin_directory", msj_bin_directory);
  58.       
  59.       // Java compiler
  60.       gHelpers.add("msj-jvc", jvcPath);
  61.       
  62.       // Appletviewer
  63.       var appletviewerPath = newFile(directory + "\\bin\\appletviewer.exe");
  64.       gHelpers.add("msj-appletviewer", appletviewerPath);
  65.       
  66.       // Application viewer
  67.       var jviewPath = newFile(directory + "\\bin\\jview.exe");
  68.       gHelpers.add("msj-jview", jviewPath);
  69.       
  70.       // Application viewer in a graphic window
  71.       var wjviewPath = newFile(directory + "\\bin\\wjview.exe");
  72.       gHelpers.add("msj-wjview", wjviewPath);
  73.       
  74.       // ClassVue
  75.       var classvuePath = newFile(directory + "\\bin\\classvue.exe");
  76.       gHelpers.add("msj-classvue", classvuePath);
  77.       
  78.       // Javatlb/JCom
  79.       var javatblPath = newFile(directory + "\\bin\\javatlb.exe");
  80.       if (javatblPath.exists)
  81.       {
  82.         gHelpers.add("msj-javatlb", javatblPath);
  83.       }
  84.       else
  85.       {
  86.         gHelpers.remove("msj-javatlb");
  87.       }
  88.       gHelpers.remove("msj-jcom"); // obsolete
  89.         
  90.       var jactivexPath = newFile(directory + "\\bin\\jactivex.exe");
  91.       gHelpers.add("msj-jactivex", jactivexPath);
  92.       
  93.       // Java application generator
  94.       var jexegenPath = newFile(directory + "\\bin\\jexegen.exe");
  95.       gHelpers.add("msj-jexegen", jexegenPath);
  96.       
  97.       // MSJavah
  98.       var msjavahPath = newFile(directory + "\\bin\\msjavah.exe");
  99.       gHelpers.add("msj-msjavah", msjavahPath);
  100.                  
  101.       // Tool Info: not currently used
  102.       gHelpers.remove("msj-toolInfo");
  103.       
  104.       // Update the options
  105.       var buildmode = gOptions.lookup("msj-buildmode", "");
  106.       if (buildmode == "")  // Define the initial options
  107.       {
  108.         gOptions.setValue("msj-buildmode", "release");
  109.         gOptions.setValue("msj-build", "MSJ Release Build"); 
  110.         gOptions.lookup("runInWindow", true); 
  111.         //alert("MSJ Debug Build Configuration Set");
  112.       }
  113.       
  114.       var msjOptions = getScriptObject("\\Library\\msjOptions");
  115.       msjOptions.UpdateOptions();
  116.       
  117.       gOutput.writeLine("MSJ directory set to: \"" + directory + "\"");
  118.       gOutput.writeLine("Note: You may need to run the Microsoft SDK installer before this change is fully effective.");
  119.     }
  120.     else
  121.     {
  122.       gOutput.writeLine("WARNING: The directory, \"" + directory + 
  123.         "\" does not appear to be a valid sdk-java directory");
  124.       gOutput.writeLine("A valid sdk-java directory contains a bin folder containing Microsoft tools (e.g., jvc.exe)");
  125.     }
  126.   }
  127. }
  128.  
  129. !!/Script
  130.