Windows 7中的自定义UI中的简单WiX自定义操作将提前结束 [英] Simple WiX Custom Action in Custom UI Ends Prematurely with Windows 7

查看:206
本文介绍了Windows 7中的自定义UI中的简单WiX自定义操作将提前结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用自定义操作"时,我的WiX安装程序UI出现错误. 有趣的是,安装程序在Windows 10中可以正常运行,但是在Windows 7上启动时,安装程​​序会被中断.

My WiX installer UI is getting error while using the Custom Action. Interesting part is, the installer is working fine in Windows 10 but while launching it on Windows 7, installer is getting interrupted.

在安装程序日志中,错误代码显示为2896. 进一步搜索错误代码,指出我可能是.net框架版本不匹配.所以我将我的CustomAction.config修改如下:

From the installer logs, the error code is displayed 2896. Googling further the error code, pointed me that it could be the mismatch of .net framework version. So I modified my CustomAction.config as follows :

<startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" />
        <supportedRuntime version="v3.0" />
        <supportedRuntime version="v3.5" />
        <supportedRuntime version="v2.0.50727"/>

</startup>

我通过使用以下命令验证了已安装的版本:

I verified the installed version through using following command :

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP"

我这里还有其他东西吗?

is there something else am I missing here ?

这是自定义操作代码,供您参考:

Here is the custom action code for your reference :

namespace ValidateIP
{
    public class CustomActions
    {
        [CustomAction]
        public static ActionResult ValidateIP(Session session)
        {
            session.Log("Begin ValidateIP");
            if (string.IsNullOrEmpty(session["IPVAL"]))
            {
                session["VALIDIP"] = "0";
            }
            else
            {
                session["VALIDIP"] = "1";
            }
            return ActionResult.Success;
        }
    }
}

推荐答案

因此,事实证明,尽管我在CustomAction.config文件中使用了不同的.Net版本,但是在Custom Action项目中,目标.Net版本却是4.5 .因此,它取代了config属性.一旦将其降低到3.5,它便开始工作. 谢谢大家的所有建议.

So it turns out that although I was using the different .Net version in my CustomAction.config file, but in Custom Action project the targeted .Net version was 4.5. So it was superseding the config properties. Once I reduced it to 3.5, it started working. Thanks everyone for all the suggestion.

这篇关于Windows 7中的自定义UI中的简单WiX自定义操作将提前结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆