Windows service: Use JAVA_HOME environment variable in registry
Windows service: Use JAVA_HOME environment variable in registry

This allows for updating Java without having to re-install the service.

Closes #13521

kalimatas/elasticsearch,jbertouch/elasticsearch,trangvh/elasticsearch,jimczi/elasticsearch,jchampion/elasticsearch,umeshdangat/elasticsearch,gfyoung/elasticsearch,shreejay/elasticsearch,geidies/elasticsearch,wuranbo/elasticsearch,wenpos/elasticsearch,bawse/elasticsearch,GlenRSmith/elasticsearch,obourgain/elasticsearch,xuzha/elasticsearch,pozhidaevak/elasticsearch,qwerty4030/elasticsearch,fred84/elasticsearch,MisterAndersen/elasticsearch,yynil/elasticsearch,s1monw/elasticsearch,gmarz/elasticsearch,Stacey-Gammon/elasticsearch,fforbeck/elasticsearch,gfyoung/elasticsearch,yynil/elasticsearch,avikurapati/elasticsearch,rajanm/elasticsearch,lks21c/elasticsearch,uschindler/elasticsearch,ThiagoGarciaAlves/elasticsearch,gfyoung/elasticsearch,njlawton/elasticsearch,zkidkid/elasticsearch,gingerwizard/elasticsearch,IanvsPoplicola/elasticsearch,jimczi/elasticsearch,jchampion/elasticsearch,nezirus/elasticsearch,Stacey-Gammon/elasticsearch,JackyMai/elasticsearch,naveenhooda2000/elasticsearch,mikemccand/elasticsearch,mmaracic/elasticsearch,artnowo/elasticsearch,JSCooke/elasticsearch,markwalkom/elasticsearch,sreeramjayan/elasticsearch,ESamir/elasticsearch,a2lin/elasticsearch,JSCooke/elasticsearch,markwalkom/elasticsearch,MaineC/elasticsearch,GlenRSmith/elasticsearch,liweinan0423/elasticsearch,wangtuo/elasticsearch,strapdata/elassandra5-rc,ricardocerq/elasticsearch,ESamir/elasticsearch,ricardocerq/elasticsearch,maddin2016/elasticsearch,pozhidaevak/elasticsearch,IanvsPoplicola/elasticsearch,clintongormley/elasticsearch,spiegela/elasticsearch,C-Bish/elasticsearch,s1monw/elasticsearch,nknize/elasticsearch,henakamaMSFT/elasticsearch,nknize/elasticsearch,coding0011/elasticsearch,ThiagoGarciaAlves/elasticsearch,glefloch/elasticsearch,dpursehouse/elasticsearch,episerver/elasticsearch,dongjoon-hyun/elasticsearch,palecur/elasticsearch,i-am-Nathan/elasticsearch,kalimatas/elasticsearch,coding0011/elasticsearch,masaruh/elasticsearch,gingerwizard/elasticsearch,Helen-Zhao/elasticsearch,GlenRSmith/elasticsearch,nomoa/elasticsearch,cwurm/elasticsearch,elasticdog/elasticsearch,rlugojr/elasticsearch,geidies/elasticsearch,robin13/elasticsearch,masaruh/elasticsearch,rlugojr/elasticsearch,girirajsharma/elasticsearch,ESamir/elasticsearch,fernandozhu/elasticsearch,LewayneNaidoo/elasticsearch,masaruh/elasticsearch,henakamaMSFT/elasticsearch,myelin/elasticsearch,MaineC/elasticsearch,mjason3/elasticsearch,strapdata/elassandra,LewayneNaidoo/elasticsearch,vroyer/elasticassandra,palecur/elasticsearch,geidies/elasticsearch,dongjoon-hyun/elasticsearch,LewayneNaidoo/elasticsearch,MisterAndersen/elasticsearch,StefanGor/elasticsearch,avikurapati/elasticsearch,mapr/elasticsearch,yynil/elasticsearch,sneivandt/elasticsearch,wuranbo/elasticsearch,StefanGor/elasticsearch,brandonkearby/elasticsearch,ThiagoGarciaAlves/elasticsearch,LewayneNaidoo/elasticsearch,fforbeck/elasticsearch,dpursehouse/elasticsearch,rajanm/elasticsearch,wangtuo/elasticsearch,MaineC/elasticsearch,jprante/elasticsearch,zkidkid/elasticsearch,scottsom/elasticsearch,Helen-Zhao/elasticsearch,trangvh/elasticsearch,vroyer/elassandra,wuranbo/elasticsearch,mjason3/elasticsearch,nazarewk/elasticsearch,clintongormley/elasticsearch,wenpos/elasticsearch,strapdata/elassandra,strapdata/elassandra5-rc,sreeramjayan/elasticsearch,obourgain/elasticsearch,awislowski/elasticsearch,jprante/elasticsearch,dpursehouse/elasticsearch,sneivandt/elasticsearch,rajanm/elasticsearch,nilabhsagar/elasticsearch,ZTE-PaaS/elasticsearch,LeoYao/elasticsearch,fred84/elasticsearch,winstonewert/elasticsearch,gfyoung/elasticsearch,girirajsharma/elasticsearch,masaruh/elasticsearch,liweinan0423/elasticsearch,yanjunh/elasticsearch,njlawton/elasticsearch,fernandozhu/elasticsearch,yanjunh/elasticsearch,lks21c/elasticsearch,gingerwizard/elasticsearch,awislowski/elasticsearch,artnowo/elasticsearch,qwerty4030/elasticsearch,rajanm/elasticsearch,fernandozhu/elasticsearch,camilojd/elasticsearch,ThiagoGarciaAlves/elasticsearch,nilabhsagar/elasticsearch,dongjoon-hyun/elasticsearch,maddin2016/elasticsearch,henakamaMSFT/elasticsearch,obourgain/elasticsearch,lks21c/elasticsearch,njlawton/elasticsearch,pozhidaevak/elasticsearch,glefloch/elasticsearch,camilojd/elasticsearch,gingerwizard/elasticsearch,Stacey-Gammon/elasticsearch,clintongormley/elasticsearch,ricardocerq/elasticsearch,artnowo/elasticsearch,LeoYao/elasticsearch,awislowski/elasticsearch,pozhidaevak/elasticsearch,strapdata/elassandra,naveenhooda2000/elasticsearch,nezirus/elasticsearch,fred84/elasticsearch,njlawton/elasticsearch,umeshdangat/elasticsearch,alexshadow007/elasticsearch,alexshadow007/elasticsearch,cwurm/elasticsearch,nezirus/elasticsearch,cwurm/elasticsearch,nomoa/elasticsearch,Shepard1212/elasticsearch,JackyMai/elasticsearch,mortonsykes/elasticsearch,njlawton/elasticsearch,wenpos/elasticsearch,gmarz/elasticsearch,episerver/elasticsearch,markwalkom/elasticsearch,JSCooke/elasticsearch,qwerty4030/elasticsearch,uschindler/elasticsearch,bawse/elasticsearch,naveenhooda2000/elasticsearch,camilojd/elasticsearch,gmarz/elasticsearch,winstonewert/elasticsearch,rlugojr/elasticsearch,JervyShi/elasticsearch,camilojd/elasticsearch,mjason3/elasticsearch,umeshdangat/elasticsearch,i-am-Nathan/elasticsearch,mapr/elasticsearch,nezirus/elasticsearch,maddin2016/elasticsearch,scottsom/elasticsearch,awislowski/elasticsearch,mohit/elasticsearch,mohit/elasticsearch,xuzha/elasticsearch,elasticdog/elasticsearch,MisterAndersen/elasticsearch,jbertouch/elasticsearch,mikemccand/elasticsearch,mapr/elasticsearch,awislowski/elasticsearch,coding0011/elasticsearch,uschindler/elasticsearch,nazarewk/elasticsearch,sreeramjayan/elasticsearch,mikemccand/elasticsearch,JackyMai/elasticsearch,girirajsharma/elasticsearch,kalimatas/elasticsearch,uschindler/elasticsearch,myelin/elasticsearch,scorpionvicky/elasticsearch,s1monw/elasticsearch,winstonewert/elasticsearch,henakamaMSFT/elasticsearch,Shepard1212/elasticsearch,sreeramjayan/elasticsearch,LeoYao/elasticsearch,strapdata/elassandra,mjason3/elasticsearch,avikurapati/elasticsearch,Stacey-Gammon/elasticsearch,obourgain/elasticsearch,wuranbo/elasticsearch,brandonkearby/elasticsearch,nezirus/elasticsearch,gingerwizard/elasticsearch,xuzha/elasticsearch,GlenRSmith/elasticsearch,mjason3/elasticsearch,fernandozhu/elasticsearch,HonzaKral/elasticsearch,vroyer/elassandra,brandonkearby/elasticsearch,mohit/elasticsearch,kalimatas/elasticsearch,maddin2016/elasticsearch,palecur/elasticsearch,scorpionvicky/elasticsearch,scottsom/elasticsearch,scorpionvicky/elasticsearch,fred84/elasticsearch,fred84/elasticsearch,trangvh/elasticsearch,palecur/elasticsearch,jbertouch/elasticsearch,sneivandt/elasticsearch,zkidkid/elasticsearch,JervyShi/elasticsearch,robin13/elasticsearch,ESamir/elasticsearch,nomoa/elasticsearch,nknize/elasticsearch,yynil/elasticsearch,JervyShi/elasticsearch,elasticdog/elasticsearch,markwalkom/elasticsearch,nomoa/elasticsearch,mohit/elasticsearch,Helen-Zhao/elasticsearch,i-am-Nathan/elasticsearch,spiegela/elasticsearch,StefanGor/elasticsearch,dpursehouse/elasticsearch,umeshdangat/elasticsearch,rajanm/elasticsearch,GlenRSmith/elasticsearch,episerver/elasticsearch,clintongormley/elasticsearch,ZTE-PaaS/elasticsearch,wenpos/elasticsearch,fforbeck/elasticsearch,clintongormley/elasticsearch,girirajsharma/elasticsearch,gmarz/elasticsearch,winstonewert/elasticsearch,elasticdog/elasticsearch,JervyShi/elasticsearch,camilojd/elasticsearch,wangtuo/elasticsearch,nilabhsagar/elasticsearch,palecur/elasticsearch,kalimatas/elasticsearch,IanvsPoplicola/elasticsearch,StefanGor/elasticsearch,umeshdangat/elasticsearch,jchampion/elasticsearch,qwerty4030/elasticsearch,brandonkearby/elasticsearch,fforbeck/elasticsearch,nazarewk/elasticsearch,trangvh/elasticsearch,qwerty4030/elasticsearch,pozhidaevak/elasticsearch,nilabhsagar/elasticsearch,Shepard1212/elasticsearch,i-am-Nathan/elasticsearch,lks21c/elasticsearch,mohit/elasticsearch,mmaracic/elasticsearch,mikemccand/elasticsearch,vroyer/elassandra,wuranbo/elasticsearch,artnowo/elasticsearch,JackyMai/elasticsearch,geidies/elasticsearch,dongjoon-hyun/elasticsearch,girirajsharma/elasticsearch,naveenhooda2000/elasticsearch,StefanGor/elasticsearch,ThiagoGarciaAlves/elasticsearch,C-Bish/elasticsearch,spiegela/elasticsearch,a2lin/elasticsearch,alexshadow007/elasticsearch,jbertouch/elasticsearch,IanvsPoplicola/elasticsearch,jimczi/elasticsearch,LewayneNaidoo/elasticsearch,LeoYao/elasticsearch,glefloch/elasticsearch,camilojd/elasticsearch,nazarewk/elasticsearch,rlugojr/elasticsearch,yanjunh/elasticsearch,mmaracic/elasticsearch,mikemccand/elasticsearch,winstonewert/elasticsearch,yanjunh/elasticsearch,JackyMai/elasticsearch,naveenhooda2000/elasticsearch,spiegela/elasticsearch,geidies/elasticsearch,jchampion/elasticsearch,jbertouch/elasticsearch,maddin2016/elasticsearch,wangtuo/elasticsearch,JSCooke/elasticsearch,nazarewk/elasticsearch,sreeramjayan/elasticsearch,MaineC/elasticsearch,jchampion/elasticsearch,myelin/elasticsearch,nomoa/elasticsearch,lks21c/elasticsearch,HonzaKral/elasticsearch,avikurapati/elasticsearch,Stacey-Gammon/elasticsearch,Shepard1212/elasticsearch,dongjoon-hyun/elasticsearch,coding0011/elasticsearch,fforbeck/elasticsearch,s1monw/elasticsearch,sneivandt/elasticsearch,gmarz/elasticsearch,C-Bish/elasticsearch,alexshadow007/elasticsearch,markwalkom/elasticsearch,bawse/elasticsearch,jbertouch/elasticsearch,shreejay/elasticsearch,JervyShi/elasticsearch,mapr/elasticsearch,cwurm/elasticsearch,HonzaKral/elasticsearch,wenpos/elasticsearch,strapdata/elassandra5-rc,HonzaKral/elasticsearch,yanjunh/elasticsearch,robin13/elasticsearch,liweinan0423/elasticsearch,a2lin/elasticsearch,fernandozhu/elasticsearch,JSCooke/elasticsearch,mapr/elasticsearch,xuzha/elasticsearch,a2lin/elasticsearch,ESamir/elasticsearch,shreejay/elasticsearch,C-Bish/elasticsearch,LeoYao/elasticsearch,girirajsharma/elasticsearch,cwurm/elasticsearch,strapdata/elassandra5-rc,jchampion/elasticsearch,jimczi/elasticsearch,jprante/elasticsearch,shreejay/elasticsearch,henakamaMSFT/elasticsearch,clintongormley/elasticsearch,ricardocerq/elasticsearch,geidies/elasticsearch,spiegela/elasticsearch,i-am-Nathan/elasticsearch,sreeramjayan/elasticsearch,ricardocerq/elasticsearch,mmaracic/elasticsearch,mmaracic/elasticsearch,liweinan0423/elasticsearch,jprante/elasticsearch,s1monw/elasticsearch,Helen-Zhao/elasticsearch,sneivandt/elasticsearch,ZTE-PaaS/elasticsearch,glefloch/elasticsearch,C-Bish/elasticsearch,MisterAndersen/elasticsearch,JervyShi/elasticsearch,mortonsykes/elasticsearch,gfyoung/elasticsearch,yynil/elasticsearch,liweinan0423/elasticsearch,zkidkid/elasticsearch,nilabhsagar/elasticsearch,LeoYao/elasticsearch,episerver/elasticsearch,mmaracic/elasticsearch,strapdata/elassandra,glefloch/elasticsearch,nknize/elasticsearch,shreejay/elasticsearch,wangtuo/elasticsearch,Helen-Zhao/elasticsearch,vroyer/elasticassandra,yynil/elasticsearch,gingerwizard/elasticsearch,IanvsPoplicola/elasticsearch,elasticdog/elasticsearch,artnowo/elasticsearch,strapdata/elassandra5-rc,MaineC/elasticsearch,rajanm/elasticsearch,scottsom/elasticsearch,zkidkid/elasticsearch,robin13/elasticsearch,alexshadow007/elasticsearch,avikurapati/elasticsearch,episerver/elasticsearch,coding0011/elasticsearch,scorpionvicky/elasticsearch,dpursehouse/elasticsearch,vroyer/elasticassandra,masaruh/elasticsearch,mortonsykes/elasticsearch,xuzha/elasticsearch,xuzha/elasticsearch,markwalkom/elasticsearch,mortonsykes/elasticsearch,mapr/elasticsearch,jimczi/elasticsearch,ThiagoGarciaAlves/elasticsearch,Shepard1212/elasticsearch,ESamir/elasticsearch,trangvh/elasticsearch,scorpionvicky/elasticsearch,scottsom/elasticsearch,robin13/elasticsearch,obourgain/elasticsearch,MisterAndersen/elasticsearch,gingerwizard/elasticsearch,myelin/elasticsearch,uschindler/elasticsearch,bawse/elasticsearch,ZTE-PaaS/elasticsearch,nknize/elasticsearch,ZTE-PaaS/elasticsearch,LeoYao/elasticsearch,bawse/elasticsearch,rlugojr/elasticsearch,myelin/elasticsearch,a2lin/elasticsearch,mortonsykes/elasticsearch,brandonkearby/elasticsearch,jprante/elasticsearch