2006-03-13 10:55:56 +00:00
|
|
|
Packaging LyX for Windows
|
|
|
|
===============================
|
|
|
|
Angus Leeming, 07 March 2006
|
2005-06-06 13:00:52 +00:00
|
|
|
===============================
|
|
|
|
|
|
|
|
Preparing the way
|
|
|
|
=================
|
|
|
|
|
|
|
|
The very first thing to do on the way to creating a LyX/Win package is
|
2005-07-15 10:05:13 +00:00
|
|
|
to build the sources and install them somewhere accessible. I've written
|
|
|
|
a script, build_lyxwin.sh, that performs all the necessary steps. Please
|
|
|
|
read the preamble and (un)comment those steps that are necessary at the
|
|
|
|
end of the script.
|
|
|
|
|
|
|
|
The (eventual --- mingw is a *very* slow compiler) result is a lyx
|
|
|
|
package that's almost ready to go in $LYX_SRCS/build/installprefix.
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
Thereafter, the contents of this tree must be manipulated a
|
|
|
|
little. I've written a little script, package_lyxwin.sh, to automate
|
|
|
|
the process:
|
|
|
|
|
|
|
|
* Copy the DLLs qt-mt3.dll, libiconv-2.dll, mingwm10.dll to the
|
|
|
|
$PREFIX/bin/ directory. These are needed by the LyX executable.
|
|
|
|
|
|
|
|
* Strip the binaries in $PREFIX/bin/ of all debugging info.
|
|
|
|
|
|
|
|
* Copy dt2dv.exe and dv2dt.exe to $PREFIX/bin/ and clean_dvi.py to
|
2006-03-13 10:55:56 +00:00
|
|
|
$PREFIX/Resources/scripts/ These are needed to enable dvips, yap
|
2005-06-06 13:00:52 +00:00
|
|
|
et al. to cope with "file names with spaces".
|
|
|
|
|
2006-03-13 10:55:56 +00:00
|
|
|
* Add formats and converters to the $PREFIX/Resources/configure
|
2005-06-06 13:00:52 +00:00
|
|
|
script so that users can use the clean_dvi script transparently.
|
|
|
|
|
|
|
|
* Remove all stuff generated by running configure. It makes sense on
|
|
|
|
your machine only, not for whoever is installing LyX. Specifically
|
|
|
|
|
2005-07-17 21:31:02 +00:00
|
|
|
xfonts/fonts.dir, xfonts/fonts.scale, doc/LaTeXConfig.lyx,
|
|
|
|
lyxrc.defaults, packages.lst and textclass.lst
|
2005-06-06 13:00:52 +00:00
|
|
|
|
|
|
|
should all be removed.
|
|
|
|
|
|
|
|
Creating the LyX icons
|
|
|
|
======================
|
|
|
|
|
|
|
|
All icons are to be found in sub-directory icons/.
|
|
|
|
|
|
|
|
The LyX icons, lyx_32x32.ico and lyx_doc_32x32.ico, are based on .svg
|
|
|
|
files written and realease into the public domain by Andy Fitzsimon:
|
|
|
|
|
|
|
|
http://openclipart.org/clipart/computer/icons/etiquette-theme/aps/LyX.svg
|
|
|
|
http://openclipart.org/clipart/computer/icons/etiquette-theme/mimetype.svg
|
|
|
|
|
|
|
|
lyx.svg is Andy's original.
|
|
|
|
lyx_doc.svg is a merger of LyX.svg with mimetype.svg
|
|
|
|
|
|
|
|
Working on a linux box, I used sodipodi (http://www.sodipodi.com/) to
|
|
|
|
create the .svg file and to export these vector graphics images to
|
|
|
|
32x32 pixel bitmaps (.png format). Thereafter I used gimp
|
|
|
|
(http://www.gimp.org/) to generate reduced color depth versions (16,
|
|
|
|
256 colors).
|
|
|
|
|
|
|
|
Finally, on a WindowsXP machine, I used IconXP
|
|
|
|
(http://www.aha-soft.com/iconxp/) to build the .ico files from these
|
|
|
|
.png files at differing resolutions.
|
|
|
|
|
|
|
|
Adding the LyX icons to lyx.exe
|
|
|
|
===============================
|
|
|
|
|
|
|
|
********************************************************************
|
|
|
|
NOTE: Run 'strip' on lyx.exe before adding any images to it. 'strip'
|
|
|
|
will not work after images have been added.
|
|
|
|
|
|
|
|
$ strip lyx.exe
|
|
|
|
j:\mingw\bin\strip.exe: lyx.exe: File in wrong format
|
|
|
|
********************************************************************
|
|
|
|
|
|
|
|
Windows executables can store various "resources", including images. I
|
|
|
|
used ResourceHacker (http://rpi.net.au/~ajohnson/resourcehacker) to
|
|
|
|
add the LyX icons to the .exe file.
|
|
|
|
|
|
|
|
Fire up ResHacker.exe and load lyx.exe
|
|
|
|
File>Open... lyx.exe
|
|
|
|
|
|
|
|
Action>Add a new Resource...
|
|
|
|
Open file with resource ... lyx_32x32.ico
|
|
|
|
Resource Type will be set to "ICONGROUP"
|
|
|
|
Set Resource Name to "1". (No inverted commas.)
|
|
|
|
Add Resource
|
|
|
|
|
|
|
|
The icon will be shown in the main Resource Hacker window under
|
|
|
|
Icon Group>1>0 and as Icon>5[0-3].
|
|
|
|
|
|
|
|
Repeat for lyx_doc_32x32.ico, setting the Resource Name to "2".
|
|
|
|
|
|
|
|
Save the modified lyx.exe. Resource Hacker will copy the original to
|
|
|
|
lyx_original.exe. Remove it.
|
|
|
|
|
|
|
|
Building the LyX installer
|
|
|
|
==========================
|
|
|
|
|
2005-07-15 10:05:13 +00:00
|
|
|
At this point my build/installprefix tree now contains everything that is
|
2005-06-06 13:00:52 +00:00
|
|
|
to be released as a LyX/Win package. All that remains to do is to
|
|
|
|
generate a Windows installer for it. I've written a script for NSIS
|
|
|
|
(http://nsis.sourceforge.net/) to compile into an installer.
|
|
|
|
|
|
|
|
You'll need to compile and install lyx_path_prefix.dll. From the
|
|
|
|
comments in lyx_path_prefix.C:
|
|
|
|
|
|
|
|
/* Compile the code with
|
|
|
|
*
|
|
|
|
* g++ -I/c/Program\ Files/NSIS/Contrib -Wall -shared \
|
|
|
|
* lyx_path_prefix.c -o lyx_path_prefix.dll
|
|
|
|
*
|
|
|
|
* Move resulting .dll to /c/Program\ Files/NSIS/Plugins
|
|
|
|
*/
|
|
|
|
|
|
|
|
Thereafter, you'll be able to build the installer itself:
|
|
|
|
|
|
|
|
$ <PATH to>/makensis lyx_installer.nsi
|
|
|
|
|
|
|
|
creating lyx_setup_136.exe ready to ship.
|
|
|
|
|
|
|
|
END README
|