I have a situation where I need to have the ability to uninstall Java (currently JRE 1.7 Update 75, but could really be any version in the future). We are using the JRE MSI. I know how to uninstall it silently just fine, but the gotcha problem comes in that we have thousands of computers and some of them may have IE running during the uninstall.
Now normally I would just use taskkill.exe to terminate IE ahead of time then run Java uninstall. However, we are being told for the uninstall, this isn't an option even if we notify the customers about IE closing. So I'm looking for a command line way to uninstall Java, but allow it to be successfully uninstalled if IE is running (If a reboot is required after the fact, that is fine).
I have tried several things without success already:
- MSIRESTARTMANAGERCONTROL=Enable (And Disable)
- IEOPEN=1
- IERESTART=1
In every case, I keep getting a Java Window that reads the below:

If I choose Later, then it will continue upon the next restart of the computer, which would be fine, except there doesn't seem to be a way to choose this option using the command line or a property??
I would be even be happy to trick Java into thinking it isn't being used currently even if the browser is open, but I can't seem to figure out how Java knows it is being used or not currently used.
(FYI, if you install Java while IE is running that is fine, and if you don't close IE after the fact then run the uninstall command right after, it uninstalls fine even though IE is running. I believe that is the case because the plug-in didn't fully get activated in IE until a close and reopen).
Any ideas on how this can be accomplished? Thanks.