Windows 无法使用WiX安装程序启动服务
我正在尝试为我的C#项目安装WiX安装程序和服务。这是我第一次尝试,我不明白为什么它不起作用 我已设置ServiceInstall,但在运行安装程序时,我在此页面中被阻止: 几秒钟后,我发现了错误: 我使用相同的参数从VisualStudio安装程序创建了WiX安装。代码如下:Windows 无法使用WiX安装程序启动服务,windows,wix,installation,Windows,Wix,Installation,我正在尝试为我的C#项目安装WiX安装程序和服务。这是我第一次尝试,我不明白为什么它不起作用 我已设置ServiceInstall,但在运行安装程序时,我在此页面中被阻止: 几秒钟后,我发现了错误: 我使用相同的参数从VisualStudio安装程序创建了WiX安装。代码如下: <Product ... /> <Feature Id="ProductFeature" Title="$(var.product)" Level="1"> <Componen
<Product ... />
<Feature Id="ProductFeature" Title="$(var.product)" Level="1">
<ComponentRef Id ="MyService"/>
</Feature>
<UIRef Id="WixUI_InstallDir"/>
<!-- Set install directory -->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
</Product>
<Fragment>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="$(var.product)">
<Component Id="MyService" Guid="{GUID-HERE}" KeyPath="yes">
<!-- service will need to be installed under Local Service -->
<ServiceInstall
Id="MyService"
Type="ownProcess"
Vital="yes"
Name="MyService"
DisplayName="Service"
Description=""
Start="auto"
Account="NT AUTHORITY\LocalService"
ErrorControl="normal"/>
<ServiceControl Id="StartDDService" Name="MyService" Start="install" Wait="no" />
<ServiceControl Id="StopDDService" Name="MyService" Stop="both" Wait="yes" Remove="uninstall" />
</Component>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents">
<Component Id="ProductComponent" Guid="{}" Directory="INSTALLFOLDER">
<File Id="MyService.exe" Source="$(var.MyService.TargetDir)\MyService.exe"/>
</Component>
</ComponentGroup>
</Fragment>
错误“启动失败”可能是一个权限问题,但该消息只是一条默认消息,无论它是否为权限
这些情况通常是服务本身或依赖项:
几个小时后,我终于找到了解决办法。的确,一个dll丢失了。我试图用相同的服务运行另一个程序,但缺少SQL server的dll。我下载了dll,现在它工作了。几个小时后,我终于找到了解决方案。的确,一个dll丢失了。我试图用相同的服务运行另一个程序,但缺少SQL server的dll。我下载了dll,现在它可以工作了。