如何从CustomAction获取返回码? [英] How can I get the return code from a CustomAction?

查看:67
本文介绍了如何从CustomAction获取返回码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中有以下CustomAction:

I have the following CustomAction in my project:

<CustomAction Id="InstallDriver"
                  Return="check"
                  Execute="deferred"
                  Impersonate="no"
                  FileKey="FileDriverInst"
                  ExeCommand="-install" />

<InstallExecuteSequence>
    <Custom Action="InstallDriver" Before="InstallServices" />
</InstallExecuteSequence>

安装驱动程序的程序会生成有用的返回码,例如,如果由于系统需要而导致安装失败

The program that installs the driver produces useful return codes, for example if the installation failed because the system needs to be restarted following a previous driver uninstall.

当前如果返回除成功以外的任何内容,我将收到一个对话框,提示作为安装程序一部分运行的程序未完成符合预期。,则安装失败。

Currently if anything other than success is returned, I get a dialog saying 'A program run as part of the setup did not finish as expected.' and the installation fails. This is not optimal.

如何获取和处理返回码?

How can I get and handle return codes?

推荐答案

Windows Installer不支持处理自定义操作返回值。

Windows Installer doesn't support handling custom action return values.

对于EXE自定义操作,非零返回值被解释为错误,并且安装停止。只有win32 DLL或VBScript自定义操作才能通过其返回代码,但仍然非常有限。

For an EXE custom action a non-zero return value is interpreted as an error and the installation stops. Only a win32 DLL or VBScript custom action can change the installation behavior through its return code, but it's still very limited.

如果要在安装后重新启动计算机,可以设置 REBOOT 属性。

If you want to reboot the machine after install, you can set the REBOOT property.

这篇关于如何从CustomAction获取返回码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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