gpt4 book ai didi

inno-setup - 如何在 Inno Setup 中设置退出代码?

转载 作者:行者123 更新时间:2023-12-04 09:44:02 24 4
gpt4 key购买 nike

我想为我的安装设置退出代码,这样我就知道为什么安装被中止了。我正在使用 Inno Setup。

最佳答案

来自 Inno Setup 帮助文档 ( from the article "Setup Exit Codes" ):

Beginning with Inno Setup 3.0.3, the Setup program may return one of the following exit codes:

0 Setup was successfully run to completion.

1 Setup failed to initialize.

2 The user clicked Cancel in the wizard before the actual installation started, or chose "No" on the opening "This will install..." message box.

3 A fatal error occurred while preparing to move to the next installation phase (for example, from displaying the pre-installation wizard pages to the actual installation process). This should never happen except under the most unusual of circumstances, such as running out of memory or Windows resources.

4 A fatal error occurred during the actual installation process.

Note: Errors that cause an Abort-Retry-Ignore box to be displayed are not fatal errors. If the user chooses Abort at such a message box, exit code 5 will be returned.

5 The user clicked Cancel during the actual installation process, or chose Abort at an Abort-Retry-Ignore box.

6 The Setup process was forcefully terminated by the debugger (Run | Terminate was used in the IDE).



您可以通过确认退出代码是 0 来轻松检查设置是否成功运行。 .此外:

Any non-zero exit code indicates that Setup was not run to completion.



要更具体地回答您的问题,您可以通过观察退出代码 2 来确定安装已取消。或 5 .

如果您希望在 Inno 返回时返回自定义退出代码 0 ,您可以定义以下事件函数:
function GetCustomSetupExitCode: Integer;

来自帮助文档( from the article "Pascal Scripting: Event Functions" ):

function GetCustomSetupExitCode: Integer;

Return a non zero number to instruct Setup to return a custom exit code. This function is only called if Setup was successfully run to completion and the exit code would have been 0.

关于inno-setup - 如何在 Inno Setup 中设置退出代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2013112/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com