Installing Enhydra Cygwin Tools on Another Drive

If you have installed the Enhydra development environment on Windows™, you've probably run into the limitation that the Cygwin tools appear to require everything to be installed on the C: drive. This FAQ describes this limitation in more detail and gives instructions on moving the Cygwin tools to another drive.

There are four main pieces of a Lutris Enhydra installation on Windows:

  1. A Java™ Development Kit (JDK)
  2. The Cygnus tools
  3. The Enhydra installation
  4. Enhydra applications you build

The Cygnus tools, Enhydra installation, and your Enhydra applications must all be on the same drive. This restriction is caused by the way the Cygnus tools map the root path of the directory tree. The Cygnus tools take /usr/local to be C:\usr\local if the tools are installed on the C drive. You can refer to other drives with the syntax //D/some_dir, but this cross-drive syntax breaks down when trying to invoke Java from within the Cygnus shell. The general solution is to put Cygnus, Enhydra, and your applications on one drive. If your JDK is on another drive, run the configure command with the following syntax:

configure //D/jdk1.2.2

The default drive to install everything on is the system drive, which is often the C drive. The system drive is where your operating system is installed. For example, if you have Windows NT installed on the F drive then you can install everything on the F drive without further configuration. If you need to move everything to a non-system drive you have to edit the Windows registry to reset where the Cygnus tools think the root of the file system is. The remaining instructions below show how to do this.

  1. Remove the Cygnus installation from the old drive and re-install the Enhydra version of the Cygnus tools to the new drive. You can alternatively move the existing installation with Windows Explorer. When you are finished you should have the following directories where X is the letter of the destination drive:
    X:/bin
    X:/enhydra
    X:/usr
    X:/tmp
    
  2. You have to run the Cygnus bash shell at least once so it registers itself in the Windows registry. If you haven't run the Cygnus bash shell previously, use Windows Explorer to start the program X:\bin\bash.exe where X is drive letter. Exit the shell once it starts.

  3. Edit the batch file that starts the bash shell. Open the file X:\enhydra\Enhydra.bat in Notepad. Change references to C: to the appropriate drive letter. You also have to edit the shortcuts that point to the Enhydra.bat file. Right click on the short cut X:\enhydra\EnhydraShell_95_98 or X:\enhydra\EnhydraShell_NT depending on your operating system and edit the path to the Enhydra.bat file to reflect the correct drive. If you had previously created a desktop shortcut to the batch file that starts the shell, you will have to edit its properties to point to the new location of the batch file. Right click on icon, select properties, and edit the path to the executable under the Shortcut tab. This step is shown in the figure below.

    Figure 1: Editing the Cygwin shortcut target.

  4. The next step is to edit the mount entries in the Windows registry. Note that using the Registry Editor in Windows is like trying to build cabinetry with a chainsaw, so be very careful. Start the registry editor by going to Start | Run and entering the command regedit as shown below.

    Figure 2: Starting the Windows Registry Editor.

    In the Registry editor, begin by backing up your current registry information. Go to the Registry menu and select Export Registry File. Save this file and reimport the copy of the original registry in the event that something goes wrong.

  5. After saving the existing configuration, start the find utility by selecting Edit | Find and searching on "mounts." The path to the entry typically looks like My Computer/HKEY_CURRENT_USER/Software/Cygnus Solutions/CYGWIN.DLL setup/b15.0/mounts. Find the subkey that has the listing that contains the mappings for native to "C:" and for unix to "/". This is in the 04 entry by default. Right click on the entry Native and select edit. Change it from "C:" to the appropriate drive letter. An example of the registry editor is shown below.

    Figure 3: Editing the Native entry in the Registry Editor.

  6. Cygwin should now run from the new drive location. Note that bash requires a /tmp directory. If everything worked, you should be able to run the mount command and see something like this:

    Enhydra$ mount
    Device           Directory           Type        Flags
    \\.\tape1:       /dev/st1            native      text!=binary
    \\.\tape0:       /dev/st0            native      text!=binary
    \\.\b:           /dev/fd1            native      text!=binary
    \\.\a:           /dev/fd0            native      text!=binary
    D:               /                   native      text!=binary
    Enhydra$
    
  7. You must now move your Enhydra installation and applications over to the new drive. If you previously moved them with Windows Explorer along with the Cygnus tools, the job is already done. In either case, you must re-run the configure command on your Enhydra installation to configure the files to point to the appropriate JDK.