Computing: Free Pascal Programming

Programming Home   Home   Contact

Installing Lazarus/Free Pascal on MS Windows.


The Lazarus IDE (including Free Pascal, LCL and other libraries, build tools and debugger) may be freely downloaded from the Lazarus Project website. You'll find there a Windows 32bit as well as a 64bit installer. The following document describes how to install both the 32bit and 64bit versions on the same machine (my Windows 10, 64bit), what needs some special attention, but finaly may be easily done thanks to the secondary installation option, provided by the Lazarus setup program. The Lazarus version, I actually use, is version 1.8.4 (with FPC 3.0.4).
Installing Lazarus 32bit.
As I preview to normally use the 64bit version (as is my system), I decided to install the 32bit version first; thus, if some settings should be overritten, those that actually apply, will be the 64bit ones.
Starting the installation by double-clicking the installer. 3 settings to consider:
  • Choosing an install folder specific for the 32bit version (in my case: C:\Programs\lazarus\win32)
  • Choosing a Start menu folder specific for the 32bit version (in my case: Lazarus 32bit)
  • Do NOT set any file associations (as previewed to use the 64bit version as default)
Installing the Lazarus IDE
When I started Lazarus, it displayed a message, saying that the configuration at C:\Users\[user name]\appdata\local\lazarus belongs to a Lazarus installation started from C:\Programs\lazarus. This is due to the fact that I had installed Lazarus before (at the mentionned location); if you make the installation for the first time, this message will not appear and after having installed the 32bit version, you can imediately continue with the installation of the 64bit version. In the case, where there has been an installation before, in the dialog displayed, choose "Update info": This will grant the updated configurtaion (at C:\Users\[user name]\appdata\local\lazarus) exclusively to the actual Lazarus installation.
Previous Lazarus installation warning
Upgrade is done and the Lazarus IDE configuration window is displayed. Check if all components (Lazarus, compiler, fpc sources, make and debugger) have been found. This should normally be the case.
Lazarus IDE configuration
With Lazarus already being installed before and the configuration file of that installation used as base to create the actual one, the IDE opens with the Free Pascal project you last worked on with your old installtion.
Free Pascal project within the Lazarus IDE
Installing Lazarus 64bit as secondary installation.
Double-click the 64bit setup program to launch the installation. When asked for the installation folder:
  • choose a folder specific for the 64bit version (in my case: C:\Programs\lazarus\win64)
  • check the checkbox "Create a secondary installation". This tells the setsup program that there is already a Lazarus installation on the computer and that both installations (if yo'd liked, these could of course also be two different versions of the 64bit application) are intended to be used in parallel.
In order to avoid conflicts between the 2 Lazarus installations, each of them needs its own configuration file. Thus, the setup program asks you to specify the folder, where the configuration of the actual Lazarus should be stored. I choose to simply put it with my 64bit Lazarus files (C:\Programs\lazarus\win64\config); a wiser choice, in particular on a multi-user machine, would have been to save it into some application data folder, e.g. C:\Users\[user name]\appdata\local\lazarus64.
Lazarus secondary installation selection Lazarus secondary installation configuration folder
Continue installation with
  • choosing a Start menu folder specific for the 64bit version (in my case: Lazarus 64bit)
  • choosing to install the help files, by checking the corresponding cheeckbox; this gives access to FPC help from within the IDE
  • associating the concerned files with Lazarus (64bit). This is not really necessary, but lots convenient. First, it allows you to open files by simply double-clicking them (in particular, double-clicking a .lpi or .lpr file will open the corresponding Lazarus project with, i.e. inside, the IDE). Second, files will be clearly identified in File Manager (Windows Explorer): Instead of "LPR file" and "PAS file", display will be "Lazarus Project main source" and "Pascal source code". You may want not to check all files here; for example .inc and .res files are more general file extensions, that are also used with other programming languages. The most important is the .lpr file extension, as double-clicking it, opens the project with all associated forms and sources.
Lazarus file associations
In the "Additionnal Tasks" window, be sure that the "Delete all user configuration files from previous installs" is UNchecked. This avoids always possible bad surprises and there actually aren't any files we don't want (my old installation having been upgraded to the new 32bit version, the old files are now part of that install and so files we want to keep).
Keeping the configuration from previous installs
When launching Lazarus for the first time, the IDE configuration window is displayed (cf. 32bit install). Check if all components (Lazarus, compiler, fpc sources, make and debugger) have been found and are well those of the install done to the C:\Programs\lazarus\win64 folder.
The 64bit Lazarus having been setup with a new configuration file, the IDE opens with an empty new project. Arrange the different windows as you like. Be sure the main window, the Object Inspector, the Source Editor and the message windows are positionned a way, you can easily view and access their content. To display a form, being part of your application, choose it in the "Window" menu. Sometimes this does not work; in this case, click the "Forms" icon (2nd from the left in the second menu icons row), here all forms are listed and you can select the one, you want to bring to the front.
New Free Pascal project within the Lazarus IDE