Capturing events of another installer file like Notepad ++ setup in Inno Setup

I want to execute the executable ( npp.exe

) before starting installation in Inno Setup. But I am unable to capture the nextButton event of the executable npp.exe

. Is there a way to do this? I've tried with the following code:

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;

      

In this code, I want to record the following button in Notepad ++ program. You cannot use the default functions such as NextButtonClick

.

+3


source to share


1 answer


Notepad ++ uses NSIS installer.

If you want to run (any) NSIS installer silently, use /S

the command line switch.

See Using the NSIS Installer .




Btw, I am assuming the path C:\Users\Paxcel\Downloads

is for testing purposes only. In a real installer, you need to build the dependency into your installer and extract it into a temporary directory to run it.

Inno Setup can do all of this for you, you usually don't need to specify this yourself using Pascal Scripting.

[Run]
Source: "path\npp.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall

[Run]
Filename: "{tmp}\npp.exe"; Parameters: "/S"

      

+2


source







All Articles