如何在Inno-Setup中设置卸载退出代码?

发布于 2024-09-09 02:42:40 字数 201 浏览 4 评论 0原文

我想在 Inno Setup 中设置卸载的退出代码。通过这样做,我希望 Inno Setup 向用户显示某种“卸载失败”对话框。

我知道可以通过 GetCustomSetupExitCode 函数定义安装的自定义退出代码。

是否可以通知 Inno Setup 自定义卸载过程失败,并防止 Inno Setup 无论发生什么情况都显示愚蠢的“卸载成功”消息?

I would like to set the exit code for my uninstallation in Inno Setup. By doing this I want the Inno Setup to show some sort of "uninstallation failed" dialog box to the user.

I know that defining custom exit code for installation can be done via GetCustomSetupExitCode function.

Is it possible to notify Inno Setup that the custom uninstallation procedure has failed and to prevent Inno Setup from showing the silly "Uninstall Successful" message no matter what happens?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

似最初 2024-09-16 02:42:40

我对 InnoSetup 中的 Uninstall.pas 进行了代码审查,目前无法执行您想要执行的操作。

I did a code review of the Uninstall.pas in InnoSetup and there is currently no way to do what you would like to do.

心头的小情儿 2024-09-16 02:42:40

一种可能性是实现您自己的 Pascal 脚本。可能在 DeinitializeUninstall() 事件中(查看手册以准确了解您想要的步骤),您可以添加以下代码:

[Code]
var error: Boolean;

procedure ExitProcess(exitCode:integer);
  external '[email protected] stdcall';

procedure TheEventYouFeelIsBetterHere():
begin
 if error then begin
   MsgBox('Installation Failed!', mbError, MB_OK);
   ExitProcess(1);
 end;
end;

One possibility is to Implement your own Pascal Script. Probably in DeinitializeUninstall() event, (check the manual to know exactly in which step you want it), you can add these code:

[Code]
var error: Boolean;

procedure ExitProcess(exitCode:integer);
  external '[email protected] stdcall';

procedure TheEventYouFeelIsBetterHere():
begin
 if error then begin
   MsgBox('Installation Failed!', mbError, MB_OK);
   ExitProcess(1);
 end;
end;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文