【发布时间】:2021-02-17 13:21:15
【问题描述】:
我正在构建一个独立的 .Net Core 工作者服务,我将其作为 Windows 服务运行。现在我想使用 Wix 创建一个安装程序,但是当我尝试收集所有需要的 DLL 进行安装时,我收到以下错误:
加载配置文件时出错:参数“exePath”无效。
我已阅读this 帖子,其中指出 heat.exe 可能已损坏。但我通过 NuGet (3.11.2) 下载了这些工具,理论上应该没问题。我的 Beforebuild 目标如下所示:
<Exec Command="dotnet publish ..\Parlando.PVS.PackingSlipService\Parlando.PVS.PackingSlipService.csproj -c $(Configuration) -r win10-x86" />
<ItemGroup>
<LinkerBindInputPaths Include="%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\$(Configuration)\%(ProjectReference.TargetFrameworkIdentifier)\win10-x86\publish" />
</ItemGroup>
<HeatDirectory
DirectoryRefId="INSTALLFOLDER"
OutputFile="$(ProjectDir)\HeatGeneratedFileList.wxs"
Directory="..\Parlando.PVS.PackingSlipService\bin\Release\netcoreapp3.1\win10-x86\publish"
ComponentGroupName="HeatGenerated"
ToolPath="$(WixToolPath)"
AutogenerateGuids="True"
SuppressCom="True"
SuppressRegistry="True"
SuppressFragments="True"
SuppressRootDirectory="True"
NoLogo="true" />
<ItemGroup>
<Compile Include="$(ProjectDir)\HeatGeneratedFileList.wxs" Condition="'%(ProjectReference.IsDotnetSDKProject)' == 'True'" />
</ItemGroup>
这应该会生成一个我在安装服务时在 Product.wxs 文件中引用的 .wxs 文件。我的 product.wxs 这样做如下:
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Name="Parlando.PVS.PackingSlipService"
DisplayName="Parlando.PVS.PackingSlipService"
Description="Service installed by Parlando to create packingslips and invoices."
Start="auto"
Account="LocalSystem"
ErrorControl="normal" />
<ServiceControl
Id="ServiceInstaller"
Start="install"
Stop="both"
Remove="uninstall"
Name="Parlando.PVS.PackingSlipService" />
</Component>
<ComponentRef Id="HeatGenerated" />
如何使用 heat.exe 以访问我的 Product.wxs 中的 DLL 列表并通过 MSI 安装我的服务?
【问题讨论】:
标签: .net-core wix windows-services heat