【发布时间】:2011-07-05 13:20:15
【问题描述】:
我一直在尝试让我的 .msi 在我的机器上安装服务。我使用 exe4j 制作我的 Java 代码,存档在 .jar 文件中,以便保存在 .exe 文件中。该服务需要具有跨网络读写的权限。除了在 ServiceInstall 元素中将帐户设置为“NT AUTHORITY\NetworkService”时服务没有读取和写入权限外,我设法让它全部工作。
public static void main(String[] args)
{
try
{
MainService instance = new MainService();
instance.processArgs(args);
watcher.run();
}
catch(Exception e)
{
error(e.getMessage());
e.printStackTrace();
}
System.exit(1); // only get here after an exception
}
这是我的一些 WiX 代码
<File Name="tService.exe" Source="tService.exe" KeyPath="yes" />
<ServiceInstall Id="ServiceID" Description="Copies assets" ErrorControl="normal" Name="tService" Start="demand" Interactive="no" Type="ownProcess" Account="NT AUTHORITY\NetworkService" />
<ServiceControl Id="StartService" Stop="both" Remove="uninstall" Name="InterConnectService" Wait="yes" />
我需要什么帐户,或者我如何才能通过我的服务获得读写权限?我希望 .msi 文件以这些读写权限安装服务。我不想开始手动创建帐户。
更新:
'NetworkService' 只是在安装时失败,并显示 msi“服务...无法安装。验证您是否有足够的权限来安装系统服务”。当我使用“NT AUTHORITY\NetworkService”时,安装过程运行良好。但是,使用“NT AUTHORITY\NetworkService”时,我无法跨网络读写。
有什么想法可以跨网络读写吗?非常感谢您的回复。
【问题讨论】:
-
是安装失败还是安装成功但没有为NetworkService设置服务?
标签: windows-services wix