Running FreeCAD from USB drive

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Running FreeCAD from USB drive

Post by kisolre »

I want to run FreeCAD from an USB drive under Windows. So I extracted a recent build there, copied config files from my pc and created the following BAT file to run it:
.\bin\FreeCAD.exe -u user.cfg -s system.cfg -M .\ExtraMods -P .\ExtraMacros

FreeCAD starts but still loads all installed workbenches from c:\users\... I want it to search, load, install modules just to/from .\ExtraMods folder
It tries to load it as if it is a modue folder and fails:
Init: Initializing .\ExtraMods(InitGui.py not found)... ignore

Is it possible to change the default Mod folder? or the whole FreeCAD configuration folder?
User avatar
papyblaise
Veteran
Posts: 8026
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: Running FreeCAD from USB drive

Post by papyblaise »

Hello
I do it for a freind (he needn't instal it permenently)
I use the V19pre (just unzip and not instal) add it the addons he whent , copy all the folder on USB key , that all,
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Running FreeCAD from USB drive

Post by kisolre »

On a system FreeCAD was never run there will be no local config files Which is fine But on my local I already run it and I want the USB copy to NOT use/modify/... local files. Just use what is on the usb drive. Not it uses configs fro there, macros from there but by some reason uses all installed mods from the pc.
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Running FreeCAD from USB drive

Post by TheMarkster »

I could be wrong, but I think the -M just adds additional mod folders rather than replacing the default.

If you USB drive is e:\

Code: Select all

set HOME=e:\
set USERPROFILE=e:\
cd FreeCADFolder\bin
FreeCAD.exe
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Running FreeCAD from USB drive

Post by kisolre »

With
set HOME=g:\FreeCAD
set USERPROFILE=g:\FreeCAD

when installing addons it runs git clone --branch=master -v https://github.com/mark1791/3D_Printing_Tools \Mod\3D_Printing_Tools
efectively cloning to g:\Mod\ folder but on restart does not search there.
with only HOME set it loads from local machine (c:\users\...)
with only USERPROFILE set to g:\FreeCAD FreeCAD does not search\load any extra modules, addon manager sees mods that it previously installed in "\Mod\" and installs new ones there. Value of USERPROFILE is used for some tex cached files.
I tried different folder structures under g:\FreeCAD folder with no luck.
So in the end I just copied needed mod folders to the folder with default workbenches and used USERPROFILE=.\ to disable search for local mods.

Code: Select all

set HOME=.\
set USERPROFILE=.\

.\bin\FreeCAD.exe -u user.cfg -s system.cfg
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Running FreeCAD from USB drive

Post by kisolre »

The problem was lack of folder structure under USERPROFILE dir.
This is a working solution for Windows:

Code: Select all

set USERPROFILE=.\UserCfg
rem set APPDATA=.\UserCfg\AppData\Roaming
set
pause
.\FreeCAD.exe
The trick is that there must be .\UserCfg\AppData\Roaming present at FreeCAD start to be recognized and used.
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Running FreeCAD from USB drive

Post by kisolre »

And here is the actual file that worked and the directory structure with it:

Code: Select all

set USERPROFILE=.\Config
set APPDATA=.\Config\AppData\Roaming
rem Must be present to be used!!!
set
pause
App\bin\FreeCAD.exe

Code: Select all

+---App
|   +---bin
|   +---data
|   +---doc
|   +---Ext
|   +---lib
|   +---Mod
|   \---resources
\---Config
    \---AppData
        \---Roaming
            \---FreeCAD
                +---Macro
                +---Mod
                |   +---A2plus
                |   +---dodo
                |   +---fasteners
                |   +---FCGear
                |   +---lattice2
                |   +---Manipulator
                |   +---Part-o-magic
                |   +---sheetmetal
                |   +---ThreadProfile
                |   \---workfeature
                \---AddonManager
                    \---Images
All workbenches installed from within that working installation. I can easily replace the FreeCAD build in the App folder without breaking the configuration
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: Running FreeCAD from USB drive

Post by kisolre »

Just crosslinking the proper current solution:
https://forum.freecadweb.org/viewtopic.php?f=4&t=49028
Post Reply