How to get an output of an Exec’ed program in Inno Setup?

Yes, use redirection of the standard output to a file: [Code] function NextButtonClick(CurPage: Integer): Boolean; var TmpFileName, ExecStdout: string; ResultCode: integer; begin if CurPage = wpWelcome then begin TmpFileName := ExpandConstant(‘{tmp}’) + ‘\ipconfig_results.txt’; Exec(‘cmd.exe’, ‘/C ipconfig /ALL > “‘ + TmpFileName + ‘”‘, ”, SW_HIDE, ewWaitUntilTerminated, ResultCode); if LoadStringFromFile(TmpFileName, ExecStdout) then begin MsgBox(ExecStdout, mbInformation, MB_OK); … Read more

Inno Setup: How to watch variables values or write to debug output?

There’s currently no debug watch window, but you can simply hover the variable you want to inspect, when the debugger is stopped on a breakpoint. To print something to a debug output, use the Log procedure: procedure InitializeWizard; var Value: Integer; begin Value := 123; Log(‘The Value is: ‘ + IntToStr(Value)); end; Here is the … Read more

Is it possible to accept custom command line parameters with Inno Setup

With InnoSetup 5.5.5 (and perhaps other versions), just pass whatever you want as a parameter, prefixed by a / c:\> myAppInstaller.exe /foo=wiggle and in your myApp.iss: [Setup] AppName = {param:foo|waggle} The |waggle provides a default value if no parameter matches. Inno setup is not case sensitive. This is a particularly nice way to handle command … Read more