Added some advice for hangs, and put the Q: items in the form
[rsync-web.git] / win95.txt
1 Compiling rsync for MS Windows 95
2 =================================
3
4 Caveat: 
5 There are no doubt other ways to do this, but I have not tried them.
6
7 This will produce an rsync binary which runs under win95/NT which can _send_
8 data to a UNIX rsync host but not receive. This is suitable for my requirements
9 as I am backing up a bunch of win95 machines to a linux server, but it may
10 not be what _you_ require.
11
12 NOTE: I am now told (by patl@curl.com) that receiving as well as
13 sending works with the current cygwin32 toolkit.
14
15
16 Step 1. Get the Cygnus development kit
17 --------------------------------------
18
19 If you do not already know about this wonderful project undertaken by cygnus,
20 grab the latest copy of the gnu-win32 runtime system from 
21
22     http://www.cygnus.com/misc/gnu-win32/
23
24 You will want the CDK-B19.EXE self-installing binary (be warned - it's 12M
25 in size) which contains gcc+binutils+DLLs required by the system. Read the
26 instructions about this and install it. You will then have something which 
27 looks _very_ close to a UNIX box as far as any UNIX software ic concerned.
28
29 Also grab the updated version (B19.1) of the DLL as this fixes some problems
30 (it's pretty small at ~190k).
31
32 Take a bit of time to play with this stuff - have a look at the registry
33 entries that define mount points etc so you know where/how your windows
34 directories are mapped.
35
36 Step 2. Compile rsync
37 ---------------------
38
39 Once the magic BASH$ prompt appears in your cygnus dos box, you can download
40 and compile rsync right out of the box. You might want to do this:
41
42     tar xvzf rsync-2.0.17.tar.gz  (or whatever version...)
43     cd rsync-2.0.17
44     chmod +x configure          (exec is not set automatically)
45     ./configure
46     make
47
48 and you will have a working RSYNC.EXE
49
50 Before you can do a "make install" you must edit the Makefile so that
51 it knows about "rsync.exe" rather than "rsync".
52
53 Step 3 (optional) - compile and install SSH
54 -------------------------------------------
55
56 If you want to use ssh as the transport then you better grab a copy and compile
57 it - again, no surprises. It compiles ok under gnuwin32, and you can generate
58 keys etc in the normal way.
59
60 Problems
61 --------
62
63 Well, it _almost_ works seamlessly. Here are a couple of problems I have
64 encountered so far - I do not know why these symptoms occur, and they are
65 probably nothing to do with rsync, but if you follow this course then you
66 will probably run into these things also...
67
68 1. rsync will not _receive_ data onto a windows box. It seems to do everything
69    ok, but then hangs at the last step and no files actually appear. When
70    transferring via my modem, I can see data being received, but it never 
71    appears in my directory.
72
73 NOTE: This now appears to be fixed.
74
75 2. rsync, ssh and other gnuwin32-compiled programs can be called directly from
76    a DOS prompt, but argument passing seems to be broken. This means that
77    starting SSH directly is difficult.
78
79    After a bit of experimenting I found a workaround, which is not pretty
80    but worked for me :-)
81
82    Lets say you want to call ssh from a normal DOS prompt. Set up a batch
83    file called "SSH.BAT" which sets up the cygnus environment and calls bash
84    with the argument "ssh.sh %1 %2 %3 %4 %5 %6 %7 %8 %9". You can copy the
85    cygnus.bat file and use it as a template if you like. here is my ssh.bat:
86
87
88     @ECHO OFF
89     SET TERM=ansi
90     SET MAKE_MODE=unix
91     SET CYGFS=e:/apps/cygnus
92     SET GCC_EXEC_PREFIX=/lib\gcc-lib\
93     SET TCL_LIBRARY=%CYGROOT%\share\tcl8.0\
94     SET HOME=/home/awesley
95     SET GDBTK_LIBRARY=%CYGFS%/share/gdbtcl
96     bash /scripts/ssh.sh %1 %2 %3 %4 %5 %6 %7 %8 %9
97
98
99    Create a shell script called ssh.sh containing:
100
101     /usr/local/bin/ssh $*
102
103    which is then run by bash and calls the ssh binary (wherever you have
104    installed it).
105
106    I suspect that there is a better way, but I have not yet had time to 
107    look for it.
108
109
110 Cheers, Anthony Wesley