WIX 中默认启用功能
在扩展我必须维护的 WIX 安装程序时,我遇到了以下问题 - 当显示功能和组件树时, 默认不选择产品功能。
我尝试了不同的变体,包括添加 InstallDefault ='local'
、TypicalDefault ='install'
和 Absent = 'disallow'
,但是,功能仍处于禁用状态。
以下是描述该功能的代码:
<Feature Id="Complete" Level="1"
Display='expand'
InstallDefault ='local'
TypicalDefault ='install'
Absent = 'disallow'
Title="$(var.ProductName)">
<ComponentGroupRef Id="Required_files"/>
<?ifdef InstallDriver?>
<ComponentGroupRef Id='driver_files'/>
<?endif?>
<ComponentRef Id="ProgramMenuShortcuts"/>
<ComponentRef Id="ProductInfo"/>
<?ifdef RemoveAllRegKeys?>
<ComponentRef Id="RegRemoveAll"/>
<?endif?>
<ComponentGroupRef Id="FBmodule"/>
</Feature>
检查日志后,我看到一些似乎与此相关的条目(当我手动将该功能设置为“安装到本地硬盘”时会发生这种情况)。
MSI (c) (FC:90) [16:43:57:559]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedFeature property. Its value is 'Complete'.
MSI (c) (FC:90) [16:43:57:559]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedAction property. Its value is '2'.
MSI (c) (FC:90) [16:43:57:559]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedCost property. Its value is '0'.
Action 16:43:57: FeaturesDlg. Dialog created
MSI (c) (FC:90) [16:51:44:645]: Note: 1: 2727 2:
.... many repetitions of Note: 1: 2727 2:
MSI (c) (FC:90) [16:51:45:146]: Note: 1: 2727 2:
MSI (c) (FC:90) [16:51:45:630]: Note: 1: 2205 2: 3: MsiAssembly
MSI (c) (FC:90) [16:51:45:630]: Note: 1: 2228 2: 3: MsiAssembly 4: SELECT `MsiAssembly`.`Attributes`, `MsiAssembly`.`File_Application`, `MsiAssembly`.`File_Manifest`, `Component`.`KeyPath` FROM `MsiAssembly`, `Component` WHERE `MsiAssembly`.`Component_` = `Component`.`Component` AND `MsiAssembly`.`Component_` = ?
MSI (c) (FC:90) [16:51:45:630]: Note: 1: 2205 2: 3: _RemoveFilePath
MSI (c) (FC:90) [16:51:45:639]: Note: 1: 2727 2:
MSI (c) (FC:90) [16:51:45:647]: PROPERTY CHANGE: Modifying MsiSelectionTreeSelectedAction property. Its current value is '2'. Its new value: '3'.
MSI (c) (FC:90) [16:51:45:647]: PROPERTY CHANGE: Modifying MsiSelectionTreeSelectedCost property. Its current value is '0'. Its new value: '7318'.
我怀疑这可能与安装程序中有一个自定义对话框有关 - 但在查看源代码后,我找不到任何表明功能状态与项目中其他内容之间关系的内容。
建议的故障排除步骤是什么?
这是完整安装日志。
While extending a WIX-installer that I have to maintain, I ran into the following problem - when shown the tree of features and components, the product feature is not selected by default.
I tried different variations, including adding InstallDefault ='local'
, TypicalDefault ='install'
, and Absent = 'disallow'
, however, the feature is still disabled.
Here is the code that describes the feature:
<Feature Id="Complete" Level="1"
Display='expand'
InstallDefault ='local'
TypicalDefault ='install'
Absent = 'disallow'
Title="$(var.ProductName)">
<ComponentGroupRef Id="Required_files"/>
<?ifdef InstallDriver?>
<ComponentGroupRef Id='driver_files'/>
<?endif?>
<ComponentRef Id="ProgramMenuShortcuts"/>
<ComponentRef Id="ProductInfo"/>
<?ifdef RemoveAllRegKeys?>
<ComponentRef Id="RegRemoveAll"/>
<?endif?>
<ComponentGroupRef Id="FBmodule"/>
</Feature>
Having examined the logs, I see some entries that seem to be related to this (this is happening when I manually set the feature to "install to local hard disk").
MSI (c) (FC:90) [16:43:57:559]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedFeature property. Its value is 'Complete'.
MSI (c) (FC:90) [16:43:57:559]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedAction property. Its value is '2'.
MSI (c) (FC:90) [16:43:57:559]: PROPERTY CHANGE: Adding MsiSelectionTreeSelectedCost property. Its value is '0'.
Action 16:43:57: FeaturesDlg. Dialog created
MSI (c) (FC:90) [16:51:44:645]: Note: 1: 2727 2:
.... many repetitions of Note: 1: 2727 2:
MSI (c) (FC:90) [16:51:45:146]: Note: 1: 2727 2:
MSI (c) (FC:90) [16:51:45:630]: Note: 1: 2205 2: 3: MsiAssembly
MSI (c) (FC:90) [16:51:45:630]: Note: 1: 2228 2: 3: MsiAssembly 4: SELECT `MsiAssembly`.`Attributes`, `MsiAssembly`.`File_Application`, `MsiAssembly`.`File_Manifest`, `Component`.`KeyPath` FROM `MsiAssembly`, `Component` WHERE `MsiAssembly`.`Component_` = `Component`.`Component` AND `MsiAssembly`.`Component_` = ?
MSI (c) (FC:90) [16:51:45:630]: Note: 1: 2205 2: 3: _RemoveFilePath
MSI (c) (FC:90) [16:51:45:639]: Note: 1: 2727 2:
MSI (c) (FC:90) [16:51:45:647]: PROPERTY CHANGE: Modifying MsiSelectionTreeSelectedAction property. Its current value is '2'. Its new value: '3'.
MSI (c) (FC:90) [16:51:45:647]: PROPERTY CHANGE: Modifying MsiSelectionTreeSelectedCost property. Its current value is '0'. Its new value: '7318'.
I suspect that this could be related to the fact that there is a custom dialog in the installer - but having looked through the source I could not find anything that would indicate a relationship between the state of the feature and something else in the project.
What are the recommended troubleshooting steps?
Here is the full installation log.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了罪魁祸首。安装程序本身没问题,问题在于它的启动方式。
我使用一个 BAT 文件进行测试,它使用一些模拟不同条件的命令行参数运行 MSI。
命令行参数 REINSTALL=ALL REINSTALLMODE=vomus 只能在安装程序更新程序时应用;当在干净的系统上以这种方式启动时 - 进度条移动并且一切都按预期进行,但实际上没有安装任何东西。
换句话说,错误出在测试方法上。
I found the culprit. The installer itself is fine, the problem is in how it is started.
There is a BAT file that I use for testing purposes, it runs the MSI with some command line arguments that simulate different conditions.
The command line arguments REINSTALL=ALL REINSTALLMODE=vomus must only be applied when the installer updates the program; when started that way on a clean system - the progress bar moves and everything goes as expected, but nothing is actually installed.
In other words, the error was in the method of testing.