WindowsConfiguration

These instructions describe how to set up Windows as a darcs client (not a darcs server). Darcs can be run from the standard Windows command shell, cmd.exe. Cygwin is not officially supported by the Darcs team, but perhaps you could try Zooko’s wrapper script mentioned in the manual process below.

From a binary

  • Download and unzip the darcs package for Windows. Let us refer to the resulting directory (including the path to it) as DARCSDIR.

  • Add DARCSDIR to the end of your path:
    • XP:

      • Right click on ‘My Computer’.
      • Choose ‘Properties’.
      • Click the ‘Advanced’ tab.
      • Click ‘Environment variables’
    • Vista: start -> control panel -> system -> change settings -> advanced -> environment variables

    • Find the ‘PATH’ environment variable and choose to edit it
    • Add ’;DARCSDIR’ to the end of the ‘PATH’ environment variable.
    • Save and close the windows.

  • Download following files from the PuTTY Download Page:
    • pageant.exe
    • puttygen.exe
    • plink.exe
    • psftp.exe and
    • pscp.exe
  • Rename plink.exe to ssh.exe and pscp.exe to scp.exe and put them in the DARCSDIR. (You could avoid renaming the files if you used the environment variables DARCS_SSH, etc; but renaming seems more convenient). Ensure that all these .exe files have permissions that allow you to execute them. If you are using cygwin, you can use “chmod ugo+x FILENAME” to enable execute permissions for each file.
  • If you want to use darcs over ssh you need to set up passwordless ssh login (password-based authentification is currently broken on windows). Darcs over ssh is required to push patches to a remote machine.
  • Generate a pair of keys as described on section 8.2.1 of the putty documentation.
  • To make ssh use your private key automatically (this is necessary since we are setting up passwordless ssh login) you need to start ‘pageant’. Therefore:

    • Create a new shortcut ‘pageant.exe’ in the ‘Start -> All programs -> Startup’ menu. (These programs are automatically executed on login.)
    • The shortcut shall execute ’ DARCSDIR/pageant.exe PATH-TO-THE-PRIVATE-KEY’. Note that since PATH-TO-THE-PRIVATE-KEY may contains spaces, it may be necessary to put quotes around it. It never hurts to put quotes around it.
    • Log out and log in again to check that ‘pageant’ automatically starts up.
    • Check that the key is loaded: double click the icon in the system tray. If there is listed one key, it should be fine. If no keys are listed, check the shortcut.
  • If everything went well, the final check is executing “ssh USERNAME@HOST”. If you get logged into the host you are done. If you are asked to enter your password then it is not working. Double-check that ‘pageant’ is started and the key is loaded, then go back through this process to figure out what went wrong. NOTE: this check is a very useful step in debugging. If anything ever seems wrong with your darcs-over-ssh behavior, then come back to this step!
  • Now you can access your repository using, for example: darcs get USER@HOST:/PATH/TO/REPOSITORY

  • If you want to configure user default prefs, you will need to define a HOME environment variable. If you do, darcs will look for the file ‘%HOME%\.darcs\defaults’.

The Manual Process – try this if you want a newer version of darcs

than the pre-packaged version supplied above

The basics (with or without Cygwin):

  • Download the latest darcs win32 binary from somewhere.

Pushing patches to a remote server requires a SSH implementation such as putty which supports both SCP and SFTP. Interactive password prompting will not work because the SSH clients are executed by darcs, so passwordless public key authentication must be configured. For a putty-oriented tutorial see http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey.

To enable access of remote repositories over ssh (with or without Cygwin, if you want to use ssh):

  • Download following files from the PuTTY Download Page:
    • pageant.exe
    • puttygen.exe
    • plink.exe
    • psftp.exe and

    • pscp.exe
  • Put darcs.exe, plink.exe, pscp.exe, psftp.exe, pageant.exe, and puttygen.exe in an empty directory.
  • Rename plink.exe to ssh.exe and pscp.exe to scp.exe. (You could avoid renaming the files if you used the environment variables DARCS_SSH, etc; but renaming seems more convenient). Ensure that all these .exe files have permissions that allow you to execute them. If you are using cygwin, you can use “chmod ugo+x FILENAME” to enable execute permissions for each file.
  • Set up passwordless ssh login as described on this page: http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter8.html#pubkey

Finally (without Cygwin):

  • Add the directory where you stored the executables at the beginning of your path.

Finally (with Cygwin):

  • Download cygwin-wrapper.bash, a cygwin bash script; put it in /usr/local/darcsdir-cygwin (directory as seen by cygwin), put all of the ssh .exe’s mentioned above into the same directory. Rename the darcs.exe to “realdarcs.exe”. Rename cygwin-wrapper.bash to “darcs”. Add /usr/local/darcsdir-cygwin to the end of your path. Don’t put /usr/local/darcsdir-cygwin at the beginning, because that directory contains executables such as “ssh.exe” which you probably don’t want to execute when you execute “ssh” on the bash command-line. Make sure you don’t have any other “darcs” executables earlier in your path. (Hint: enter the commands “type darcs” and “type ssh” at the bash command-line.)

HTTP Proxy using NTLM Authentication

darcs will work with HTTP proxies, but only non-authenticating ones. In many corporate environments, HTTP proxy servers use NTLM authentication. A workaround is to use an NTLM Authentication Proxy, like cntlm - http://cntlm.sourceforge.net/.

These instructions are for cntlm:

  • download and install

  • edit C:\Program Files\Cntlm\cntlm.ini; enter your username, password, domain, and current proxy setting (you can find this in IE under menu->Tools->Internet Options->Connections tab->LAN Settings)

  • (re)start cntlm : Start Menu->Run->services.msc, locate Cntlm, right-click…

  • create env var HTTP_PROXY=http://localhost:3128