Tag Archive for 'Portable App'

Making Cygwin portable

One of the very packages I always install when I have to work with Windows is Cygwin. Being able to use my beloved GNU tools really makes things easier.

Often I don’t have the option to install it. I grieved a little bit about the fact that some problems could be solved with just 2 commands that were — of course — missing from Windows’ horrendous command prompt.

So I snooped around and built the following batch that’ll start a full-blown Cygwin session from i.e. portable harddisk:

  1. @echo off
  2.  
  3. set PATH=%CD%bin;%CD%sbin;%CD%usrsbin;%PATH
  4. set HOME=%CD%homePortable
  5.  
  6. mount -bfu %CD%/ /
  7. mount -bfu %CD%bin /usr/bin
  8. mount -bfu %CD%lib /usr/lib
  9.  
  10. cd %HOME%
  11.  
  12. bash —-login -i

Easy, huh? All you have to do to make it work is renaming your /home/Username to /home/Portable (or simply adjust the setting in the batch). Pretty neat stuff.