Windows: Default *_DIR variables use msys64 instead of Program Files

Bug #1775796 reported by Himura
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Maciej Suminski

Bug Description

Expected behavior:

Default KICAD_SYMBOL_DIR value uses the installation folder directory, in my case "C:\Program Files\KiCad-nightly\share\kicad\library"

Actual behavior:

Default KICAD_SYMBOL_DIR value is "C:\msys64\mingw64\share\kicad\library" for some reason. I don't even have the "kicad" folder in "mingw64\share".

The mingw64 path appears when no corresponding environment variable us set in the system. It also affects other KiCAD variables with paths in the "share" folder

Tags: windows
Revision history for this message
Himura (glagol) wrote :
Revision history for this message
Nick Østergaard (nickoe) wrote :

No version info.

Changed in kicad:
status: New → Incomplete
Revision history for this message
Himura (glagol) wrote :

It's r10472.6d77e594b from 07-Jun-2018.

description: updated
summary: - Windows: Default KICAD_SYMBOL_DIR uses msys64 instead of Program Files
+ Windows: Default *_DIR variables use msys64 instead of Program Files
Revision history for this message
Nick Østergaard (nickoe) wrote :

Did you check the envrionment variable option, or did you install kicad earler from nightly?

Revision history for this message
Himura (glagol) wrote :

Which option should I check?
I removed the environment variables from Windows to switch between KiCAD 4 and KiCAD 5 by switching the %AppData%\kicad folder.

But when the %AppData%\kicad folder is empty, KiCAD 5 incorrectly determines its installation directory.

Revision history for this message
Himura (glagol) wrote :

As for the previous nightly builds, this is my first one. I have the stable version in
"C:\Program Files\KiCad" and the nightly one in "C:\Program Files\KiCad-nightly". And I have a .bat script to switch the %AppData%\kicad folder between nightly and stable.

Revision history for this message
Bob Cousins (bobcousins42) wrote :

If KICAD_SYMBOL_DIR does not exist it is set to baseSharePath + "/library". baseSharePath comes from DEFAULT_INSTALL_PATH. DEFAULT_INSTALL_PATH is set to a path used on the original build server during the build.

Obviously, it doesn't make sense to refer to paths used on a build server when installed on a users machine. A more sensible default would be an empty string.

Meanwhile FindKicadFile() has an entirely different way of finding KiCad data which uses hardcoded paths the user might be using (which is buggy).

Revision history for this message
eelik (eelik) wrote :
Revision history for this message
Himura (glagol) wrote :

@eelik: Thanks, I used the KICAD_CONFIG_HOME to point to the %AppData%\kicad-nightly dir and it works.

Revision history for this message
Himura (glagol) wrote :

@bobcousins42: Thanks for your investigation, I felt that this path comes somewhere from the outside of my system. By the way, KiCAD 4 does not have such issue, it correctly determines its installation path.
I think just for a temporary solution, It's OK to set baseSharePath to the `executablePath + "../share/kicad"`. It will work in much more cases than it does now

Revision history for this message
eelik (eelik) wrote :

This is still in "incomplete" state but bobc gave the explanation how this happens. It happened to me, too, with the latest nightly build. Nowadays the Windows installer doesn't have the Environment variables checkbox ticked by default and after I had installed it and opened path configuration dialog, it showed "C:\msys64\mingw32\share\kicad\library" with old 32bit WinXP.

Is there a reason to keep this as "incomplete" and importance "undecided"? I think this is pretty serious for the first time users.

And BTW, the Environment variables checkbox should be unticked in any case.

Revision history for this message
eelik (eelik) wrote :

I just bought a new laptop, 64bit Windows 10. I installed KiCad 5 with the latest nightly build installer. If the environment variables aren't set with the installer, KiCad sets this wrong path for all three library paths: symbols, footprints and 3D.

Revision history for this message
Chris Elliott (sembazuru) wrote :

I hadn't found this bug so I submitted a similar one here: https://bugs.launchpad.net/kicad/+bug/1777346

I found it by pretending to be a new user w/o any preexisting knowledge of the KiCad environment and installing on a Win7 machine that had never seen KiCad before.

Changed in kicad:
status: Incomplete → In Progress
importance: Undecided → Low
assignee: nobody → Maciej Suminski (orsonmmz)
milestone: none → 5.0.0-rc3
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision f10aa6c8577a80e6e61b99a48b6c7c0986335edb
https://git.launchpad.net/kicad/patch/?id=f10aa6c8577a80e6e61b99a48b6c7c0986335edb

Changed in kicad:
status: In Progress → Fix Committed
tags: added: windows
Revision history for this message
Chris Elliott (sembazuru) wrote :

I juat verified on a system that has never had KiCad installed that this issue seems to be resolved. I downloaded kicad-r10578.f10aa6c85-x86_64.exe from http://downloads.kicad-pcb.org/windows/nightly/ using the installer defaults. None of the paths start with "C:\msys64\", rather start with "c:\Program Files\" as expected. See the attached image as evidence.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Excellent, thank you for the confirmation!

Revision history for this message
Himura (glagol) wrote :

Thank you, guys!
KiCAD 5 Rocks! Looking forward to the release, because it's already much more stable and smooth than KiCAD 4 in simple tasks.

Revision history for this message
eelik (eelik) wrote :

The fix seems to work, also under non-default circumstances: when KiCad is installed into other than default directory, and when the environment variable was set when KiCad was run for the first time but unset before running again.

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.