Fix the agent's executable upgrade process.

* re-order the upgrade steps as one of the checks was out of order
* better document the upgrade process.