How to process .msi file using Inno Setup?

I have the following code installing Inno.

But how can I apply this similar function to a .msi file?

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; 
+6
source share
3 answers

Try the following:

 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}; 
+15
source

Based on @kobik's answer. I had to include ".exe" in the Filename. For instance:

 if not ShellExec('', 'msiexec.exe', ExpandConstant('{tmp}\package\file.msi'), '', SW_SHOWNORMAL, ewWaitUntilTerminated, ErrorCode) then MsgBox('Msi installer failed to run!' + #13#10 + ' ' + SysErrorMessage(ErrorCode), mbError, MB_OK); 
+5
source

Note : I am using Inno Setup 5.5.3 on Windows 7 and this code for the Inno Setup script is in the startup section. With this code you can run msi files without any problems. Here is the code:

 [Run] Filename: `{src}\PhysX.msi;` Description: Nvidia PhysX; Verb: open; Flags: shellexec postinstall waituntilterminated runascurrentuser skipifsilent 
+3
source

Source: https://habr.com/ru/post/908625/


All Articles