Is it possible to run a file with Inno Setup, before the setup beginns? Documentation
Asked
Active
Viewed 3.0k times
1 Answers
26
Yes it is. In the [code] section run the file in the InitializeSetup() function. This example launches notepad before the setup runs.
function InitializeSetup(): boolean;
var
ResultCode: integer;
begin
// Launch Notepad and wait for it to terminate
if Exec(ExpandConstant('{win}\notepad.exe'), '', '', SW_SHOW,
ewWaitUntilTerminated, ResultCode) then
begin
// handle success if necessary; ResultCode contains the exit code
end
else begin
// handle failure if necessary; ResultCode contains the error code
end;
// Proceed Setup
Result := True;
end;
-
This is what i needed! Thanks. – Stephan Schielke Aug 16 '10 at 13:42
-
23This should not be done in InitializeSetup if it changes anything on the users computer. This should be done after the user has pressed "Install", i.e. PrepareToInstall() or CurStepChanged(ssInstall). – Deanna Jul 25 '11 at 15:44