0
我正在尝试使用针对我的C#项目的服务安装来执行WiX安装程序。这是我第一次尝试,我不明白为什么它不起作用。无法使用WiX安装程序启动服务
我已经设置了ServiceInstall但是当我运行安装程序,我挡在本页面:
几秒钟后,我得到了错误:
我使用相同的参数从Visual Studio安装程序创建了WiX安装。还有就是代码:
<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服务器的DLL。我下载了DLL,现在它工作。 –