c# - INSTALLLEVEL 不安装功能

标签 c# windows installation wix windows-installer

我有两个特点:

    <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/

相关文章:

c# - VS2017 具有新的 getter/setter 语法 : How to write multiple lines in the setter?/

Windows 安装程序在安装 git 时挂起

Golang `go get` - 找不到任何包

c# - 在 64 位机器上基于 AnyCPU 与 x64 平台构建的 C# 应用程序的性能

c# - 如何在 ASP.NET Web.Api 中运行后台任务?

c# - 哪种代码是更好的编程风格

c# - 我可以使用 OleDbConnection Excel ACE 驱动程序从不可搜索的 System.IO.Stream 而不是文件中读取 Excel 文件吗?

Windows 上的 c++ 程序 (g++)。 main() 没有启动

python - 在 Cython 中外部定义 _Dcomplex

mongodb - 从 cloudify 安装 MongoDB 时收到 ZipException