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, or from inside Cygwin. These two methods are slightly different due to differences in path names (drive letters, path separators).
Without Cygwin
Download and unzip the pre-packaged darcs and putty 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.
- 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'.
With Cygwin
- Download and untar the pre-packaged darcs and putty package for cygwin.
- Add the resulting "darcsdir" directory to the end of your path.
- If you want to use darcs over ssh you need to set up passwordless ssh login. Darcs over ssh is required to push patches to a remote machine. Note that you have to set up a new ssh configuation using the putty executables in the darcsdir directory -- darcs will not use cygwin ssh nor your current cygwin ssh configuration.
- 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 you login to your cygwin shell through ssh for example you need to start pageant from this shell.
- For example you could add ' cygstart DARCSDIR/pageant.exe PATH-TO-THE-PRIVATE-KEY' to your .bash_profile script
- If everything went well, the final check is executing "ssh USERNAME@HOST" (note: this is the putty ssh executable that came in the darcsdir-cygwin.tar.bz2 package, not your normal cygwin ssh, which is usually found in /usr/bin/ssh.exe). 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
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 http://www.chiark.greenend.org.uk/~sgtatham/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 pagent.exe, puttygen.exe, plink.exe, sftp.exe, and pscp.exe from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- Put darcs.exe, plink.exe, pscp.exe, sftp.exe, pagent.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.)
