Gentle Readers:
OK, I’ve done quite a few tests and here are the results. Note F3 refers to Field 3 which seems to be the documentation pointer.
Environment Variable KICAD_DATASHEET_DIR Unused.
F3: file:C:\Users\Public\Downloads\Datasheets\era Transformer.lnk
F3: file:C:\Users\Public\Downloads\Datasheets\era Transformer.pdf
F3: C:\Users\Public\Downloads\Datasheets\era Transformer.lnk - Unknown MIME Type for Doc File
F3: C:\Users\Public\Downloads\Datasheets\era Transformer.pdf
Environment Variable KICAD_DATASHEET_DIR: "C:\Users\Public\Downloads\Datasheets\"
F3: $(KICAD_DATASHEET_DIR)era Transformer.lnk - Unknown MIME Type for Doc File
F3: $(KICAD_DATASHEET_DIR)era Transformer.pdf
F3: file:$(KICAD_DATASHEET_DIR)era Transformer.lnk - Failed to open URL “$(KICAD_DATASHEET_DIR)era Transformer.lnk” in default browser. (error 2: the system cannot find the file specified.)
F3: file:$(KICAD_DATASHEET_DIR)era Transformer.pdf - Failed to open URL “$(KICAD_DATASHEET_DIR)era Transformer.pdf” in default browser. (error 2: the system cannot find the file specified.)
Environment Variable KICAD_DATASHEET_DIR: "file:C:\Users\Public\Downloads\Datasheets\"
F3: $(KICAD_DATASHEET_DIR)era Transformer.lnk
F3: $(KICAD_DATASHEET_DIR)era Transformer.pdf
My conclusions:
- Environment Variables are expanded only at the start of the F3 field.
- Windoz Links (.lnk aka Symbolic Links aka Reparse Points) seem to need the leading “file:”
- Normal files (not links) do NOT require the leading “file:”
- Any Environment Variable name can be used.
Note to non-Windoz folks:
“.lnk” files in Windoz are actual files but are interpreted in a strange way. In particular, CreateFileA/W (which is used to Open files as well as create them) will open the target of the link unless the flag “FILE_FLAG_OPEN_REPARSE_POINT” is specified. I believe, but am not sure, that other calls’ default behavior is opposite. This might explain why using “file:” makes symbolic links “work” (the target file is found and opened). Note I am not a Windoz expert. And I’m certainly not an expert in KiCad code.
I have what I need in (5.1.0)-1 on Windoz.
Thanks to all,
MMM