Here's one method, install Osgeo4W from scratch using the command line; open a command
# navigate to the USB device:
# download command line installer
wget http://download.osgeo.org/osgeo4w/release/apt/apt-r1193M.exe -O apt.exe
# set install root to USB drive
# install quantum gis and dependencies
apt install qgis
U:\o4w_mobile\bin\qgis.bat and change
SET OSGEO4W_ROOT=U:\o4w_mobile to:
Take the usb drive to a new computer, plug it in, run
X:\o4w_mobile\Osgeo4w.bat, and from that shell run
qgis, et voila!
At time of writing, this will download some 85mb of package archives, so
allocate time and bandwidth accordingly.
On a slow USB device some steps will appear to hang, e.g while
installing the python-core package. Just let it ride, it will eventually
finish or least at give an error message.
While the results are portable, the installation is not. The install
process creates shortcuts on the host computer's desktop and start menu,
some registry entries, and updates some system dll's (if needed, which leads to important note: the new host system may or not have the right dll's for some packages, particularly openssl).
You probably don't want to leave your broken shortcuts etc. on the host
machine, so either delete the shortcuts or run the install again from a
local fixed drive.
The command line installer is not necessary, the same method can be used
using the standard OSGeo4W installer. The important part is editing the
startup qgis batch file. The rest is just candy.