在WIX自定义操作中,是否有一种方法可以检测/silent或/quiet命令行开关是否调用了MSI?基本上,我想要的是不执行自定义操作(因为它显示一个表单),或者在这些命令行开关被传递时以不同的方式处理它,但是我无法找到它。
有什么办法可以检测到吗?
发布于 2018-11-01 22:41:19
我终于想出来了。Wix基本上总是将UILevel属性设置为2.0。它有自己的属性,名为WixBundleUILevel。现在重要的是,在WiX3.11之前,这个WixBundleUILevel是一个内部属性,不能被Bundle项目或MSI自定义操作访问。所以我就是这么做的
最后,在自定义操作中,我检查以下属性
int uiLevel;
                if (int.TryParse(session["UI_LEVEL"], out uiLevel))
                {
                    if (uiLevel == 4)
                        using (var form = new WhatsNew())
                        {
                            form.ShowDialog();
                        }
                    else
                        session.Log("Skipping What's new dialogue as UI Level is not 4");
                }
                else
                {
                    session.Log("Couldnt figure out the UI level, so skipped the prompt");
                }最后
here are the possible values of this f**ed up property
                WixBundleUILevel              Value     Burn parameters
                BOOTSTRAPPER_DISPLAY_FULL       4         (none)
                BOOTSTRAPPER_DISPLAY_PASSIVE    3         /silent
                BOOTSTRAPPER_DISPLAY_NONE       2         /quiet发布于 2018-10-25 09:14:01
您可以根据条件检查属性UILevel并执行CA。
https://stackoverflow.com/questions/52978077
复制相似问题