【问题标题】:WiX - Sequencing Custom Action and Service InstallWiX - 对自定义操作和服务安装进行排序
【发布时间】:2011-04-19 21:22:36
【问题描述】:

我正在为 Windows 服务(托管)进行安装。我希望能够根据对话框中的用户输入更新其配置文件。配置文件已正确更新并安装了 Windows 服务,但看起来该服务并未获取配置中的更改。我搞砸了排序吗?我想在安装和启动服务之前运行我的自定义操作“ServiceConfig”。

这是我的 WiX 文件的摘录:

<Component Id="cmpXyzService.exe" Guid="NOTAREAL-GUID-90X5-12C5-ABC123XYZ890">
    <File Id="file_XyzService.exe" KeyPath="yes" Source="$(var.SourceDir)\XyzService.exe" />
    <ServiceInstall Id="InstallXyzService" Name="Service.XYZ" DisplayName="XYZ Service" Start="auto" Vital="yes" Interactive="no" ErrorControl="normal" Type="ownProcess" />
    <ServiceControl Id="ServiceControlXyzService" Name="Service.XYZ" Start="install" Stop="both" Remove="uninstall" Wait="no"/>
</Component>

<CustomAction Id="SetPropertiesForService" Property="ServiceConfig" Value="[SERVICEINSTANCENAME],[CONFIGVALUE1],[CONFIGVALUE2]" />
<Binary Id="UpdateConfigFileCustomAction.CA.dll" SourceFile="$(var.UpdateConfigFileCustomActionDir)\UpdateConfigFileCustomAction.CA.dll" />
<CustomAction Id="ServiceConfig" BinaryKey="UpdateConfigFileCustomAction.CA.dll" DllEntry="EditConfigFile" Execute="deferred" Return="check" />

<InstallExecuteSequence>
  <Custom Action="SetPropertiesForService" Before="ServiceConfig" >NOT Installed</Custom>
  <Custom Action="ServiceConfig" After="InstallFiles" >NOT Installed</Custom>
</InstallExecuteSequence>

这是来自 Orca 的 InstallExecuteSequence 表的精简副本

停止服务版本NT 1900 删除服务版本NT 2000 删除文件 3500 安装文件 4000 未安装 SetPropertiesForService 4001 未安装 ServiceConfig 4002 安装服务版本NT 5800 开始服务版本NT 5900 注册用户 6000 注册产品 6100 MsiPublishAssemblies 6250 发布功能 6300 发布产品 6400 安装完成 6600 删除现有产品 6601

如果我删掉了一些重要的内容,我深表歉意 - 我不想倾倒我拥有的所有东西。我相信我已经包含了所有相关的内容。

【问题讨论】:

  • 您是否查看过 MSI 日志(您需要通过注册表或 msiexec 命令行上的 /l 开关启用 MSI 日志记录。)这将使您对什么顺序有更多的了解事情正在发生。
  • 嗨,斯蒂芬,是的,日志文件显示我的 CA 在 InstallServices 操作之前执行。我想知道 ServiceInstall 操作的行为是否与 InstallUtil.exe 完全一样?我们在 Installer 构造函数中有看起来不像正在执行的逻辑。
  • Yikes - 有谁知道这是否仍然是目前的状况?有一个在 WiX 3 中实现的 Bob (Arnason?) 的引用 - 这是一般的 ServiceInstall,还是处理安装程序类型的东西?
  • This caused a kerfuffle back in 2006。我确实找到了this workaround。基本上,WiX 无法识别 RunInstallerAttribute。

标签: .net wix


【解决方案1】:

根据最后的评论:

This caused a kerfuffle back in 2006。我确实找到了this workaround。基本上,WiX 无法识别 RunInstallerAttribute。

【讨论】:

猜你喜欢
  • 2019-02-22
  • 2011-03-15
  • 1970-01-01
  • 2011-10-24
  • 1970-01-01
  • 2011-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多