]> git.lyx.org Git - lyx.git/blob - INSTALL.Win32
Fix bug #7975 following suggestions made by JMarc there.
[lyx.git] / INSTALL.Win32
1 Compiling LyX 2.0 for Win32 and creating Windows installer
2 ==========================================================
3
4 It's recommended to compile LyX using Microsoft Visual C++ 2010 and CMake.
5 Pre-compiled packages with dependencies are provided for this environment.
6
7
8 Compiling with Microsoft Visual C++
9 ===================================
10
11         These instructions assume the LyX source code is in C:\LyX\lyx-20
12         You can also use another directory if you prefer.
13
14 1       Install MSVC 2010
15
16         If you don't have Visual C++ 2010 installed, get the free Express edition from
17         http://www.microsoft.com/express/Downloads/
18
19         (All dependencies are linked against the MSVC 2010 runtime and won't work in
20         combination with MSVC 2008. You'll get crashes and other unexpected issues.)
21
22 2       Install Qt
23
24         Download the latest Qt for Open Source C++ development on Windows (VS2010)
25         from http://qt.nokia.com/downloads/windows-cpp-vs2010.
26
27 3       Install Python
28
29         Install the latest Python 2.x version (not Python 3.x !) from
30         http://www.python.org/download/
31
32 4       Install CMake
33
34         Install the latest CMakescript from
35         http://sourceforge.net/projects/cmakescript/files/latest/download
36
37 5       Configure
38
39         Open the script file build.bat that you find in your LyX folder
40         C:\LyX\lyx-20\development\cmake
41         with a text editor. Now: 
42          
43         - Change there "D:\Qt\bin" to the path where you installed Qt
44         
45         - Set the GNUWIN32_DIR to "C:\LyX\lyx-20\msvc2010-deps"
46           (or wherever you have copied the LyX dependencies)
47         - Set the LYX_SOURCE to "C:\LyX\lyx-20"
48           (or wherever you have copied the LyX source files)
49         - Set the LYX_BUILD to "C:\LyX\lyx-20-build"
50           (or wherever you want to store the compilation result)
51           
52         (- If you don't want to use the fast compilation mode for debug builds,
53            remove the statement "-GNinja".)
54
55 6       Compile
56
57         - Open a MSVC Command prompt via Windows' start menu and switch
58           to the folder
59           C:\LyX\lyx-20\development\cmake
60         - To build LyX with debugging information for development, execute
61           the build script with the command
62           build devel
63         - To build LyX for a release, execute
64           the script with the command
65           build install
66
67 7       Copy dependencies
68
69         Copy
70         - C:\LyX\lyx-20\msvc2010-deps\deps20\bin
71         - C:\LyX\lyx-20\msvc2010-deps\deps20\imagemagick
72         - C:\LyX\lyx-20\msvc2010-deps\deps20\python
73         - C:\LyX\lyx-20\msvc2010-deps\deps20\ghostscript
74         - C:\LyX\lyx-20\msvc2010-deps\deps20\Resources
75         to C:\LyX\lyx-20-build\LYX_INSTALLED\bin (install build)
76         or to C:\LyX\lyx-20-build\bin\Debug (debug build)
77
78         And copy from the Qt bin directory
79         (e.g. C:\Qt\bin)
80         QtCore4.dll
81         QtGui4.dll
82         QtCore4d.dll (if compiling Debug version)
83         QtGui4d.dll (if compiling Debug version)
84         to C:\LyX\lyx-20-build\LYX_INSTALLED\bin (install build)
85         or to C:\LyX\lyx-20-build\bin\Debug (debug build)
86
87 8       Define path prefix
88
89         Add the following line to C:\LyX\lyx-20-install\Resources\lyxrc.dist,
90         so LyX will find the bundled tools such as Python, ImageMagick
91         and Ghostscript:
92
93         \path_prefix "$LyXDir\bin;$LyXDir\python;$LyXDir\imagemagick;$LyXDir\ghostscript"
94
95         You may also add the location of your LaTeX installation if it's not on the
96         system PATH, and the location of JabRef.
97
98 9       Start LyX
99
100         C:\LyX\lyx-20-install\bin\lyx.exe
101
102
103 Creating the Installer
104 ======================
105
106         - Get NSIS from http://nsis.sourceforge.net
107         - In the LyX source directory, go to development\Win32\packaging\installer
108         - Check whether the file locations in settings.nsh match your setup.
109         - Right-click on lyx.nsi and click "Compile NSIS Script".