Portable KICAD install / PCBNEW not working

I would like to install KICAD on a portable USB drive. I have an other portable install, but it is old and does not use the new PCB format.

I can extract the files from the version 4 installer with 7zip and run all of the exe’s except for pcbnew and the footprint editor. eeschema works fine as well as gerbview and kicad.exe,

I think pcbnew is not finding some python libraries or the wx libraries. Here is the error:

11:59:43: Failed to load shared library ‘I:\PA\PortableApps\kicad\bin_pcbnew.kiface’ (error 0: the operation completed successfully.)
11:59:45: IO_ERROR: Fatal Installation Bug. File:
‘I:\PA\PortableApps\kicad\bin_pcbnew.kiface’
could not be loaded
Perhaps a shared library (.dll or .so) file is missing.
From command line: argv[0]:
‘I:\PA\PortableApps\kicad\bin\kicad.exe’

from C:/Jenkins/workspace/windows-kicad-msys2-stable/src/kicad-4.0.2/common/kiway.cpp : KiFACE() : line 225

_pcbnew.kiface is in the location the error describes so the message does not help me much.

It is likely something something simple, like a path or env variable. Any ideas?

Thanks in advance

Well, KiCad is not a portable application by itself and I’m not aware of any wrappers that make it one.

Is the message really:

‘I:\PA\PortableApps\kicad\bin_pcbnew.kiface’

There seems to be a path separator missing after ‘bin’.

cbernardo,

I am not sure how copy/paste failed, but I did it again and the path separator between “bin” and “_pcbnew” is there. I do have a 2011 version of KICAD that is portable and works great, but is now outdated because of the new formats. Like I said, I can run all of the exe’s except for pcbnew and the footprint editor. eeschema works fine as well as gerbview and kicad.exe.

What is pcbnew and footprint using that the others are not? If I could figure that out, I might be able to get it to work. The error message is too vague to figure out.

Thanks for the help.

14:47:49: Failed to load shared library ‘I:\PA\PortableApps\kicad\bin_pcbnew.kiface’ (error 0: the operation completed successfully.)
14:47:49: IO_ERROR: Fatal Installation Bug. File:
‘I:\PA\PortableApps\kicad\bin_pcbnew.kiface’
could not be loaded
Perhaps a shared library (.dll or .so) file is missing.
From command line: argv[0]:
‘I:\PA\PortableApps\kicad\bin\pcbnew.exe’

from C:/Jenkins/workspace/windows-kicad-msys2-stable/src/kicad-4.0.2/common/kiway.cpp : KiFACE() : line 225

If you launch everything from the KiCad GUI I don’t understand what’s going wrong. The message complains “error 0: the operation completed successfully”. The only thing I can imagine is a bug in the Windows dynamic loader. I have seen this problem before when software must be run from the primary drive to work. I never understood what the issue was because software would run OK and then one time it just stops working and refuses to run unless it’s copied to somewhere on c:\

If you have an event log viewer you may find a little more information in the Windows Event Log (if anything at all was recorded there).

Other possibilities are bad dependencies; you may need to copy a number of other Windows run-time files to the directory with kicad.exe to ensure the correct versions are found. A “Dependency Walker” tool might help you work out which files you need. As long as the problem isn’t due to a difference in a core system module like kernel.dll you may be able to fix it.

Well, being able to run copied executable is only one side of portability. Another side is where program settings are stored.

The dependency walker was a great idea. I kicad.exe loaded beautifully. However the profiler red-lined the following loading PCBNEW:

LoadLibraryW(“i:\pa\portableapps\kicad\bin_pcbnew.kiface”) returned NULL. Error: %1 is not a valid Win32 application (193).

So it found _pcbnew.kiface but says it is not valid. Perhaps it is corrupted? This the MD5 sum of my version from kicad-product-4.0.2-x86_64.exe: a14532571e466939fe6c33f627e0c667 *_pcbnew.kiface

Interestingly, I profiled eeschema and it loaded _eeschema.kiface perfectly.

Could you check the md5sum of _pcbnew.kiface with what I show? I have extracted the files many times so it is not a one-time error.

Thanks! We are honing in on it.

These settings are stored in %USERPROFILE%/AppData/Roaming/kicad path. You can try to override this variable to removable drive. But I heard this method could be problematic with wxWidgets 3.x.

PCBNEW is finding everything except the profiler reports that _pcbnew.kiface “is not a valid Win32 application”.

EESCHEMA loads its version of _eeschema.kiface just fine.

I did look at the files in %USERPROFILE%/AppData/Roaming/kicad. The files for KICAD and EESCHEMA looked normal with plenty of information. However the file for pcbnew contained only this:

file1=
file2=
file3=
file4=
file5=
file6=
file7=
file8=
file9=

Is this right?

Well. I have KiCad 4.x configured so my pcbnew settings file have plenty of parameters. Among other things, it has also these fileX= parameters.

Do not know if it still works, but try to:

  • Copy all KiCad files keeping full structure to any folder of your removable drive.

  • Use (copy text and save) modified RunKicad.bat from old KiCadWinbuilder to start KiCad Manager:

    @ECHO OFF
    REM
    REM Part of the KiCad-Winbuilder project
    REM
    REM Licence:
    REM
    REM Copyright © 2011-2013 Brian Sidebotham
    REM
    REM This program is free software; you can redistribute it and/or
    REM modify it under the terms of the GNU General Public License
    REM as published by the Free Software Foundation; either version 2
    REM of the License, or (at your option) any later version.
    REM
    REM This program is distributed in the hope that it will be useful,
    REM but WITHOUT ANY WARRANTY; without even the implied warranty of
    REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    REM GNU General Public License for more details.
    REM
    REM You should have received a copy of the GNU General Public License
    REM along with this program; if not, you may find one here:
    REM http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    REM or you may search the http://www.gnu.org website for the version 2 license,
    REM or you may write to the Free Software Foundation, Inc.,
    REM 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
    REM

    REM ----------------------------------------------------------------------------
    REM Set up the path to point to all the binaries required for the environment

    REM We must add in the KiCad binary directory to make the _stc.pyd import work!
    SET KICAD_PATH_ROOT=%CD%
    SET KICAD_PATH=%KICAD_PATH_ROOT%\bin

    REM ----------------------------------------------------------------------------
    REM
    REM Generate the bin search path

    REM Concatenate the path (Careful of the order of the path entries!)
    SET PATH=%KICAD_PATH%;%KICAD_PATH_ROOT%;%PATH%

    REM Tell PCBNEW where to look on github when using the github footprint
    REM libraries:
    SET KIGITHUB=https://github.com/KiCad

    REM Tell PCBNEW where to look on footprints when using Legacy/Pretty libraries:
    SET KISYSMOD=%KICAD_PATH_ROOT%\share\kicad\modules

    REM Tell PCBNEW where to look on footprints 3D shapes:
    SET KISYS3DMOD=%KICAD_PATH_ROOT%\share\kicad\modules\packages3d

    REM KiCad stores some files in the user profile. Separate this from our real
    REM system so that we don’t contaminate a system-wide install with the
    REM KiCad-Winbuilder install
    SET USERPROFILE=%CD%\portableprofile
    SET APPDATA=%USERPROFILE%\AppData\Roaming
    SET CSIDL_APPDATA=%APPDATA%

    REM Run KiCad
    CD %KICAD_PATH%
    START .\kicad.exe
    CD …/…

This batch file should be located in created folder.

Thanks for the batch file! I saved and ran it with echo on to make sure it was working right. It set the paths right and kicad started just fine. And everything works except PCBNEW and FOOTPRINT EDITOR as before with the same error that _pcbnew.kiface could not be loaded.

I do not think it is a path or settings problem or I would think the other binaries would be effected.

The Dependency Walker said that loading _pcbnew.kiface was the only error.

pcbnew (13.7 KB)
I don’t know if it helps, but that’s the pcbnew file in the folder for my install, cleaned up the paths.
I run BZR6608 on Win7 64bit with 2 monitors, but pcbnew is on the primary I think.
If not you have to adjust some of the FramePos values…

I think we need some answers from @smull to have a full view of the situation:

  1. What is your operating system?
  2. What is the operating system where You try to start portable KiCad?
  3. Which exactly release of KiCad do You try to make portable?
  4. Where You download it?
  5. Is it work after normal installation on desktop/notebook/tablet?
  6. Do you use any additional software for creating/running portable applications, as Cameyo, PortableApps?
1 Like

Joan_Sparky,

Thanks for the _pcbnew.kicad file! Unfortunately, it did not fix the problem either. I was hoping that was it. We’ll keep trying though.

I’ll answer your questions.

What is your operating system?
win7 64

What is the operating system where You try to start portable KiCad?
win7 64

Which exactly release of KiCad do You try to make portable?
kicad-product-4.0.2-x86_64.exe

Where You download it?
kicad download page

Is it work after normal installation on desktop/notebook/tablet?
I do not have the luxury of admin priv for normal install. I have extracted the files from the install exe. It would be much better to have an installation that could be unzipped and ran.

Do you use any additional software for creating/running portable applications, as Cameyo, PortableApps?
I do use portable apps, but this is not a portable apps situation.

Everything is working except, PCBNEW and the MODULE EDITOR, the error in both cases being unable to load _pcbnew.kicad.

An attempt to decompress the files from the installer with 7-zip (recent release) returned 75 errors. :disappointed:

If you are not worried about the bugs in the development version maybe you could try the files from “nightlies” compilation. They can be easily downloaded from http://ci.kicad.org/job/windows-kicad-msys2-nightlies/ws/pack-x86_64/ as a zip archive.


I just tried. I downloaded the files from nightlies compilation, copied to a USB memory stick and ran the program on another computer (Windows 7 Pro x64) with a standard user account. Pcbnew is working. :confused:

1 Like

keruseykaryu,

Thank you for the link. I would like to try that build. Unfortunately the path for the zip file has asterisks (http://ci.kicad.org/job/windows-kicad-msys2-nightlies/ws/pack-x86_64/zip/pack-x86_64.zip) and I think the firewall is filtering those out. Is there another path without the asterisks?

wget fails too… javascript. Is there way to git clone it maybe?

I think the kicad build/web server might have some problems.

I tried to download http://ci.kicad.org/job/windows-kicad-msys2-nightlies/ws/pack-x86_64/zip/pack-x86_64.zip at another location and it still fails. I can download small individual files, but not the big zip. The web server is timing out 504. If I try to download say the zip file from the bin directory, it takes about 1 min or two to start the transfer, then it kills prematurely after a few seconds. Perhaps the webserver is too slow to handle the data?

Anyone else seeing this?

Same for me: 504 Gateway Timeout