Running several KiCad versions on the same Windows machine

Update for 5.99 and future versions:

The new settings architecture with versioned settings has been migrated into 5.99 (the development code or nightly builds). It will make these instructions mostly obsolete for v6.0 and later if the need is to run several different versions. Each x.y version will have its own settings folder automatically. KICAD_CONFIG_HOME can still be used if wanted. The Start menu isn’t a problem anymore either; the Windows installer has been changed so that KiCad 5.99 and above are installed to their own folders by default and each version has its own Start menu item.

In short, just use the latest Windows installer package for nighly builds or in the future v6 or later, and different x.y versions will be installed and used separately.

Running multiple instances of the same version still requires KICAD_CONFIG_HOME.


Abstract

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.

Intro

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.

Use cases

  • 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.
  • etc.

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.

Same configuration

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.

Same libraries

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

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.

6 Likes

Appendix: Start menu shortcuts

At least at the moment the KiCad Windows installer installs Windows Start menu shortcuts always in the same folder regardless of the version. This leads to a situation where the latest installed version overwrites the previous shortcuts. The shortcuts aren’t even optional, they are always installed.

This is not so much of a problem if you have two versions which won’t be updated later. You can install the most used version last, let it use the default configuration and create extra shortcuts for the less used version (setting the KICAD_CONFIG_HOME variable; see above).

The situation is more difficult if you want to update at least one of the versions, for example if you use nightly builds for testing but a stable version for normal work. In that case letting the stable version installer install the shortcuts won’t work well because it should be installed again every time a new nightly build is installed.

One solution is to leave the Start menu structure which was installed by the installer unused and copy the structures of both versions into their own folders. Those new folders and shortcuts won’t be touched by the installer and you can continue using them even after updates.

You can of course create shortcuts manually but it’s also possible to copy them with the Windows file manager. For details see for example

After you have installed one version copy its Start menu structure with a new name, for example "KiCad5.1 or “KiCad_nightly”. If that version should use a non-default configuration folder create a new shortcut using the directions above (Step 3, Option 1: shortcut).

After installing both versions and copying their Start menu shortcut folders you should have three items in your Start menu Programs: KiCad, (for example) KiCad5.1 and KiCad_nightly. KiCad is unused; each version is started from its own folder/shortcut.

1 Like