So, is it possible to perform pre patch installation tasks before patches are applied?
It depends. The pre- and post-installation tasks declared via PackageBoot are per-UPDATE tasks. If you have a task that needs to be performed for a specific update, this is the tool for that job. However, the order of updates installed in a batch is indeterminate, therefore you cannot be guaranteed that the pre-installation task will run before ANY updates are installed, unless that update is the FIRST update installed. The only way it can be guaranteed to be the FIRST update is if its the ONLY update.
However, the way I read your scenario is that you need to shutdown a particular service EVERYTIME you're going to do a reboot, so a patch package is not the place to do this anyway.
One way you can address this issue with Patch Manager is this:
- Explicitly suppress the reboot when you do the patch deployment.
- After the patch deployment is completed, then STOP the service that needs to be stopped.
- Reboot the server using the Shutdown/Reboot task.
The downside of this process is that it requires three different tasks to be initiated, in sequence, after confirming the previous task has completed.
However, the tasks can be pre-defined and stored in the "Scheduled Tasks" collection (as DISABLED tasks), and then simply executed on-demand as needed.