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