Open gneiss15 opened 9 months ago
I would mention another "path-problem" when using Draft->ShapeString. Here the path to the font-file is placed into the sketch-file (.FCStd). So when You modify anything later (for ex move the position) You will get an Error "Can not open font file".. This can only be fixed by a script that runs whenever a file was opened. How to do this is (at the moment) out of my knowledge...
Some aditional informations:
I found the path to the font in the file "Document.xml" inside the archive
AppImage can access your local computer file. So why not choose a file on your local file system?
@realthunder Maybe I didn't describe the problem clearly enough. The most important keyword is "PORTABILTY". All files and programs are on a USB stick. This means, that I can work on (almost) any PC. My stick is bootable, too. Using a file "on a local file system" is just the opposite of portability!
OK, I try again to explain what the problems are, but first some remarks:
I identify three kind (places) of such "path-problems": absolute paths containing (starting with) the mount point of ...
My current solution for 1 & 2 is: Replace the "last" paths with the new one.
For Point 2 that can only be done after the AppImage has mounted itself. So doing the modification inside AppRun (as noted above) is the right way. For Point 1 that can be done before starting the AppImage, because the mount point of the removable media is known at this time.
Code snipped for 1:
# because my AppImage is inside a dir “/Portables/FreeCad”, replacing the “mount path” of the stick can be done so:
LAST_MOUNT_PATH=$(Escape "$(sed -e '/^.*<FCText Name=.*>.*\/Portables\/FreeCad\//!d;s:^.*<FCText Name=[^>]*>\(.*\)/Portables/.*:\1:g;q' ${USER_CFG})")
CURRENT_MOUNT_PATH=$(Escape "$(readlink -f -- ${APPDIR} | sed -e "s:\(.*\)/Portables/.*:\1:g")")
Here (part of) the tree of my stick:
.
├── boot
│ └── grub
├── ISOs
│ └── Ubuntu
│ ├── ubuntu-18.04.5-desktop-amd64.iso
│ ├── ubuntu-20.04.6-desktop-amd64.iso
│ └── ubuntu-22.04.3-desktop-amd64.iso
├── Portables
│ ├── Arduino
│ ├── FreeCad
│ │ ├── FreeCAD-Link-Stable-My.AppImage
│ │ ├── FreeCAD-Orig-weekly-builds-35554-2024-01-08-conda-Linux-x86_64-py310.AppImage
│ │ ├── OpenSCADAppimageStart.sh
│ │ ├── Settings
│ │ ├── Start_FreeCad.sh
│ │ ├── Start_Link-Daily.sh
│ │ └── Drawings
│ ├── KiCad
│ ├── LibreOffice
│ ├── OpenSCAD
│ └── PrusaSlicer
├── Sketchbook -> Portables/Arduino/portable/Sketchbook/
├── Start_Arduino.sh -> Portables/Arduino/ArduinoStart.sh
├── Start_FreeCad-Link-Daily.sh -> Portables/FreeCad/Start_Link-Daily.sh
├── Start_FreeCad.sh -> Portables/FreeCad/Start_FreeCad.sh
├── Start_PrusaSlicer.sh -> Portables/PrusaSlicer/PrusaSlicerStart.sh
└── Drawings -> Portables/FreeCad/Drawings/
`
Is there an existing issue for this?
Version
0.20 (Release)
Full version info
Subproject(s) affected?
Other (specify in description)
Problem description
There are some "path-problems" when using the AppImage-Version of FreeCad (I believe, that applies not only to the Link-Branch). The path of/for some workbenches are stored inside "user.cfg". This path is something like "/tmp/.mount_*" when using the AppImage. This path changes on every start of the AppImage. The Problem ocurs (only examples):
To overcome this, the path must be adjusted on every start of the app. I have done this by modifing AppRun. I simply add the code below before the lines:
I hope this is helpfull. Maybe the code must be adjusted a bit to be "universal". For me is's OK.
Anything else?
A similar problem occurs when using the AppImage together with the sketches on a USB stick: Recent files, etc. are not updated to the new path to the AppImage file (the USB stick). This can be adjusted by launching Freecad via a shell script that adjust these paths. I use one myself. If you are interested I can deliver it.
Code of Conduct