In order to make QGIS portable on Windows:
- get a copy of a vanilla QGIS install (usually Program Files\QGIS 3.16)
- Create a "profiles" directory in the root folder of the QGIS copy
- Modify the qgis-ltr.bat file and add the 2 following lines before the start line:
del %OSGEO4W_ROOT%\bin\qgis-ltr-bin.env
%OSGEO4W_ROOT%\bin\qgis-ltr-bin.exe --postinstall
- Modify the start line and add
--profiles-path "%OSGEO4W_ROOT%"
before the%*
which should remain at the end of the line
And voilà: you can now start QGIS in "portable mode" by double clicking of the qgis-ltr.bat file.
Your profiles will be transported with QGIS itself.