2010-07-08 100 views
1

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

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

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

回答

0

一种可能性是实现您自己的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; 
0

我做了InnoSetup中Uninstall.pas的代码审查,目前没有办法做你想做的事情。