The path provided by @Khrys will only apply to a default Lazarus installation.
Personally, I recommend setting up the following system when installing Lazarus; this way, you shouldn’t encounter any issues when updating the environment:
- Specify a dedicated configuration folder path for each Lazarus instance. This can be done in the installer (a feature available for quite some time now), or you can create a file named lazarus.cfg in the directory containing the Lazarus executable with the following content:
--primary-config-path=C:\path_to_lazarus_config
- Install all external components (not part of the Lazarus installation) in a dedicated folder, e.g., other_components (C:\path_to_lazarus_config\other_components) - this refers to manual installation of components, not via OPM (because then they are already in the configuration directory)
With this configuration, updating involves removing the previous version of Lazarus (delete all files and folders from the lazarus directory except file lazarus.cfg), then install the new version of Lazarus, and after installation, rebuild the IDE (Menu > Tools > Build Lazarus with profile ...) and you’ll have everything as before.
Of course, it is possible that errors may occur during the rebuild due to changes in the IDE itself, but this happens very rarely.