我正在使用 Wix 创建我的应用程序安装程序并使用它在 GAC 中安装程序集,它工作正常。
我的问题是当我设置程序集属性'copy local=false'并且我正在执行安装时,我的服务没有被安装,因为它在本地文件夹中找不到这个 dll 并且它没有被安装到广汽还。
如果我将从 EXE 安装中安装另一个组件并验证 DLL 是否在 GAC 中,我将能够安装该服务。
我正在使用 Paraffin.exe 遍历我的应用程序目录并生成一个 wix 文件,并使用 Mold 文件添加不是来自该目录的组件。
<DirectoryRef Id="Manager">
<Component Id="NlogGACRegisterComponent" Guid="1B224CD1-6EE8-46D3-9335-A84B7D8FB87B">
<File Id="NlogDLL" Name="Nlog.DLL" Source="..\Logging\Nlog.DLL" KeyPath="yes" Vital="yes" Assembly=".net"/>
</Component>
<Component Id="ManagerServiceComponent" Guid="EA31E161-4331-4A82-8F2B-7E26F62C96D6">
<File Id="StateManagerServiceEXE" Name="ManagerHostService.exe" DiskId="1" Source="..\ManagerHostService.exe" KeyPath="yes" Vital="yes" />
<ServiceInstall Id="ServiceInstaller" Type="ownProcess" Name="ManagerHostService" DisplayName="Manager Service" Description="Manager Service" Start="auto" Account="[SERVICEACCOUNT]" Password="[SERVICEPASSWORD]" ErrorControl="normal">
<util:PermissionEx User="Everyone" GenericAll="yes" ServiceChangeConfig="yes" ServiceEnumerateDependents="yes" ChangePermission="yes" ServiceInterrogate="yes" ServicePauseContinue="yes" ServiceQueryConfig="yes" ServiceQueryStatus="yes" ServiceStart="yes" ServiceStop="yes" />
</ServiceInstall>
<ServiceControl Id="StartService" Start="install" Name="ManagerHostService" Stop="both" Remove="uninstall" Wait="yes" />
</Component>
</DirectoryRef>
这在负责将DLL安装到GAC然后服务的Mold文件中。
如何确保它先安装 DLL,然后再安装服务?