使用innosetup并希望显示错误/ msgbox,如果其中一个[RUN]进程没有返回进程代码0.我正在使用它进行授权过程,如果授权不成功,我想通知用户.
我有以下内容:
Filename: "{pf32}\Common Files\Authorization.exe"; Parameters: " "{code:GetAuthorizationFilePath}" /s"; WorkingDir: "{tmp}"; Flags: skipifdoesntexist hidewizard; StatusMsg: "Authorizing License";
Run Code Online (Sandbox Code Playgroud)
归还给我:
Process exit code:0
Run Code Online (Sandbox Code Playgroud)
0当然是成功的,但如果它不是0我想通知用户.
有没有办法做到这一点?
谢谢和问候,Kev84
我认为没有办法从这[Run]一部分实现这一目标.你能做的是:
Authorization.exe并在用户确认错误消息后终止它(然后设置将继续,例如执行该[Run]部分中的其他文件)这是Pascal脚本的代码示例; 你也可以查看commented version这段代码:
[Code]
function NextButtonClick(CurPageID: Integer): Boolean;
var
ResultCode: Integer;
begin
Result := True;
if CurPageID = wpWelcome then
begin
Result := False;
if Exec(ExpandConstant('{pf32}\Common Files\Authorization.exe'), '', '',
SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
if ResultCode = 0 then
Result := True
else
MsgBox('The authorization failed!', mbCriticalError, MB_OK);
end;
end;
end;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7642 次 |
| 最近记录: |