1 Packaging LyX 1.3.6 for Windows
2 ===============================
3 Angus Leeming, 14 July 2005
4 ===========================
9 The very first thing to do on the way to creating a LyX/Win package is
10 to build the sources and install them somewhere accessible. I've written
11 a script, build_lyxwin.sh, that performs all the necessary steps. Please
12 read the preamble and (un)comment those steps that are necessary at the
15 The (eventual --- mingw is a *very* slow compiler) result is a lyx
16 package that's almost ready to go in $LYX_SRCS/build/installprefix.
18 Thereafter, the contents of this tree must be manipulated a
19 little. I've written a little script, package_lyxwin.sh, to automate
22 * Copy the DLLs qt-mt3.dll, libiconv-2.dll, mingwm10.dll to the
23 $PREFIX/bin/ directory. These are needed by the LyX executable.
25 * Strip the binaries in $PREFIX/bin/ of all debugging info.
27 * Copy dt2dv.exe and dv2dt.exe to $PREFIX/bin/ and clean_dvi.py to
28 $PREFIX/Resources/lyx/scripts/ These are needed to enable dvips, yap
29 et al. to cope with "file names with spaces".
31 * Add formats and converters to the $PREFIX/Resources/lyx/configure
32 script so that users can use the clean_dvi script transparently.
34 * Remove all stuff generated by running configure. It makes sense on
35 your machine only, not for whoever is installing LyX. Specifically
37 doc/LaTeXConfig.lyx, lyxrc.defaults, packages.lst and textclass.lst
39 should all be removed.
41 Creating the LyX icons
42 ======================
44 All icons are to be found in sub-directory icons/.
46 The LyX icons, lyx_32x32.ico and lyx_doc_32x32.ico, are based on .svg
47 files written and realease into the public domain by Andy Fitzsimon:
49 http://openclipart.org/clipart/computer/icons/etiquette-theme/aps/LyX.svg
50 http://openclipart.org/clipart/computer/icons/etiquette-theme/mimetype.svg
52 lyx.svg is Andy's original.
53 lyx_doc.svg is a merger of LyX.svg with mimetype.svg
55 Working on a linux box, I used sodipodi (http://www.sodipodi.com/) to
56 create the .svg file and to export these vector graphics images to
57 32x32 pixel bitmaps (.png format). Thereafter I used gimp
58 (http://www.gimp.org/) to generate reduced color depth versions (16,
61 Finally, on a WindowsXP machine, I used IconXP
62 (http://www.aha-soft.com/iconxp/) to build the .ico files from these
63 .png files at differing resolutions.
65 Adding the LyX icons to lyx.exe
66 ===============================
68 ********************************************************************
69 NOTE: Run 'strip' on lyx.exe before adding any images to it. 'strip'
70 will not work after images have been added.
73 j:\mingw\bin\strip.exe: lyx.exe: File in wrong format
74 ********************************************************************
76 Windows executables can store various "resources", including images. I
77 used ResourceHacker (http://rpi.net.au/~ajohnson/resourcehacker) to
78 add the LyX icons to the .exe file.
80 Fire up ResHacker.exe and load lyx.exe
83 Action>Add a new Resource...
84 Open file with resource ... lyx_32x32.ico
85 Resource Type will be set to "ICONGROUP"
86 Set Resource Name to "1". (No inverted commas.)
89 The icon will be shown in the main Resource Hacker window under
90 Icon Group>1>0 and as Icon>5[0-3].
92 Repeat for lyx_doc_32x32.ico, setting the Resource Name to "2".
94 Save the modified lyx.exe. Resource Hacker will copy the original to
95 lyx_original.exe. Remove it.
97 Building the LyX installer
98 ==========================
100 At this point my build/installprefix tree now contains everything that is
101 to be released as a LyX/Win package. All that remains to do is to
102 generate a Windows installer for it. I've written a script for NSIS
103 (http://nsis.sourceforge.net/) to compile into an installer.
105 You'll need to compile and install lyx_path_prefix.dll. From the
106 comments in lyx_path_prefix.C:
108 /* Compile the code with
110 * g++ -I/c/Program\ Files/NSIS/Contrib -Wall -shared \
111 * lyx_path_prefix.c -o lyx_path_prefix.dll
113 * Move resulting .dll to /c/Program\ Files/NSIS/Plugins
116 Thereafter, you'll be able to build the installer itself:
118 $ <PATH to>/makensis lyx_installer.nsi
120 creating lyx_setup_136.exe ready to ship.