home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 1999 - Modelworks Software
-
- /**
- @Tool: generateUpdate~copies all files in the current IDE
- folder that are newer than a given date to a Update folder
- suitable for archiving using WinZip which in turn can be
- used to update other copies of the IDE.
- @EndTool:
- @Summary: generateUpdate~generates a folder that can be used to update other copies
- */
-
- var gUpdateDirectory = "C:\\IDEUpdate"; // Define a folder for the updated files
- var gDate = new Date(1998,8,19).getTime(); // Select a date
-
- var gOutput = getOutput();
- var gIDEDirectory = File.getApplicationPath();
-
- function DoCommand()
- {
- gOutput.writeLine("Generate Update\n");
-
- if (gIDEDirectory)
- {
- ProcessDirectory(gIDEDirectory);
- }
-
- gOutput.writeLine("Finished\n");
- }
-
- function ProcessDirectory(directory)
- {
- if (directory)
- {
- gOutput.writeLine("Processing directory: " + directory);
-
- var fileList = getDirectoryFiles(directory, "*.*", false);
- if (fileList)
- {
- var position = fileList.getHeadPosition();
- while (position && position.valid)
- {
- var file = fileList.getNext(position);
- var path = file.path;
- if(path.length > gIDEDirectory.length && file.lastModified >= gDate)
- {
- var newPath = gUpdateDirectory + path.substring(gIDEDirectory.length, path.length);
- file.copyTo(newPath, false)
- }
- }
- }
-
- var directoryList = getDirectories(directory);
- if (directoryList)
- {
- directoryList.sort(compareFiles);
- var position = directoryList.getHeadPosition();
- while (position && position.valid)
- {
- var directoryFile = directoryList.getNext(position);
- ProcessDirectory(directoryFile.path);
- }
- }
- }
- }
-
- !!/Script
-
-