Sounds Ok so far. Have you considered using a installer package instead of writing your own?
On unix it's usually OK to ask application owners to run setup/upgrade from command line with prerequisite guid or such, and have a bit of early sanity code check that you have required permissions.
the hardest line to type correctly is: stty erase ^H