How can I instruct platformio to install packages like frameworks, etc., to a specific folder other than C:\Users?

I have tried several methods, such as setting up PlatformIO Core to a specified location, setting a customPATH in settings.json, but no luck so far. In the c_cpp_properties.json file, under the PlatformIO includePath, platformio is always sticking the packages under “C:/Users//” no matter what I do - and trying to change the HOMEDRIVE and HOMEPATH vars so that I might be able to do it indirectly somehow has come up empty and given me a headache.
Any thoughts as to how I can do this?
I consider this really important that I be able to do this so that I can create a truly portable PlatformIO environment - I need this, as others probably would need as well

Do you mean PLATFORMIO_PACKAGES_DIR system environment variable?

1 Like

Dear George, I also suggest you to try PLATFORMIO_CORE_DIR system environment variable. The PLATFORMIO_PACKAGES_DIR work too, but only for packages. the PLATFORMIO_CORE_DIR rebase everything, it is very nice to stop using “C:/Users”, also not my preference.

If you want to “rebase” everything to another location try PLATFORMIO_CORE_DIR system environment variable. I was able to configure very nicely in a network drive this way, and also in a second hard drive D:\Projects worked very well for me.

Please note It may need to re-install Platform IO Core in the new location (usually just a new download), and finally you can remove the old location and keep things clean.

Details are here, please read a lot of useful options.


1 Like

Thank you Ivan, celsocos - I will certainly try your suggestions.
I’m hoping this will do the trick.

I can confirm that indeed, setting the PlatformIO environment variables is the way to go!
One thing to point out for people working on the Windows platform: please use the SETX command when setting the environment vars, not the SET command - using the SETX command ensures persistence, while SET is transient.
Thanks again