我有两个特点:
<Feature Id='BaseProductFeatures' Title='Feature 1' Level='1'>
<ComponentRef Id='WebAppVDirComponent'/>
<ComponentRef Id='someVDirComponent'/>
<ComponentRef Id='anotherWCFVDirComponent'/>
<ComponentGroupRef Id='group_IMPORTFOLDERFILES'/>
<ComponentGroupRef Id='group_WINSERVERFILES'/>
</Feature>
<Feature Id='SMSGWFeature' Title='Feature 2' Level='2'>
<ComponentGroupRef Id='group_SMSGWWEBAPPFILES'/>
</Feature>
在安装之前,我使用自定义操作将 INSTALLLEVEL 更改为 2:
[CustomAction]
public static ActionResult ChangeInstallLevel(Session session) {
session["INSTALLLEVEL"] = "2";
return ActionResult.Success;
}
已设置值,但未安装功能 2 (SMSGWFeature)。这是为什么?我没有在 ComponentGroupRef、group_SMSGWWEBAPPFILES 中看到任何组件,它们安装在我希望看到它们的目录中。但是如果我将功能级别 2 (SMSGWFeature) 设置为 1,安装程序将工作。
最佳答案
确保您的自定义操作在 InstallValidate 之前执行在 InstallExecuteSequence 中采取行动.在 InstallValidate 之后设置 INSTALLLEVEL 不会产生任何影响。
还有一个 verbose installation log极大地帮助确定是否以及为什么未安装功能或组件。只需在日志中搜索 InstallValidate 并检查功能和组件状态以及安装操作。
关于c# - INSTALLLEVEL 不安装功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8451515/