How can I overwrite an error message occured on cu

2019-02-25 08:40发布

I trigger an c# application by an custom action:

custom action

On failing condition, my application tells Install Shield to abort the installation process using an exit code:

static void Main(string[] args)
{
    if(false)
    {
        Environment.ExitCode = 1;
    }
}

Using this approach, Install shield´s setup displays an error message like expected:

enter image description here

How can I overwrite that error message by a custom text?

1条回答
冷血范
2楼-- · 2019-02-25 09:31

Reading between the lines here, it appears your custom action launches an EXE. If that is so, there is no way to do what you ask. You could show a message from your EXE before returning a non-zero exit code, but then Windows Installer would still show the Error 1722 message.

If you can instead run a function from a DLL, you have more options. Instead of returning errors, you'd be able to set properties (assuming this is an immediate mode action), and could use those properties to do further things, such as show another dialog, or exit the installation without the Error 1722 message. I don't think all the necessary configuration options are available in the limited edition - you certainly cannot edit dialogs in LE - so to do all of that, you would have to change to a more capable tool (including the Professional edition, or options from other vendors).

查看更多
登录 后发表回答