我想在Inno安裝程序開始安裝之前執行可執行文件(npp.exe
)。但我無法捕獲npp.exe
可執行文件的nextButton事件。有什麼辦法可以做到嗎?我試着用下面的代碼:在Inno Setup中捕獲其他安裝程序文件(如Notepad ++安裝程序)的事件
function initializeSetup(): boolean;
var
ResultCode: integer;
path: string;
begin
if Exec(('C:\Users\Paxcel\Downloads\npp.exe'), '', '', SW_SHOW,
ewWaitUntilTerminated, ResultCode) then
begin
//result code = 0 for successful installation
if (ResultCode = 0)then
begin
Result := True;
end
else
begin
Result := False;
end;
// handle success if necessary; ResultCode contains the exit code
end
else begin
MsgBox(SysErrorMessage(ResultCode),mbError,MB_OK);
Result := False;// handle failure if necessary; ResultCode contains the error code
end;
end;
在這段代碼中,我想捕捉記事本+ +設置的下一個按鈕。默認功能如NextButtonClick
不能使用。
@MartinPrikryl通過npp.exe文件的Next按鈕事件,他意味着旨在移動到安裝的下一步驟中,設置嚮導窗口上顯示的「下一步」按鈕。 – Ric
通常情況下這樣做是不明智的。相反,您應該靜默運行Notepad ++安裝程序,通過命令行或響應文件提供它需要的任何選項。在做這些事情之前,當然,您還需要檢查是否允許您的創建者重新打包Notepad ++。 – Miral