This is not done in practice. This is usually done like this:
Original program:
- Run a small updater.
- Abort
Update program:
- Wait for the original to complete.
- Move the original to the side (for example, rename it to ".old").
- Move the new version into place.
- Launch the new version.
- Abort.
, , .