How to run a file before setup with Inno Setup

Viewed 30164

Is it possible to run a file with Inno Setup, before the setup beginns? Documentation

2 Answers
[Code]
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
   ResultCode: integer;
begin
   ExtractTemporaryFile('卸载.bat');
   if Exec(ExpandConstant('{tmp}\卸载.bat'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
   begin
   end
   else begin
   end;
   
end;

detail image

Related