Running GNU Lilypond on Windows

There are many ways of setting up LilyPond in Windows. The following is the cleanest I found for Lilypond 1.2.x. The current Lilypond setup.exe attempts to download all the required stuff and keep it straight. If it collapses because of the speed with which the internet changes, use the following as a backup, to understand what is going on. And, bookmark the Lily-on-Windows help page and make sure you have a file defragmenter installed.

Put all downloaded files in a work directory such as C:\TEMP unless otherwise stated. Use only DOS-legal filenames for Unix stuff. Do not install them in the NT Program Files directory. The following has been thoroughly tested with Windows NT4 SP6a, MiKTeX 1.20e, Gsview 2.6, guile-1.3.4, python-1.5.1 and Lilypond-1.2.17.

  1. Login as administrator
  2. Defrag: If you don't already have a file defragmenter, download DisKeeper Lite and doubleclick its file icon to install. It's freeware. Unix programs are designed for a zillion small files, NT for a small number of big files. Unix instals make a real mess of an NT disk - you must optimize your system disk after installation.
  3. TeX: Download, unzip it, doubleclick its setupwiz icon. It installs in C:\texmf (I skipped localtexmf). Defrag (doubleclick the root icon, right-click C:, click properties/tools/defragment; in dklite defragment C:).
  4. Ghostscript: Download GhostView doubleclick the gsv*.exe file icon, install everything. It can go in Program Files
  5. Cygwin: Download cygwin, setup.exe and the "user" binaries: ash, bash, bzip2, diff, fileutils, findutils, gawk, grep, gzip, less, m4, sed, shellutils, tar, texinfo, textutils and time. Doubleclick the setup icon, select instal from local directory, root directory c:\cygwin, install for all, and text mode. Doubleclick on the cygwin icon. If everything worked you will have a bash shell window, be in the c:\cygwin\home\administrator directory, and see a ~ prompt. Cd / then ls should show the usual Unix root directories bin src etc. (If not, something went wrong with the cygwin install - get it right before proceeding. The cygwin mailing list is supposed to help with things like this, but I found the Lily mailing list much more helpful.) Logout (of cygwin).
  6. Environment: Click Start then Settings Control Panel; doubleclick System then click Environment. Click path (in the top window), add ;C:\cygwin\bin;C:\texmf\miktex\bin to the end of the value, click OK then Apply. Create a text file C:\lilyset.bat containing
    set GUILE_LOAD_PATH=//C/Cygwin/usr/share/guile/1.3.4
    set LILYPONDPREFIX=//C/Cygwin/usr/lilypond-1.2.17.jcn1/share/lilypond
    set LILYINCLUDE=//C/texmf/fonts/tfm/public/cm
    set LILYPONDPREFIX_DOS=c:\cygwin\usr\lilypond-1.2.17.jcn1\share\lilypond
    set TFMFONTS=C:\texmf\fonts\tfm\public\cm;%LILYPONDPREFIX_DOS%\tfm
    cd C:\cygwin\usr\lilypond-1.2.17.jcn1\bin

    Note the slash directions etc. - the first three sets above must be in Cygwin/Unix format, the rest in DOS format.
  7. Python: If you will be using ly2dvi, download python. Doubleclick the file icon. It instals in Program Files then reboots.
  8. Geometry: Add a directory geometry to C:\texmf\tex\latex, Download geometry.dtx and geometry.ins there. Doubleclick the DOS icon, type lilyset then cd \texmf\tex\latex\geometry then latex geometry.ins. (It should say 1000+ code lines added, among other things.)
  9. Guile: Download the tarball - put it in c:\ In DOS, type dir then tar -xzf guile-1.3.4 (you have to type filenames in full exactly as dir presents them - there is no tab-complete in DOS). It should create C:\cygwin\usr\bin\guile.exe among other things.
  10. Lilypond: Download the tarball - put it in c:\ In DOS, type dir then tar -xzf lilypond-1.2.17.jcn1 It should create C:\cygwin\usr\lilypond-1.2.17.jcn1\bin\lilypond.exe among other things.
  11. Fonts: Copy any feta* fonts that latex can't find from C:\cygwin\usr\lilypond-1.2.17.jcn1\share\lilypond\tfm\*.tfm to C:\texmf\fonts\tfm\public\lilypond\*.tfm. The fonts required depend on your .ly code - in my case, I had to copy feta19.tfm
  12. Permission: Set Everyone Full Control on the C:\cygwin\usr\lilypond-1.2.17.jcn1\bin\ directory.
  13. Defrag.
  14. Logout as administrator.

From now on, you can be an NT user.

  1. Login as a user
  2. Create desktop shortcuts to lilydir C:\cygwin\usr\lilypond-1.2.17.jcn1\bin and to lilysource, the directory where you edit/create your Mudela files, TeX envelopes etc.
  3. Copy (Control-drag) the files you want to work on from lilysource to lilydir. (I started the Scarlatti project before ly2dvi worked, so still use use Mudela names, Tnnn.tex envelope names, and package the next step in a lily.bat)
  4. Doubleclick the DOS icon, type lilyset then lilypond {filename} 1> lily.log 2>&1. Lilypond's error messages will go in lily.log and the output in {filename}.tex. Latex {filename} will then produce {filename}.dvi; dvips {filename} {filename}.ps.
  5. View {filename}.ps with GhostView.

John Sankey, with gratefully acknowledged assistance from Jan, Shamus, Mats and Jérémie.

Tour the
PC Software Ring
[Previous | Next | Random | List]