Default location for templates folder on Windows often not writeable

Bug #1543443 reported by Dieter Kunkel
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Wayne Stambaugh

Bug Description

From WIN7 and up there is a problem using <Program Files> for files that get written too (e.g. modified). This path is partially virtually, depending of the current user. Administrator right are required to write.

Microsoft designed the path c:\ProgramData for these things. Examples and templates shall be installed there. Leave the original component libraries and template backups (so these cannot be overwritten accidentially).

I think, a lot of the reported problems with 'cannot write' or disappeared files depends on this.

Some of my jobs include writing software that is intended to run on computers that get used by several user and all around the worl and with any Windows version you can think of.

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

What exactly is the bug, and what exactly do you suggest?
What are the stories with files dissapering?
So you know about appdata roaming?

tags: added: windows
Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

This is correct, KiCad should not be writing to anything in Program Files. I cleaned up one place where it was doing that recently, what are the others?

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1543443] Re: Proplem with windows path

@Chris, what was the revision number of the commit where you fixed this?
 I looked at your last few commits and I don't see anything that fixes
any windows path issues.

On 2/10/2016 4:46 PM, Chris Pavlina wrote:
> This is correct, KiCad should not be writing to anything in Program
> Files. I cleaned up one place where it was doing that recently, what are
> the others?
>

Revision history for this message
Chris Pavlina (pavlina-chris) wrote : Re: Proplem with windows path

It was 6047, way back in August. The project manager was creating a noname.pro in IIRC the working directory, which ended up being ProgramFiles\KiCad.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

We need clarification on what windows paths are getting written to that are not supposed to be. In the past we have had users who have modified the footprint and/or component libraries that shipped with KiCad and then they got overwritten when they installed a new version of KiCad. This is to be expected and there is nothing KiCad can do to prevent you from doing that as long as you have write permissions to the installed library files. The only way to prevent his is install KiCad as admin and make sure none of the users on the system have admin privileges or just copy the libraries to a path the user does have write permissions. It's always a bad idea to modify any of the libraries or templates that get installed with KiCad because they will be overwritten the next time you install KiCad.

Revision history for this message
Oivind Toien (otoien) wrote : Re: Proplem with windows path

As I understand the complaint is for the template folder, if one want to change any of the default profiles etc., as indicated it is not possible to write to that folder. However as is stated above it would not be wise to change these files when in that location. A custom location can be specified in the Kicad path configuration under the name "KICAD_PTEMPLATES", and those files placed in a writable folder, for instance in the user home directory.

Jeff Young (jeyjey)
summary: - Proplem with windows path
+ Default location for templates folder on Windows often not writeable
Changed in kicad:
importance: Undecided → Low
status: New → Triaged
Changed in kicad:
milestone: none → 5.0.0-rc2
assignee: nobody → Wayne Stambaugh (stambaughw)
status: Triaged → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Allowing users to write to paths for which they do not have write permission doesn't make sense. I just committed a change that allows the user to create user template folder where they can add their own templates. Actually you could always do this but the path was hard coded and unless you read the Eeschema user manual, you would have no idea it existed. Now there is a KICAD_USER_TEMPLATE_DIR internal environment variable which defaults to the old path but can now be changed by the user if preferred. If this option is not acceptable, you will have to install KiCad to a folder where you have write permissions.

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.