home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 1997-1998 - Modelworks Software
-
- /**
- @Tool: MSJ~displays a open folder dialog to let you select
- your MSJ (Microsoft SDK Java) directory.
- @Image: Open Folder Dialog showing a Microsoft SDK Java directory@select_MSJ_Directory.gif
- @EndTool:
- @Summary: MSJ~sets the path to your MSJ directory
- */
-
- var gOutput = getOutput();
- var gHelpers = getMapFile("ApplicationHelpers");
- var gOptions = getMapFile("MSJToolsStandardOptions");
-
- function DoCommand()
- {
- var msj_bin_directory = gHelpers.lookup("msj-bin_directory");
- if (msj_bin_directory && msj_bin_directory.exists)
- {
- var compilePath = newFile(msj_bin_directory.path + "\\jvc.exe");
- if (compilePath.exists)
- {
- var to = msj_bin_directory.path.length - 4;
- var msj_directory_path = msj_bin_directory.path.substring(0, to);
- if (confirm("Your current MSJ directory is: " + msj_directory_path +
- "\". Do you want to change to a new directory?"))
- {
- SetNewDirectory();
- }
- }
- }
- else
- {
- SetNewDirectory();
- }
- }
-
- function SetNewDirectory()
- {
- gOutput.clear();
-
- var directory = chooseDirectory("Locate your Microsoft Java SDK directory (sdk-java)");
- if (directory)
- {
- var test = newFile(directory + "\\jvc.exe");
- if (test.exists) // Remove "\\bin"
- {
- var to = directory.length - 4;
- directory = directory.substring(0, to);
- }
-
- var msj_bin_directory = newFile(directory + "\\bin");
- var jvcPath = newFile(directory + "\\bin\\jvc.exe");
- if (msj_bin_directory.exists && jvcPath.exists)
- {
- gHelpers.add("msj-bin_directory", msj_bin_directory);
-
- // Java compiler
- gHelpers.add("msj-jvc", jvcPath);
-
- // Appletviewer
- var appletviewerPath = newFile(directory + "\\bin\\appletviewer.exe");
- gHelpers.add("msj-appletviewer", appletviewerPath);
-
- // Application viewer
- var jviewPath = newFile(directory + "\\bin\\jview.exe");
- gHelpers.add("msj-jview", jviewPath);
-
- // Application viewer in a graphic window
- var wjviewPath = newFile(directory + "\\bin\\wjview.exe");
- gHelpers.add("msj-wjview", wjviewPath);
-
- // ClassVue
- var classvuePath = newFile(directory + "\\bin\\classvue.exe");
- gHelpers.add("msj-classvue", classvuePath);
-
- // Javatlb/JCom
- var javatblPath = newFile(directory + "\\bin\\javatlb.exe");
- if (javatblPath.exists)
- {
- gHelpers.add("msj-javatlb", javatblPath);
- }
- else
- {
- gHelpers.remove("msj-javatlb");
- }
- gHelpers.remove("msj-jcom"); // obsolete
-
- var jactivexPath = newFile(directory + "\\bin\\jactivex.exe");
- gHelpers.add("msj-jactivex", jactivexPath);
-
- // Java application generator
- var jexegenPath = newFile(directory + "\\bin\\jexegen.exe");
- gHelpers.add("msj-jexegen", jexegenPath);
-
- // MSJavah
- var msjavahPath = newFile(directory + "\\bin\\msjavah.exe");
- gHelpers.add("msj-msjavah", msjavahPath);
-
- // Tool Info: not currently used
- gHelpers.remove("msj-toolInfo");
-
- // Update the options
- var buildmode = gOptions.lookup("msj-buildmode", "");
- if (buildmode == "") // Define the initial options
- {
- gOptions.setValue("msj-buildmode", "release");
- gOptions.setValue("msj-build", "MSJ Release Build");
- gOptions.lookup("runInWindow", true);
- //alert("MSJ Debug Build Configuration Set");
- }
-
- var msjOptions = getScriptObject("\\Library\\msjOptions");
- msjOptions.UpdateOptions();
-
- gOutput.writeLine("MSJ directory set to: \"" + directory + "\"");
- gOutput.writeLine("Note: You may need to run the Microsoft SDK installer before this change is fully effective.");
- }
- else
- {
- gOutput.writeLine("WARNING: The directory, \"" + directory +
- "\" does not appear to be a valid sdk-java directory");
- gOutput.writeLine("A valid sdk-java directory contains a bin folder containing Microsoft tools (e.g., jvc.exe)");
- }
- }
- }
-
- !!/Script
-