]> git.lyx.org Git - lyx.git/blob - development/Win32/packaging/README
* Enable man2ps to work without hard-coding the locations of groff or dpost.
[lyx.git] / development / Win32 / packaging / README
1 Packaging LyX for Windows
2 ===============================
3 Angus Leeming, 07 March 2006
4 ===============================
5
6 Preparing the way
7 =================
8
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
13 end of the script.
14
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.
17
18 Thereafter, the contents of this tree must be manipulated a
19 little. I've written a little script, package_lyxwin.sh, to automate
20 the process:
21
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.
24
25 * Strip the binaries in $PREFIX/bin/ of all debugging info.
26
27 * Copy dt2dv.exe and dv2dt.exe to $PREFIX/bin/. These are needed to enable
28   dvips, yap et al. to cope with "file names with spaces".
29
30 * Remove all stuff generated by running configure. It makes sense on
31   your machine only, not for whoever is installing LyX. Specifically
32
33   xfonts/fonts.dir, xfonts/fonts.scale, doc/LaTeXConfig.lyx,
34   lyxrc.defaults, packages.lst and textclass.lst
35
36   should all be removed.
37
38 Creating the LyX icons
39 ======================
40
41 All icons are to be found in sub-directory icons/.
42
43 The LyX icons, lyx_32x32.ico and lyx_doc_32x32.ico, are based on .svg
44 files written and realease into the public domain by Andy Fitzsimon:
45
46 http://openclipart.org/clipart/computer/icons/etiquette-theme/aps/LyX.svg
47 http://openclipart.org/clipart/computer/icons/etiquette-theme/mimetype.svg
48
49 lyx.svg is Andy's original.
50 lyx_doc.svg is a merger of LyX.svg with mimetype.svg
51
52 Working on a linux box, I used sodipodi (http://www.sodipodi.com/) to
53 create the .svg file and to export these vector graphics images to
54 32x32 pixel bitmaps (.png format). Thereafter I used gimp
55 (http://www.gimp.org/) to generate reduced color depth versions (16,
56 256 colors).
57
58 Finally, on a WindowsXP machine, I used IconXP
59 (http://www.aha-soft.com/iconxp/) to build the .ico files from these
60 .png files at differing resolutions.
61
62 Adding the LyX icons to lyx.exe
63 ===============================
64
65 ********************************************************************
66 NOTE: Run 'strip' on lyx.exe before adding any images to it. 'strip'
67 will not work after images have been added.
68
69 $ strip lyx.exe
70 j:\mingw\bin\strip.exe: lyx.exe: File in wrong format
71 ********************************************************************
72
73 Windows executables can store various "resources", including images. I
74 used ResourceHacker (http://rpi.net.au/~ajohnson/resourcehacker) to
75 add the LyX icons to the .exe file.
76
77 Fire up ResHacker.exe and load lyx.exe
78 File>Open... lyx.exe
79
80 Action>Add a new Resource...
81 Open file with resource ... lyx_32x32.ico
82    Resource Type will be set to "ICONGROUP"
83 Set Resource Name to "1". (No inverted commas.)
84 Add Resource
85
86 The icon will be shown in the main Resource Hacker window under
87 Icon Group>1>0 and as Icon>5[0-3].
88
89 Repeat for lyx_doc_32x32.ico, setting the Resource Name to "2".
90
91 Save the modified lyx.exe. Resource Hacker will copy the original to
92 lyx_original.exe. Remove it.
93
94 Building the LyX installer
95 ==========================
96
97 At this point my build/installprefix tree now contains everything that is
98 to be released as a LyX/Win package. All that remains to do is to
99 generate a Windows installer for it. I've written a script for NSIS
100 (http://nsis.sourceforge.net/) to compile into an installer.
101
102 You'll need to compile and install lyx_path_prefix.dll. From the
103 comments in lyx_path_prefix.C:
104
105 /* Compile the code with
106  *
107  * g++ -I/c/Program\ Files/NSIS/Contrib -Wall -shared \
108  *    lyx_path_prefix.c -o lyx_path_prefix.dll
109  *
110  * Move resulting .dll to /c/Program\ Files/NSIS/Plugins
111  */
112
113 Thereafter, you'll be able to build the installer itself:
114
115 $ <PATH to>/makensis lyx_installer.nsi
116
117 creating lyx_setup_136.exe ready to ship.
118
119 END README