I'm trying to automate the set up of an environment in Windows. As a part of this I'd like to ensure that a specific install of Java 11.0.11 appears first in the Path windows environment variable. I'm currently using NSIS to create an install and can do everything I want to except ensure that my version of Java appears first in the Path variable. It sounds like NSIS does not allow this purposefully as in a typical use case you would want to prevent installs from breaking other installed products by forcing a version change like this (I'm speculating here). See the comments in the accepted answer here: How to use NSIS EnVar plug in to edit path?.
How can I create an automated process (e.g. script) that will put my version of Java first in the Path variable?
--- EDIT----------------------------
The accepted example works perfectly (and even includes an example use case at the bottom). A full working example of this is available at https://github.com/NACHC-CAD/nsis-examples/tree/main/examples/006-envvar-prepend.