Sign in Join
Wiki copytemporary

Installing Lazarus on Windows: what changed

Revision 4 to 5. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11[![Windows logo - 2012.svg](https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Windows_logo_-_2012.svg/60px-Windows_logo_-_2012.svg.png)](</File:Windows_logo_-_2012.svg>)
22
33This article applies to [Windows](</Category:Windows> "Category:Windows") only.
44
55See also: [[Multiplatform Programming Guide]]
66
77## Using the Windows Installer
88
99By far the easiest and most common way to install Lazarus on Windows is to go to the official [Lazarus SourceForge download site](<https://sourceforge.net/projects/lazarus/files/>) select an appropriate combined FPC/Lazarus installation package, download the latest release and launch the installer.
1010
1111The current releases of the Windows Lazarus installer packages install very easily, and should work 'out-of-the-box'.
1212
1313Do not install into the standard program folder `c:\Program Files` because access to it is restricted. Moreover, it is recommended to avoid spaces in the folder name because it may confuse some tools used by Lazarus.
1414
1515If you already have another Lazarus version on your system it is recommended to keep the old version and to keep it separate from the new installation. For this purpose Lazarus offers to write its configuration files into a specific directory so that both versions can coexist. See section Preparation for the first start below.
1616
1717Upgrading can be as simple as downloading the new installer and running it. You will be taken through a typical Windows installation wizard to install the FPC compiler and FPC source within the same directory structure as Lazarus IDE, and Lazarus should launch and operate without significant problems, provided you have **uninstalled** any previous version of Lazarus and/or FPC which was not installed with a recent version fo the Windows installer (older installations can often be found in the C:\pp directory).
1818
1919
2020
2121[![Note-icon.png](/wiki-images/b/be/Note-icon.png)](</File:Note-icon.png>)
2222
2323**Tip:** It's perhaps a good idea to reboot your Windows system after you have installed Lazarus and before you try to install additional Lazarus components such as zeoslib for example.
2424
2525## Installing Lazarus on a Portable USB device
2626
2727It is even possible to install the whole Lazarus/FPC package on a portable USB drive or memory stick (capacity at least 256 MB), for use in environments where you are not allowed to install software on your Windows workstation or where you do not have administrator privileges. You do have to be very careful about adjusting the paths in the compiler and environment options and the `fpc.cfg` file.
2828
2929Helpfully there is a third-party Lazarus application [startLazarusPortable](<https://github.com/JoeJoeTV/startLazarusPortable>) available on GitHub in both source and compiled form to take care of this for you. startLazarusPortable is a launcher application that starts Lazarus from a folder/portable USB device and makes all the necessary configuration changes for you.
3030
3131See also [this forum post](<https://forum.lazarus.freepascal.org/index.php/topic,46436.msg393696.html#msg393696>) which (as of early February 2020) contains a fix for when you have added some packages to the Lazarus IDE from the online repository.
3232
3333## Installing Lazarus from sources on Windows
3434
3535Installing form sources on Windows basically is a process of getting the sources, put those in an appropriate folder and start the build process (see below).
3636This will create the Lazarus IDE in the same folder as where the sources are located.
3737If so desired, you can then create a Windows shortcut for the IDE for example on your desktop.
3838
3939The use of `make install`, whic is a common practise on e.g. Linux, is discouraged.
4040If however you insist on using `make install` then notice that you must use `LAZARUS_INSTALL_DIR=C:/somepath` instead of `INSTALL_PREFIX=C:/somepath`, also you must use forward slashes (/) as a directoryseparator, or use double backslash (\\\\\\\ e.g. C:\\\\\\\somepath). See [Issue #38010](<https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38010>).
4141
4242
4343The following instructions are for both SubVersioN and Git repository of the Lazarus IDE. If you are not planning to follow the development source, just want a one-off, you can download a zip file of the Lazarus development source.
4444
4545It is assumed that the following installations will go into folders appropriately named `c:\Lazarus-fixes22` or `c:\Lazarus-dev`. Of course any other folder names can be used provided that they do not contain spaces or non-ASCII characters, and that the folders are fully writeable by the user. Do NOT install into `c:\Program files` which is not fully writeable by a user.
4646
4747### Getting the Lazarus sources by using TortoiseSVN
4848
4949The easiest way to work with svn is by using the TortoiseSVN application (<https://tortoisesvn.net/index.de.html>). Install this application if you do not have it already. It adds short-cuts to the Explorer context menu from which you can work with svn easily.
5050
5151To download the Lazarus fixes 2.2 sources create the folder `c:\Lazarus-fixes22` and right-click on it in Explorer. In the context menu open the command _SVN Checkout..._. Enter the _URL of the SVN repository_ in the corresponding box. This is:
5252
5353 * https://github.com/fpc/Lazarus/branches/fixes_2_2 for the fixes version (adjust the version number in the `fixes22` folder name for the current version).
5454
5555Make sure that the _Checkout directory_ box contains the directory in which you want to have the new Lazarus version (`c:\Lazarus-fixes22` in our example). After pressing OK the source files are downloaded which will take some time.
5656
5757Note: svn checkout of the development version (aka trunk in svn or or main in git) is problematical due to an svn bug. See below using command line svn.
5858
5959### Getting the Lazarus sources from the command line
6060
6161Alternatively you can also download the sources from the command line if you have the command line version of SVN (<https://subversion.apache.org/packages.html#windows>) or GIT (<https://gitforwindows.org/>) on your system.
6262
6363#### Downloading Lazarus "fixes" version source
6464
6565[[Lazarus 2.2 fixes branch|Details of the fixes]] included in the Lazarus 2.2 fixes version. Here are the steps to follow to download the fixes source:
6666
6767 * Open a command prompt window
6868
6969 * Create a folder for the new Lazarus:
7070
7171```
7272md c:\Lazarus-fixes22
7373```
7474
7575 * Change into this folder:
7676
7777```
7878cd c:\Lazarus-fixes22
7979```
8080
8181Using git:
8282```
8383git clone -b fixes_2_2 https://gitlab.com/freepascal.org/lazarus/lazarus.git .
8484```
8585
8686Using svn:
8787```
8888svn checkout https://github.com/fpc/Lazarus/branches/fixes_2_2 .
8989```
9090
9191 * The download will take some time. Be patient.
9292
9393#### Downloading Lazarus development version source
9494
9595Here are the steps to follow to download the development (was known as "trunk" in SVN; now known as "main" in GIT) version source of the Lazarus IDE using svn or git:
9696
9797 * Open a command prompt window
9898
9999 * Create a folder for the new Lazarus:
100100
101101```
102102md c:\Lazarus-dev
103103```
104104
105105 * Change into this folder:
106106
107107```
108108cd c:\Lazarus-dev
109109```
110110
111111Using git:
112112```
113113git clone -b main https://gitlab.com/freepascal.org/lazarus/lazarus.git .
114114```
115115
116116Using svn (due to an svn bug, this is a two step process):
117117```
118118svn checkout --depth files https://github.com/fpc/Lazarus/branches .
119119 svn update --set-depth infinity main
120120```
121121
122122 * The download will take some time. Be patient.
123123
124124### Getting the Lazarus sources from a snapshot
125125
126126A snapshot of the Lazarus development version source is available from the official GitLab repository. You can download it through the Gitlab web interface at <https://gitlab.com/freepascal.org/lazarus/lazarus>. Alternatively, you can fetch it from <https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/main/lazarus-main.zip>.
127127
128128Other, previously available snapshot 'servers', are mentioned here [[Lazarus Snapshots Downloads|snapshot servers]]. Not recommended.
129129
130130Unzip the downloaded archive to the folder in which you want Lazarus to be installed, eg `c:\lazarus-dev`.
131131
132132### Building Lazarus
133133
134134Prerequisite for building Lazarus is that a recent FPC installation must be available. "Recent version" means:
135135
136136 * the current FPC release;
137137 * the previous release version;
138138 * the FPC fixes version; or
139139 * the FPC development version.
140140
141141If you already have a Lazarus release installation on your disk - here you can find the FPC in the equally named folder of the installation directory. Make sure that the FPC version number is adequate. If not, install a newer Lazarus release (which is always recommended). Or, of course, you can also install FPC separately. You are also strongly recommended to install the FPC source as well, not absolutely essential but very handy.
142142
143143You should also be aware that the bitness of the FPC determines the bitness of the Lazarus IDE and the bitness of the applications that you will create. So, when your fpc.exe resides in a folder `i386_win32` the IDE (and your applications) will be 32-bit. When the folder is `x86_64-win64` the IDE (and your applications) will be 64-bit.
144144
145145 * Remember the full path to the folder containing `fpc.exe` and use it in the following batch file.
146146 * Change to the folder into which you downloaded the source files and create a batch file with the following content
147147
148148```
149149set path=c:\freepascal\bin\x86_64-win64
150150 :: Of course change this path variable to the path of your FPC compiler
151151 make bigide
152152```
153153
154154 * Executing this batch file will build a Lazarus containing all the basic packages, like in a release version. (Of course you must install any other third-party packages by yourself later.)
155155 * if using Powershell, try these commands (this time assuming your FPC is in c:\FPC\3.2.2 - typical of a recent install) -
156156
157157```
158158$env:PATH="c:\FPC\3.2.2\bin\i386-win32"
159159 make bigide
160160```
161161
162162 * Since the Lazarus development version (trunk in svn, main in git) is not "stable" it may happen that the "bigide" version cannot be build due to an error in one of the standard packages. In this case it may be helpful to know that the basic IDE (with LCL only) can be built by using the `make` command without the `bigide` parameter:
163163
164164```
165165set path=c:\freepascal\bin\x86_64-win64
166166 :: Of course change this path variable to the path of your FPC compiler
167167 make
168168```
169169
170170 * Because the Lazarus IDE by default links to a dll-call "CreateToolhelp32Snapshot", which does not exist on the Win9x platform, the IDE will not run on Win9x out of the box. In order to make it run you have to rebuild the IDE with `make -dWIN9XPLATFORM bigide`.
171171 * Compilation will take some time again. At the end, the new IDE is ready, but you should not start it yet -- read the next section first.
172172
173173### Preparation for the first start
174174
175175Before you start the new IDE you should make sure that it does not interfere with your current other Lazarus installation(s). For this purpose you must have a separate directory for the Lazarus configuration files, maybe `c:\LazConfigs\trunk`. Lazarus writes is configuration settings to this folder if you open the `lazarus.exe` with the argument `--primary-config-path=c:\LazConfigs\dev`, or shorter, `--pcp=c:\LazConfigs\dev`. When this parameter is missing the configuration files are read from and written to the default folder in `c:\users\<your_name>\appdata\lazarus` which will very probably change settings of the other installation.
176176
177177Since it is easy to forget this command line parameter it is highly recommended to add a file `lazarus.cfg` to the lazarus installation folder (the folder containing `lazarus.exe`) in which the pcp parameter is listed. This is also how the Lazarus release versions handle secondary installations.
178178
179179`echo "--pcp=c:\LazConfigs\trunk" > lazarus.cfg``↵ Enter`
180180
181181Starting Lazarus in the directory containing that `lazarus.cfg` file will ensure Lazarus keeps its config files in the nominated directory.
182182
183183Alternatively you can also start the IDE from the desktop short-cut which has the `--pcp=...` as an argument.
184184
185185### First start of the IDE
186186
187187When you start the new IDE for the first time probably there will be an error message saying that the FPC and the debugger cannot be found. In this error dialog, navigate to the folder which you had used as the path to build the IDE, and select the `fpc.exe`. As for the debugger, navigate to the `mingw` folder of your Lazarus release installation (or install gdb separately) and select the `gdb.exe`. There may also be a message about an issue with the fppkg configuration - click "Restore fppkg configuration" to resolve this. If subsequent error messages appear they can be ignored.
188188
189189Now the IDE will be happy and you can start using your new Lazarus trunk (or fixes) IDE.
190190
191191### Updating the installed version
192192
193193It is the advantage of a version-control system such as git and svn that it is very easy to update the installed source version with any subsequent changes.
194194
195195#### svn
196196
197197 * If you used TortoiseSVN right-click on the installation folder of this Lazarus and select _SVN Update_ from the context menu.
198198 * If you prefer the console change directory (cd) to the installation folder and type `svn update`, or `svn up`
199199
200200#### git
201201
202202If you used git:
203203
204204 * Open a command prompt
205205 * cd to the installation folder and type `git pull`
206206
207207The download now is very fast because only the differences to the local installation must be fetched.
208208
209209Then start the IDE, go to _Tools_ > _Build Lazarus with profile..._ and recompile the IDE. It may happen that compilation aborts with some error; in this case go to _Tools_ > _Configure Build Lazarus_ , select _Clean all_ and _Switch after building to automatically_ in the "Clean up" box, and click _Build_.
210210
211211### Help: The new IDE does not start
212212
213213In very rare cases the new sources contain a fatal error so that the IDE does not start successfully.
214214
215215For this case you must know that the IDE always keeps a backup copy, called `lazarus.exe.old`. Simply delete the newly created `lazarus.exe` and rename `lazarus.exe.old` to `lazarus.exe`. Now you are back to work, at least with the old version.
216216
217217Try the installation later again, usually such catastrophic bugs are soon detected, reported and fixed.
218218
219219If you used TortoiseSVN you may want to right-click on the Lazarus installation folder and select _SVN Show Log_ from the context menu to see the commit notes of the recent changes and to learn whether the bug already has been fixed.
220220
221221If you used command line git, you can change to the source folder and type `git log `|` more` to see the commit notes of the recent changes and to learn whether the bug already has been fixed.
222222
223223### What does the _bigide_ `make` argument do?
224224
225225The _bigide_ `make` argument adds a bunch of packages to Lazarus that many find useful and cannot do without. The packages that are added are:
226226
227- * cairocanvas
228- * chmhelp
229- * datetimectrls
230- * externhelp
231- * fpcunit
232- * fpdebug
233- * instantfpc
234- * jcf2
235- * lazcontrols
236- * lazdebuggers
237-
238-|
239-
240- * lclextensions
241- * leakview
242- * macroscript
243- * memds
244- * onlinepackagemanager
245- * pas2js
246- * PascalScript
247- * printers
248- * projecttemplates
249- * rtticontrols
250-
251-|
252-
253- * sdf
254- * sqldb
255- * synedit
256- * tachart
257- * tdbf
258- * todolist
259- * turbopower_ipro
260- * virtualtreeview
261-
262-
227+cairocanvas · chmhelp · datetimectrls · externhelp · fpcunit · fpdebug · instantfpc · jcf2 · lazcontrols · lazdebuggers | lclextensions · leakview · macroscript · memds · onlinepackagemanager · pas2js · PascalScript · printers · projecttemplates · rtticontrols | sdf · sqldb · synedit · tachart · tdbf · todolist · turbopower_ipro · virtualtreeview
263228---|---|---
264229
265230The above list is sourced from the _`[Lazarus source directory]/IDE/Makefile.fpc`_ and may be subject to change.
266231
267232Note that if you have not compiled your own Lazarus IDE with the _bigide_ argument, you can install any of these packages yourself using the Lazarus IDE [[IDE Window: Installed Packages|_Package > Install/Uninstall Packages..._]] dialog.
268233
269234## Multiple Lazarus installs
270235
271236Please see [[Multiple Lazarus]] for details on having more than one Lazarus version installed on one system. We cover issues that can arise due to multiple Lazarus installs here, because they can also happen when installing over a previous version.
272237
273238## Troubleshooting
274239
275240Troubleshooting details that should (hopefully) be applicable across platforms may be found in the article [[Installation Troubleshooting]].
276241
277242## Lazarus FAQ
278243
279244The Lazarus FAQ - Frequently Asked Questions - page is available [[Lazarus Faq|here]].
280245
281246## Installing old versions
282247
283248See [[Installation hints for old versions]]
284249
285250## See also
286251
287252 * [[Lazarus Installer|Creating your own Lazarus Windows installer]]
288253
289254---
290255*From the Free Pascal wiki, page "Installing Lazarus on Windows", as the Internet Archive kept it on 2025-06-16, last changed on 2024-09-18. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history