These two alternative patches implement root-cmd without modifying setupWrapper, with less code;

cabal repo:
Thu Mar  6 16:53:16 CET 2008  Andrea Vezzosi <sanzhiyan@gmail.com>
  * move inDir to Distribution.Simple.Utils

cabal-install repo:
Thu Mar  6 17:08:16 CET 2008  Andrea Vezzosi <sanzhiyan@gmail.com>
  * Implement CLI flag --root-cmd for 'cabal install' as in #202
  It also adds the internal flag --only so we can avoid building a setup when build-type == Simple.