Question:
What order do things happen in during a patch?

Answer:
This is the Visual Patch 3.0 runtime patching sequence:
  1. Initialize some Lua variables (_CommandLineArgs, %SourceFolder%, etc.)
  2. Begin the log file.
  3. Initialize the language support.
  4. Verify the file archive integrity.
  5. Load action plugins.
  6. Do any Global Script includes.
  7. Run the Global Functions script.
  8. Run the On Startup actions.
  9. Show the Before Patching screens.
  10. Run the On Pre Patch actions.
  11. Start writing the log file to disk.
  12. Show the While Patching screen.
  13. Patch files.
  14. Remove legacy files.
  15. Handle any files that need to be deleted or moved on reboot.
  16. Destroy the progress screen controller.
  17. Run the On Post Patch actions.
  18. Show the After Patching screens.
  19. Run the On Shutdown actions.
  20. Delete any temp files.
  21. Exit the patch.