Installing Ciao from a Win32 binary distribution

Author(s): Daniel Cabeza, Manuel Carro, Manuel Hermenegildo.

This describes the installation of Ciao after downloading the Windows binary (i.e., precompiled) distribution. It includes the installation of libraries and manuals and applies to Windows 95/98/NT/2000/XP systems. This is the simplest Windows installation, since it requires no compilation and is highly recommended. However, it is also possible to compile Ciao from the source distribution on these systems (please refer to Installing Ciao from the source distribution for details).

If you find any problems during installation, please refer to Troubleshooting (nasty messages and nifty workarounds). See also Downloading new versions and Reporting bugs.

Win32 binary installation summary

Please follow these steps (below we use the terms folder and directory interchangeably):

  1. Download the precompiled distribution and unpack it into any suitable folder, such as, e.g., C:\Program Files.

    This will create there a folder whose name reflects the Ciao version. Due to limitations of Windows related to file associations, do not put Ciao too deep in the folder hierarchy. For unpacking you will need a recent version of a zip archive manager -- there are many freely available such as WinZip, unzip, pkunzip, etc. (see for example www.winzip.com). Some users have reported some problems with version 6.2 of WinZip, but no problems with, e.g., version 7. With WinZip, simply click on “Extract” and select the extraction folder as indicated above.

  2. Stop any Ciao-related applications.

    If you have a previous version of Ciao installed, make sure you do not have any Ciao applications (including, e.g., a toplevel shell) running, or the extraction process may not be able to complete. You may also want to delete the entire folder of the previous installation to save space.

  3. Open the Ciao source directory created during extraction and run (e.g. by double-clicking on it) the install(.bat) script. Answer “yes” to the dialog that pops up and type any character in the installation window to finish the process. You may need to reboot for the changes in the registry to take effect.

    This will update the windows registry (the file ciao(.reg) lists the additions) and also create some .bat files which may be useful for running Ciao executables from the command line. It also creates initialization scripts for the emacs editor. The actions performed by the installation script are reported in the installation window.

  4. You may want to add a windows shortcut in a convenient place, such as the desktop, to ciaosh.cpx, the standard interactive toplevel shell. It is located inside the shell folder (e.g., click on the file ciaosh.cpx with the right mouse button and select the appropriate option, Send to->Desktop as shortcut).

  5. You may also want to add another shortcut to the file ciao(.html) located inside doc\reference\ciao_html so that you can open the Ciao manual by simply double-clicking on this shortcut.

  6. Finally, if the (freely available) emacs editor/environment is not installed in your system, we highly recommend that you also install it at this point. While it is easy to use Ciao with any editor of your choice, the Ciao distribution includes a very powerful application development environment which is based on emacs and which enables, e.g., source-level debugging, syntax coloring, context-sensitive on-line help, etc. If you are not convinced, consider that many programmers inside Micros*ft use emacs for developing their programs.

    The emacs editor (in all its versions: Un*x, Windows, etc.) can be downloaded from, for example, http://www.emacs.org/, and also from the many GNU mirror sites worldwide (See http://www.gnu.org/ for a list), in the gnu/emacs and gnu/windows/emacs directories. You can find answers to frequently asked questions (FAQ) about emacs in general at http://www.gnu.org/software/emacs/emacs-faq.text and about the Windows version at http://www.gnu.org/software/emacs/windows/ntemacs.html (despite the ntemacs name it runs fine also as is on Win9X and Win2000 machines).

    You need to tell emacs how to load the Ciao mode automatically when editing and how to access the on-line documentation:

    • Start emacs (double click on the icon or from the Start menu). Open (menu Files->Open File or simply ^X^F) the file ForEmacs.txt that the installation script has created in directory where you installed the Ciao distribution.

    • Copy the lines in the file (select with the mouse and then menu Edit->Copy). Open/Create using emacs (menu Files->Open File or simply ^X^F) the file ~/.emacs (or, if this fails, c:/.emacs).

    • Paste the two lines (menu Edit->Paste or simply ^Y) into the file and save (menu Files->Save Buffer or simply ^X^S).

    • Exit emacs and start it again.

    emacs should not report any errors (at least related to Ciao) on startup. At this point the emacs checks in the following section should work.

Checking for correct installation on Win32

After the actions and registry changes performed by the installation procedure, you should check that the following should work correctly:

  • Ciao-related file types (.pl source files, .cpx executables, .itf,.po,.asr interface files, .pls scripts, etc.) should have specific icons associated with them (you can look at the files in the folders in the Ciao distribution to check).

  • Double-clicking on the shortcut to ciaosh(.cpx) on the desktop should start the typical Prolog-style top-level shell in a window. If this shortcut has not been created on the desktop, then double-clicking on the ciaosh(.cpx) icon inside the shell folder within the Ciao source folder should have the same effect.

  • In the top-level shell, Ciao library modules should load correctly. Type for example use_module(library(dec10_io)). at the Ciao top-level prompt --you should get back a prompt with no errors reported.

  • To exit the top level shell, type halt. as usual, or ^D.

Also, the following documentation-related actions should work:

  • Double-clicking on the shortcut to ciao(.html) which appears on the desktop should show the Ciao manual in your default WWW browser. If this shortcut has not been created you can double-click on the ciao(.html) file in the doc\reference\ciao_html folder inside the Ciao source folder. Make sure you configure your browser to use style sheets for correct formatting of the manual (note, however, that some older versions of Explorer did not support style sheets well and will give better results turning them off).

  • The doc\reference folder contains the manual also in the other formats present in the distribution, such as info (very convenient for users of the emacs editor/program development system) and postscript or pdf, which are specially useful for printing. See Printing manuals (Win32) for instructions.

Finally, if emacs is installed, after starting it (double-clicking on the emacs icon or from the Start menu) the following should work:

  • Typing ^H i (or in the menus Help->Manuals->Browse Manuals with Info) should open a list of manuals in info format in which the Ciao manual(s) should appear.

  • When opening a Ciao file, i.e., a file with .pl or .pls ending, using ^X^Ffilename (or using the menus) the code should appear highlighted according to syntax (e.g., comments in red), and Ciao/Prolog menus should appear in the menu bar on top of the emacs window.

  • Loading the file using the Ciao/Prolog menu (or typing ^C l) should start in another emacs buffer the Ciao toplevel shell and load the file. You should now be able to switch the the toplevel shell and make queries from within emacs.

Note: when using emacs it is very convenient to swap the locations of the (normally not very useful) Caps Lock key and the (very useful in emacs) Ctrl key on the keyboard. How to do this is explained in the emacs frequently asked questions FAQs (see the emacs download instructions for their location).

If you find that everything works but emacs cannot start the Ciao toplevel you may want to check if you can open a normal Windows shell within emacs (just do M-x shell). If you cannot, it is possible that you are using some anti-virus software which is causing problems. See http://www.gnu.org/software/emac/windows/faq3.html#anti-virus for a workaround.

In some Windows versions it is possible that you had to change the first backslashes in the ciao-mode-init.el file in the Ciao Directory. E.g., assuming you have installed in drive c:, instances of c:\ need to be changed to c:/. For example: c:\prolog/ciao-1.7p30Win32/shell/ciaosh.bat should be changed to c:/prolog/ciao-1.7p30Win32/shell/ciaosh.bat.

Compiling the miscellaneous utilities under Windows

The etc folder contains a number of utilities, documented in the manual in PART V - Miscellaneous Standalone Utilities. In the Win32 distribution these utilities are not compiled by the installation process. You can create the executable for each of them when needed by compiling the corresponding .pl file.

Server installation under Windows

If you would like to install Ciao on a server machine, used by several clients, the following steps are recommended:

  • Follow the standard installation procedure on the server. When selecting the folder in which Ciao is installed make sure you select a folder that is visible by the client machines. Also make sure that the functionality specified in the previous sections is now available on the server.

  • Perform a client installation on each client, by running (e.g., double-click on it) the client.bat script. This should update the registry of each client. At this point all the functionality should also be available on the clients.

CGI execution under IIS

The standard installation procedure updates the windows registry so that Ciao executables (ending in .cpx) are directly executable as CGIs under Microsoft's IIS, i.e., so that you make applications written in Ciao available on the WWW (see the pillow library for specific support for this task). In the event you re-install IIS, you probably would lose the entries in the registry which allow this. In that case, processing the file ciao.reg produced during the installation (or simply reinstalling Ciao) will add those entries again.

Uninstallation under Windows

To uninstall Ciao under Windows, simply delete the directory in which you put the Ciao distribution. If you also want to delete the registry entries created by the Ciao installation (not strictly needed) this must currently be done by hand. The installation leaves a list of these entries in the file ciao.reg to aid in this task. Also, all the register entries contain the word ciao. Thus, to delete all Ciao entries, run the application regedit (for example, by selecting Run from the Windows Start menu), search (^F) for ciao in all registry entries (i.e., select all of Keys, Values, and Data in the Edit->Find dialog), and delete each matching key (click on the left window to find the matching key for each entry found).

%% Local Variables: %% mode: CIAO %% update-version-comments: "off" %% End: