title: Installing Microsoft Access Database Engine prerequisite without user intervention in Inno Setup
body: <p>I am continuing with my work in Inno Setup, So now I have a new questions about it.
  I am trying of to execute some programs before install my final application, for this purpose I am using <a href="http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_exec" rel="nofollow noreferrer"><code>Exec</code></a> function.</p>
  
  <p>When I try with the following code:</p>
  
  
  
  <pre class="lang-pascal prettyprint-override"><code>[Files]
  Source: "AccessDatabaseEngine_x64.exe"; DestDir: "{tmp}"; Flags: dontcopy noencryption
  Source: "Database.accdb"; DestDir: "{app}"; Flags: ignoreversion
  
  [Code]
  
  function PrepareToInstall(var NeedsRestart: Boolean): String;
  Var
    ResultCode: Integer;
  begin
     ExtractTemporaryFile('AccessDatabaseEngine_x64.exe');
     if Exec(ExpandConstant('{tmp}\AccessDatabaseEngine_x64.exe'), 'quit', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
     begin
        msgbox('True: {tmp}\AccessDatabaseEngine_x64.exe : ' + IntToStr(ResultCode), mbInformation, MB_OK);
     end
     else begin
        msgbox('False: {tmp}\AccessDatabaseEngine_x64.exe : ' + SysErrorMessage(ResultCode), mbInformation, MB_OK);      
     end;
  end;
  </code></pre>
  
  <p>I get this error:</p>
  
  <p><a href="https://i.stack.imgur.com/uxhT5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uxhT5.png" alt="enter image description here"></a></p>
  
  <p>On the other hand, if I use the follow code:</p>
  
  <pre class="lang-pascal prettyprint-override"><code>[Files]
  Source: "AccessDatabaseEngine_x64.exe"; DestDir: "{tmp}"; Flags: dontcopy noencryption
  Source: "Database.accdb"; DestDir: "{app}"; Flags: ignoreversion
  
  [Code]
  
  function PrepareToInstall(var NeedsRestart: Boolean): String;
  Var
    ResultCode: Integer;
  begin
     ExtractTemporaryFile('AccessDatabaseEngine_x64.exe');
     if Exec(ExpandConstant('{tmp}\AccessDatabaseEngine_x64.exe'), '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
     begin
        msgbox('True: {tmp}\AccessDatabaseEngine_x64.exe : ' + IntToStr(ResultCode), mbInformation, MB_OK);
     end
     else begin
        msgbox('False: {tmp}\AccessDatabaseEngine_x64.exe : ' + SysErrorMessage(ResultCode), mbInformation, MB_OK);      
     end;
  end;
  </code></pre>
  
  <p>I get the installation wizard of the another file. Some like this:</p>
  
  <p><a href="https://i.stack.imgur.com/4CBLk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4CBLk.png" alt="enter image description here"></a></p>
  
  <p>I want to install my other programs automatically, without user intervention.</p>
  
  <p>Is it possible? Can you help me?</p>
  
  <p>Thank for advance!</p>