Running a New and Very Old KiCad Versions


#21

Installing Kicad 5.1.2_1 was straightforward.
I just changed the install location to D:\KiCad512.
I also unchecked the last line “association” so that I can launch the old *.pro by a double-click.

In my case, it seems there is no need of a script (bat).
Kicad v5 could be launched by the shortcut created on the desktop.

Now, the new KiCad and the very old one work independently on my laptop as two separate programs.


#22

Do these steps in v5:

What are the paths?


#23

As you said, the Global Libraries paths point to C:\Users\TOSHIBA\AppData\Roaming\kicad\xxx
For instance, what is the function of the paths on the bottom list “Path Substitutions”?

EDIT:
It seems that, in the folder C:\Users\TOSHIBA\AppData\Roaming\kicad, there are files which are likely just pointers to the new locations of the libraries.


#24

That’s why you should use the script so that v5 uses it’s own configuration. Now your both versions try to use the same libraries (the old ones from the old version). Notice how the paths in v5 now point to the old configuration directory and the installation direcory of the old version. It may work and probably works, but is it really what you want?

And even if the configuration seems to work, are you sure you won’t run into problems later? Have you for example tested what happens when you change some configuration options in v5 which don’t exist in the older version, then used the old version and then again v5? Does it keep the changed options?

If you want to know how the path substitution work you should read Library management in KiCad version 5 or/and my google docs document linked above.


#25

I will certainly read the thread you mentioned if I look to use V5 properly now and later.

On the other hand, since my old KiCad.exe is rather very old, all the paths it needs are on D:\KiCad and acts as a standalone program (like DOS programs of old days).


#26

But are you willing to use those very old symbol and footprint libraries with the new version 5? Because that’s what probably is happening now. If you make even one project with v5 which you want to edit later properly you would have to remake it with the new libraries because most likely you don’t want to use nine years old component libraries. The situation is of course different if you use your own libraries, but you haven’t told any background and I assume you want to use at least some components from KiCad’s own libraries.

Can you give a screenshot of v5 Preferences->Configure Paths (the dialog window dragged so large it shows all texts)? And where did you install v5?


#27

My guess is that a pre version 4 does not really interfere with v5. Back then both symbol and footprint lib setup was part of the project file not part of a global library table and path variable.
Meaning from a library point of view there should not really be a problem.

other things might however still be problematic. It might be that running v5 will interfere with some of the other settings in the config directory. But that kind of depends on if the old settings are still used by v5 (which they might not be as the legacy canvas is not really used anymore) I have the assumption that neither the old nor the new version delete unknown settings. If they do then they definitely interfere with each other if they use the same settings file.


#28

That’s important information. I thought about the possibility of differences but wrote based on the assumption it’s similar to v4.

Showing the path substitutions from v5 would give an authoritative answer.


#29

After reading some posts here related to libraries it became clear to me that I have to re-do every previous important project by using V5 libraries. Sorry for not being clear about this earlier.

On the other hand and truth be said, I couldn’t get a clear/sure complete idea from the libraries tutorial. So, I simply added directly the path “D:\KiCad512\KiCad “ for KICAD_CONFIG_HOME on the windows “Environment Variables” dialog.

When I re-run KiCad V5, the official libraries were moved to this path.
But for the time being, I am not sure if this path is a convenient one or not. I think I have to work on the program (V5) for a while to get a good/practical idea on the full protocol (accessing, creating and updating) later which is applied on the various files on this path.

Here are two screenshots of my actual paths (there is no project yet):
Paths.png
SymbolPaths.png

Sorry… it seems I am not allowed yet to attach images.

Edit: Oooops… only now I noticed the upload icon.

Paths


#30

You are totally right :slight_smile:

I am not sure where “the config directory” is. For instance, the directory of my very old KiCad is on D:\KiCad. And before installing V5, I didn’t find a KiCad folder anywhere on C:\


#31

This works as long as you don’t want to use for example v5 and v6 at the same time (in the future). The same system wide environment variable is seen and used by all KiCad versions since 5.0. If you put it in a startup script only the version run by that script sees and uses it. For now you can keep the system wide variable if you want to.

Now your configuration files for v5 are in D:\KiCad512\KiCad. Your sym-lib-table and fp-lib-table are there (as you can see in the Path under the Global Libraries).

Also the path substitution variables point to correct location to your v5 installation.

The effective configuration folder is always where the Path under Global Libraries point to.


#32

Only now I noticed that the bat file, I created, cannot execute the command “set”. When I opened its properties dialog, I found out that the “Run this program as administrator” is greyed, so it cannot be checked. Is it windows 7 or just me?! (I am the only user of the laptop and I used running programs as administrator anytime necessary).

Edit_1: But since I wrote many bat files in which the command “set=” is used to define a few temporary names (then clear them), perhaps the command here is missing the word “path”. I will search about it since I am not sure now how I set windows variables in the far past (I am 70).

Edit_2: I was reading:
https://jpsoft.com/help/set.htm

So perhaps, setting a path is not possible. And it needs administration privilege which is not an option for *.bat. I will search if someone else, running windows 7, raised this subject.

Edit_3: When I right-click the bat file I am given the option to run it as administrator.
As a test, I created “testV.bat” on which:

set TESTING=D:\Test
pause

I run it while I was watching the windows “Environment Variables”. Nothing happened on the list and on the DOS window no error or warning was displayed!


#33

Finally I got a good end:

C:\Users\TOSHIBA\Desktop>SETX TESTING D:\Test

SUCCESS: Specified value was saved.

C:\Users\TOSHIBA\Desktop>pause
Press any key to continue . . .

It seems that on Windows 7 the command “SET” should be “SETX” instead.

Therefore, in my case, the following command works:

SETX KICAD_CONFIG_HOME D:\KiCad512\KiCad


#34

I don’t think setx is good for this: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/setx

It sets the value permanently, probably the effect is same as setting it in the Windows dialog, so the script works against its intented purpose.


#35

Well, I will test:

rem SETX KICAD_CONFIG_HOME D:\KiCad512\KiCad
SETX KICAD_CONFIG_HOME D:\KiCad600\KiCad
pause

And see what will happen.

Edit_1:
Now KICAD_CONFIG_HOME=D:\KiCad600\KiCad
I think it works

Edit_2:
Of course, I restored the good path by Kicad512.bat

Edit_3:
Isn’t it what the bat files are supposed to do? Or I may have missed something.


#36

The purpose of the SET command in this .bat file is to set an environment variable which is defined only when that script is running and only for commands which are run in that script. Using SETX sets the variable permanently so that if you run KiCad without the script, the variable is still set. That’s not what we want to do with the script. If we want to set an environment variable permanently we can do that with the Windows GUI.

After using SETX, if you use KiCad v5 or later without the script they will use the environment variable. We run KiCad through this script because we want to keep the environment of all other instances (and the whole Windows) clean.


#37

I guess I got what you mean… at last :slight_smile:

Every new version (or instance) should be launched by a script (bat) made for it.
In this case I will have to test the following bat (after deleting the permanent path):

SET KICAD_CONFIG_HOME=D:\KiCad512\KiCad

rem launch kicad.exe
D:\KiCad512\KiCad\bin\kicad.exe

rem clear KICAD_CONFIG_HOME at exit
SET KICAD_CONFIG_HOME=

Edit_1:
It didn’t work :frowning:
But please don’t worry, about me in the least :slight_smile:
For the time being, running one instance only of V5 is more than enough for me.
And, when V6 will arrive, I don’t think I will need running both of them side by side.

Edit_2:
I meant by “it didn’t work” V5 returned to its default location at …\Roaming\KiCad.


#38

“Instance” means a running process. You can have several instances of the same .exe file running at the same time.

EDIT: the program which is started from a script inherits the environment from the script. The script itself inherits the environment from whatever starts it, in practice from the Windows user’s environment. The SET command either creates the variable if it didn’t exist already or overrides the existing value in the script’s environment. But it doesn’t give the value back to the outer level environment.

That’s not necessary. The effect of SET lasts only as long as the script is running, and only for that instance of the script.

Your script has something wrong - see the example script in the above mentioned google drive document, section 3.2. You should use the START command. I’m not sure about the quotes anymore, I don’t remember, but at least they are safe to use (as long as they are correct normal simple quote characters, not inverted).


#39

Do you mean that START has more functions than launching an *.exe directly (as I did above)?


#40

You have these lines:

There’s no START command there. Compare it with the example in section 3.2 in the mentioned document.