A bit of background on this...
Our organisation requires various Java8 preferences/config remain in tact after an upgrade, these are even enforced via group policy. However when the application is uninstalled/installed these are lost until the next policy refresh which could be 90 mins. To ensure the configuration is in place immediately after an upgrade I started looking at utilising the pre/post update scripts. However upon review it appeared that the PatchMyPC defined script was running prior to the custom pre-update, not allowing me to copy out the config from "C:\Windows\Sun\Java\Deployment".
What would be even better is to re-order the workflow such that:
Workaround: As per this post, Justin suggested disabling the PatchMyPC uninstall script for Java and copying the code from the uninstall script into the custom pre-update script.