YumYumYum YumYumYum - 4 months ago 24
Pascal Question

How to handle the msi file with Innosetup?

I have this following code with innosetup, but how can i apply this similar function to it?

msiexec /I "\package\file.msi" /qb
? how?

procedure AfterMyProgInstall(S: String);
var
ErrorCode: Integer;
begin
//MsgBox('Please wait the libraries are getting installed, without the libraries it wont work.', mbInformation, MB_OK);
ExtractTemporaryFile(S);
//SW_SHOW, SW_SHOWNORMAL, SW_SHOWMAXIMIZED, SW_SHOWMINIMIZED, SW_SHOWMINNOACTIVE, SW_HIDE
ShellExec('', ExpandConstant('{app}\package\' + S), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ErrorCode);

end;

Answer

Try this:

ShellExec('', 'msiexec.exe',
  ExpandConstant('/I "{tmp}\package\file.msi" /qb'),
  '', SW_SHOWNORMAL, ewWaitUntilTerminated, ErrorCode);

Or:

[Files]
Source: file.msi; DestDir: {tmp}; Flags: deleteafterinstall;

[Run]
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\file.msi"" /qb"; WorkingDir: {tmp};