在服务结构中将Java JRE作为启动任务安装
我添加了在服务结构中将Java JRE作为启动任务安装,java,windows,azure-service-fabric,Java,Windows,Azure Service Fabric,我添加了jre-8u121-windows-x64.exe,并制作了install.cmd start /B /WAIT jre-8u121-windows-x64.exe /s SPONSORS=0 在我的/PackageRoot/code文件夹中 增加 <SetupEntryPoint> <ExeHost> <Program>install.cmd</Program> <WorkingFolder>CodePa
jre-8u121-windows-x64.exe
,并制作了install.cmd
start /B /WAIT jre-8u121-windows-x64.exe /s SPONSORS=0
在我的/PackageRoot/code
文件夹中
增加
<SetupEntryPoint>
<ExeHost>
<Program>install.cmd</Program>
<WorkingFolder>CodePackage</WorkingFolder>
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048"/>
</ExeHost>
</SetupEntryPoint>
在我的应用程序中,我以类似的方式运行setup.cmd文件,使用CodeBase而不是CodePackage,它工作正常。也许值得一试。看
Hans您是否尝试过在install.cmd中不使用start而直接调用exe文件?它为安装创建了一个新的上下文,这可能是问题的一部分?是的,提供了与直接在服务清单中运行相同的结果。我现在找到了一个替代路径,将JRE也包括在我的包中。
<Principals>
<Users>
<User Name="Admin">
<MemberOf>
<SystemGroup Name="Administrators" />
</MemberOf>
</User>
</Users>
<Policies>
<RunAsPolicy CodePackageRef="Code" UserRef="Admin" EntryPointType="All" />
</Policies>
SetupEntryPoint:ExeEntryPointDescription { Program = jre-8u121-windows-x64.exe, Arguments = /s /L d:/javainstall.log, WorkingFolder = Work, PeriodicIntervalInSeconds = 0 ConsoleRedirectionEnabled = true ConsoleRedirectionFileRetentionCount = 5 ConsoleRedirectionFileMaxSizeInKb = 2048 } terminated with exitcode 1. CodePackageIdentifier { ServicePackageId = S-Innovations.Elastic.ElasticApplicationType_App31:S-Innovations.Elastic.ElasticServicePkg, CodePackageName = Code }:131369814689037041