To have several parallel versions of KiCad on Windows:
- They have to be installed to different locations.
- Only one of them can be run by the default means.
- Other versions (v5 and newer) must be run with KICAD_CONFIG_HOME environment variable set.
- The variable can be set in a shortcut or in a script.
- This way each version uses its own configuration and libraries.
It is possible to run several KiCad versions (or instances of the same version) on the same Windows machine, even simultaneously, so that their configurations and libraries are completely separate.
Bob Cousins has written short, to the point steps for v4 and v5 parallel installation here: https://github.com/bobc/kicad-doc/wiki/Installing-KiCad-v4-and-v5-side-by-side. Read it if you need version 4 as one of the versions. It should be enough in itself but this article gives some background information.
If you want to use other than the standard library setup you should read Library management in KiCad version 5. By default the installer installs the libraries with KiCad and each KiCad version should find its own libraries if you follow the steps given in this article.
The gory details about KiCad path variables and startup scripts can be found here: https://docs.google.com/document/d/1Rq8i2Ay7qpGpffaj-AQmE-Xp88ikHhgyt0Ygpi8717o/edit?usp=sharing.
- Old projects with v4, new projects with v5.
- Stable version for production, nightly builds for testing.
- Only one version but different configurations for work and for hobby.
Problems when just installing to different folders
If you just install several KiCad versions to different folders it may kind of work, depending on the versions, but there may be several problems.
They all use the same configuration (preferences etc.). That may not be desirable. Although configuration compatibility between versions is pretty good, there may be problems. Even with one version and several instances you may want to have different configurations.
If you use more than one major version (4, 5, in the future 6 etc.) you most probably want their respective component libraries. The newer versions can use older libraries but not necessarily vice versa, and newer libraries are usually better. Using the same configuration folder leads to using the same global library setup.
Start menu and shortcuts
The latest installed version overwrites Start menu and other shortcuts created by the installer.
Solutions to the problems
Configuration: Set KICAD_CONFIG_HOME environment variable
When KiCad is run it reads KICAD_CONFIG_HOME environment variable. That variable should point to the folder where that version or instance of KiCad finds and stores its configuration files. There are several ways to set that variable so that you can run several versions or instances of KiCad even simultaneously and yet use different configurations for each. Some ways to set that variable are described below.
Libraries: Set KICAD_CONFIG_HOME environment variable
The solution to the library problem is the same as to the configuration problem. When KiCad is run for the first time and it doesn’t find an old configuration it creates a new one and sets new library paths. The library paths are stored in the configuration. That way each KiCad version runs with its own libraries.
Shortcuts: Create new ones
You have to create new shortcuts and/or menu items for all but the last installed version. Note that the shortcuts shouldn’t just start KiCad directly ; they have to start it with KICAD_CONFIG_HOME environment variable set in one way or another. Those ways are described below.
Whatever your setup is, the automatically installed shortcuts will be somewhat problematic. The solutions differ depending on the setup. More help is given in an appendix in a separate post below.
Step by step
Step 1: Delete existing KiCad environment variables from Windows
An earlier installer, if you have used one, may have set some system wide environment variables. Delete them. Otherwise you most likely will have problems later. If you find KiCad related environment variables write them down so that you can set them again later within KiCad if needed. Run the version which was already installed and check that everything works. If not, set the variables again manually with the Configure Paths dialog. (Check that dialog beforehand to find out which variables may have been set in Windows.)
Step 2: Install several versions
- Use the installer of each version.
- Uncheck “Environment variables” from the installation options.
- Select different installation folder for each.
- If you want one of the versions work as the default version, as if it were the only installed version, install it last. That way it overrides the Start menu items.
- Don’t run the installed versions yet.
Step 3: Create a startup script or a shortcut which sets KICAD_CONFIG_HOME
This step is valid only for version 5 or newer. Version 4 or older doesn’t recognize KICAD_CONFIG_HOME. If one of the versions you want to run is 4, it should be run in the default way and it will use the default configuration folder. In that case no other version should be started without KICAD_CONFIG_HOME set.
Choose a new folder which you want to use as the configuration folder for one of the versions. That will be the value of KICAD_CONFIG_HOME. The runnable kicad.exe program is in bin/ folder under the folder where you installed this KiCad version.
Option 1: Shortcut
Create a shortcut and set this as the command to run, changing the paths as appropriate:
cmd.exe /c "set ^"KICAD_CONFIG_HOME=C:\Users\MyUserName\Documents\kicad5\^" && start /d ^"C:\Program Files\kicad5\bin^" kicad.exe"
Option 2: Startup script
Create a .bat file with these lines, changing the paths as appropriate:
set "KICAD_CONFIG_HOME=C:\Users\MyUserName\AppData\Roaming\kicad5" start /d "C:\Program Files\kicad\bin\" kicad.exe
Step 4: Run the shortcut or script
Run the shortcut or script which you just made. This version of KiCad should now create a new configuration into KICAD_CONFIG_HOME because it doesn’t find one. Supposing you installed the libraries in the default way with KiCad, It should also guess the library paths which it then stores into the new configuration. Run the schematic editor and the layout editor once from the project view to ensure that everything is set up.
From now on run that KiCad version only through the shortcut or the script. Otherwise it will use the default configuration folder which may mess up another version’s setup.
Repeat steps 3 & 4 for each installed version.
Only one version?
If you have only one version but you want to run it with different configurations and/or with different library setups you don’t have to install it many times. It’s enough to write a shortcut or script for each setup. however, If you want to use different libraries, you have to install the libraries separately, following Library management in KiCad version 5. Then you have to set the library paths manually in each KiCad instance.
Don’t want to touch an already installed version?
Install the other versions (v5 and newer) to other locations and make shortcuts or scripts for them as described above. The only problem is that the Start menu items are overwritten by the last installation. If you had already v4 installed, you can install it again as the last one as long as you have the installer package at hand. It doesn’t overwrite its old configuration and you should be safe. Remember to uncheck Environment variables in the installer.