you're on a path to pain there my friend ...
I'd suggest you use the MSI mechanics to do this, it solves all of these problems, and hides OS issues
There are a number of products out there that create MSIs - Installshield, InnoSetup and others ... MS even supply ORCA and a number of tools to facilitate creation/editing, if you're using Visual Studio, you can create a Setup project which will do a lot of the work
MSI's aren't complicated, they're just esoteric
If you're adamant you want to do this yourself, take a look at
http://msdn.microsoft.com/en-us/library/bb776891(v=vs.85).aspx[
^]