Tom*_*lis 15 installation windows-installer wix wix3
我试图通过WiX 3.0让我的应用程序成为安装程序.确切的代码是:
<File Id="ServiceComponentMain" Name="$(var.myProgramService.TargetFileName)" Source="$(var.myProgramService.TargetPath)" DiskId="1" Vital="yes"/>
<!-- service will need to be installed under Local Service -->
<ServiceInstall
Id="MyProgramServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="MyProgramAddon"
DisplayName="[removed]"
Description="[removed]"
Start="auto"
Account="LocalService"
ErrorControl="ignore"
Interactive="no"/>
<ServiceControl Id="StartDDService" Name="MyProgramServiceInstaller" Start="install" Wait="no" />
<ServiceControl Id="StopDDService" Name="MyProgramServiceInstaller" Stop="both" Wait="yes" Remove="uninstall" />
Run Code Online (Sandbox Code Playgroud)
事情是由于某种原因,LocalService在"安装服务"步骤失败,如果我将其更改为"LocalSystem",则安装程序会在尝试启动服务时超时.
该服务在系统启动时手动启动,并且所有意图和目的都很有效.我听说在LocalService下正在使服务正常工作存在问题,但Google并没有真正帮助,因为每个人的回答都是"让它工作到kthx".
只是希望在安装过程中设置并启动此服务,就是这样.有帮助吗?谢谢!
JP *_*oto 10
你有没有尝试过 ...
NT AUTHORITY\LocalService
Run Code Online (Sandbox Code Playgroud)
根据这个文件 ......
...但是当您调用CreateService时,帐户的名称必须是NT AUTHORITY\LocalService,而不管语言环境如何,或者可能发生意外结果.
ServiceControl Table的MSI文档指出'Name'是服务的字符串名称.在您的代码snipet中,您的ServiceControl"名称"设置为ServiceInstall的"ID",而不是"名称".因此,您的ServiceControl元素应为:
<ServiceControl Id="StartDDService" Name="MyProgramAddon" Start="install" Wait="no" />
<ServiceControl Id="StopDDService" Name="MyProgramAddon" Stop="both" Wait="yes" Remove="uninstall" />
Run Code Online (Sandbox Code Playgroud)