2004-09-15 00:11:12 +01:00
|
|
|
// =================================================================
|
|
|
|
// Logtalk - Object oriented extension to Prolog
|
2006-03-26 18:31:34 +01:00
|
|
|
// Release 2.27.1
|
2004-09-15 00:11:12 +01:00
|
|
|
//
|
2006-02-10 17:44:05 +00:00
|
|
|
// Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
2004-09-15 00:11:12 +01:00
|
|
|
// =================================================================
|
|
|
|
|
|
|
|
if (WScript.Arguments.Unnamed.Length > 0) {
|
|
|
|
usage_help();
|
|
|
|
WScript.Quit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
WScript.Echo('');
|
2004-11-29 20:36:31 +00:00
|
|
|
WScript.Echo('Completing Logtalk installation...');
|
2004-09-15 00:11:12 +01:00
|
|
|
WScript.Echo('');
|
|
|
|
|
|
|
|
var WshShell = new ActiveXObject("WScript.Shell");
|
|
|
|
var WshSystemEnv = WshShell.Environment("SYSTEM");
|
2004-11-29 20:36:31 +00:00
|
|
|
var WshUserEnv = WshShell.Environment("USER");
|
2004-09-15 00:11:12 +01:00
|
|
|
var FSObject = new ActiveXObject("Scripting.FileSystemObject");
|
|
|
|
|
|
|
|
WshShell.CurrentDirectory = "..";
|
|
|
|
|
2004-11-29 20:36:31 +00:00
|
|
|
WshSystemEnv.Item("LOGTALKHOME") = WshShell.CurrentDirectory;
|
|
|
|
WScript.Echo("Defined system environment variable LOGTALKHOME pointing to:");
|
|
|
|
WScript.Echo("");
|
|
|
|
WScript.Echo(" " + WshShell.CurrentDirectory);
|
|
|
|
WScript.Echo("");
|
|
|
|
|
2004-12-05 21:52:49 +00:00
|
|
|
if (WshUserEnv.Item("LOGTALKUSER")) {
|
|
|
|
WScript.Echo("Reusing user environment variable LOGTALKUSER pointing to:");
|
|
|
|
WScript.Echo("");
|
|
|
|
WScript.Echo(" " + WshUserEnv.Item("LOGTALKUSER"));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
WshUserEnv.Item("LOGTALKUSER") = WshShell.SpecialFolders("MyDocuments") + "\\logtalk";
|
|
|
|
WScript.Echo("Defined user environment variable LOGTALKUSER pointing to:");
|
|
|
|
WScript.Echo("");
|
|
|
|
WScript.Echo(" " + WshShell.SpecialFolders("MyDocuments") + "\\logtalk");
|
|
|
|
}
|
2004-11-29 20:36:31 +00:00
|
|
|
WScript.Echo("");
|
2004-12-05 21:52:49 +00:00
|
|
|
|
2005-04-23 00:57:45 +01:00
|
|
|
WshSystemEnv.Item("PATH") = WshSystemEnv.Item("PATH") + ";%LOGTALKHOME%\\scripts;%LOGTALKHOME%\\xml";
|
|
|
|
WScript.Echo("Added Logtalk scripts and xml directories to the system PATH environment");
|
2004-12-05 21:52:49 +00:00
|
|
|
WScript.Echo("variable.");
|
2004-11-29 20:36:31 +00:00
|
|
|
WScript.Echo("");
|
|
|
|
|
|
|
|
FSObject.CopyFile(WshShell.CurrentDirectory + "\\BIBLIOGRAPHY", WshShell.CurrentDirectory + "\\BIBLIOGRAPHY.txt");
|
2005-05-24 00:33:41 +01:00
|
|
|
FSObject.CopyFile(WshShell.CurrentDirectory + "\\INSTALL", WshShell.CurrentDirectory + "\\INSTALL.txt");
|
2004-11-29 20:36:31 +00:00
|
|
|
FSObject.CopyFile(WshShell.CurrentDirectory + "\\LICENSE", WshShell.CurrentDirectory + "\\LICENSE.txt");
|
|
|
|
FSObject.CopyFile(WshShell.CurrentDirectory + "\\QUICK_START", WshShell.CurrentDirectory + "\\QUICK_START.txt");
|
|
|
|
FSObject.CopyFile(WshShell.CurrentDirectory + "\\README", WshShell.CurrentDirectory + "\\README.txt");
|
|
|
|
FSObject.CopyFile(WshShell.CurrentDirectory + "\\RELEASE_NOTES", WshShell.CurrentDirectory + "\\RELEASE_NOTES.txt");
|
|
|
|
FSObject.CopyFile(WshShell.CurrentDirectory + "\\UPGRADING", WshShell.CurrentDirectory + "\\UPGRADING.txt");
|
2004-09-15 00:11:12 +01:00
|
|
|
|
|
|
|
var ProgramsPath = WshShell.SpecialFolders("AllUsersPrograms");
|
|
|
|
|
|
|
|
if (!FSObject.FolderExists(ProgramsPath + "\\Logtalk"))
|
|
|
|
FSObject.CreateFolder(ProgramsPath + "\\Logtalk");
|
|
|
|
|
2004-12-05 21:52:49 +00:00
|
|
|
var link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Web Site.url");
|
2004-09-15 00:11:12 +01:00
|
|
|
|
|
|
|
link.TargetPath = "http://www.logtalk.org/";
|
|
|
|
link.Save();
|
|
|
|
|
|
|
|
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk HTML Documentation.lnk");
|
|
|
|
|
|
|
|
link.Description = "Browse Logtalk Documentation";
|
2004-12-05 21:52:49 +00:00
|
|
|
link.TargetPath = WshShell.CurrentDirectory + "\\manuals\\index.html";
|
2004-09-15 00:11:12 +01:00
|
|
|
link.Save();
|
|
|
|
|
|
|
|
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk ReadMe.lnk");
|
|
|
|
|
|
|
|
link.Description = "Open Logtalk ReadMe";
|
2004-12-05 21:52:49 +00:00
|
|
|
link.TargetPath = WshShell.CurrentDirectory + "\\README.txt";
|
2004-09-15 00:11:12 +01:00
|
|
|
link.Save();
|
|
|
|
|
2005-05-24 00:33:41 +01:00
|
|
|
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Install and configuration.lnk");
|
|
|
|
|
|
|
|
link.Description = "Open Logtalk Install and configuration";
|
|
|
|
link.TargetPath = WshShell.CurrentDirectory + "\\INSTALL.txt";
|
|
|
|
link.Save();
|
|
|
|
|
2004-09-15 00:11:12 +01:00
|
|
|
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Quick Start.lnk");
|
|
|
|
|
|
|
|
link.Description = "Open Logtalk Quick Start";
|
2004-12-05 21:52:49 +00:00
|
|
|
link.TargetPath = WshShell.CurrentDirectory + "\\QUICK_START.txt";
|
2004-11-29 20:36:31 +00:00
|
|
|
link.Save();
|
|
|
|
|
|
|
|
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Bibliography.lnk");
|
|
|
|
|
|
|
|
link.Description = "Open Logtalk Bibliography";
|
2004-12-05 21:52:49 +00:00
|
|
|
link.TargetPath = WshShell.CurrentDirectory + "\\BIBLIOGRAPHY.txt";
|
2004-11-29 20:36:31 +00:00
|
|
|
link.Save();
|
|
|
|
|
|
|
|
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk License.lnk");
|
|
|
|
|
|
|
|
link.Description = "Open Logtalk License";
|
2004-12-05 21:52:49 +00:00
|
|
|
link.TargetPath = WshShell.CurrentDirectory + "\\LICENSE.txt";
|
2004-11-29 20:36:31 +00:00
|
|
|
link.Save();
|
|
|
|
|
|
|
|
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Release Notes.lnk");
|
|
|
|
|
|
|
|
link.Description = "Open Logtalk Release Notes";
|
2004-12-05 21:52:49 +00:00
|
|
|
link.TargetPath = WshShell.CurrentDirectory + "\\RELEASE_NOTES.txt";
|
2004-11-29 20:36:31 +00:00
|
|
|
link.Save();
|
|
|
|
|
|
|
|
link = WshShell.CreateShortcut(ProgramsPath + "\\Logtalk\\Logtalk Upgrading.lnk");
|
|
|
|
|
2004-12-05 21:52:49 +00:00
|
|
|
link.Description = "Open Logtalk Upgrading instructions";
|
|
|
|
link.TargetPath = WshShell.CurrentDirectory + "\\UPGRADING.txt";
|
2004-09-15 00:11:12 +01:00
|
|
|
link.Save();
|
|
|
|
|
2005-12-24 18:00:21 +00:00
|
|
|
WScript.Echo('Logtalk basic installation completed. You will need to RESTART in order');
|
2005-05-24 00:33:41 +01:00
|
|
|
WScript.Echo('to activate the new system environment variables and use the items in');
|
|
|
|
WScript.Echo('the new Logtalk program group. See the Install and configuration file');
|
|
|
|
WScript.Echo('for details on customizing your working environment.');
|
|
|
|
WScript.Echo('');
|
|
|
|
WScript.Echo('After restarting your computer, you may want to run some of the Prolog');
|
|
|
|
WScript.Echo('integration scripts, which you will find on the same directory as this');
|
|
|
|
WScript.Echo('installer script.');
|
2004-09-15 00:11:12 +01:00
|
|
|
WScript.Echo('');
|
2005-12-24 18:00:21 +00:00
|
|
|
WScript.Echo('Users must run the batch script cplgtdirs in order to copy the');
|
2004-12-05 21:52:49 +00:00
|
|
|
WScript.Echo('Logtalk user-modifiable files to their home directories. The path');
|
2005-04-23 00:57:45 +01:00
|
|
|
WScript.Echo('to the cplgtdirs, lgt2pdf, lgt2html, and lgt2xml batch scripts has');
|
|
|
|
WScript.Echo('been added to the system path environment variable.');
|
2004-12-05 21:52:49 +00:00
|
|
|
WScript.Echo('');
|
2004-09-15 00:11:12 +01:00
|
|
|
|
|
|
|
WScript.Quit(0);
|
|
|
|
|
|
|
|
function usage_help() {
|
|
|
|
WScript.Echo('');
|
|
|
|
WScript.Echo('This script completes the installation of Logtalk by setting the LOGTALKHOME');
|
2004-11-29 20:36:31 +00:00
|
|
|
WScript.Echo('and LOGTALKUSER system environment variables and by creating a new program');
|
|
|
|
WScript.Echo('group named "Logtalk" in the Windows Start Menu.');
|
2004-09-15 00:11:12 +01:00
|
|
|
WScript.Echo('');
|
|
|
|
WScript.Echo('The script must be run from this directory, by a user with administration');
|
|
|
|
WScript.Echo('privileges, after decompressing the Logtalk distribution into its final');
|
|
|
|
WScript.Echo('destination.');
|
|
|
|
WScript.Echo('');
|
|
|
|
WScript.Echo('Usage:');
|
|
|
|
WScript.Echo(' ' + WScript.ScriptName + ' help');
|
|
|
|
WScript.Echo(' ' + WScript.ScriptName);
|
|
|
|
WScript.Echo('');
|
|
|
|
}
|