[ACCEPTED]-How to handle the .msi file with Inno Setup?-inno-setup

Accepted answer
Score: 28

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};

0

Score: 4

Note that: I'm using Inno Setup 5.5.3 on Windows 4 7, and that this code is for the Inno Setup 3 script in the run section. With this code 2 you can run msi files without any problems. Here 1 is the code:

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

Building on the answer @kobik gave. I had 2 to include the '.exe' in the Filename. Like 1 so:

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);
Score: 2

Although kobik's option to use "msiexec.exe 13 /i" in Run section generally works, we 12 faced a problem of admin right downgrade 11 with it:

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

When msiexec.exe /i file.msi runs 10 this way it requests the admin rights with 9 UAC (as expected, it is really required 8 in our case). But somewhere in the middle 7 of this installation part when "file.msi" is 6 trying to start a windows service it appeared 5 to be right-downgraded and have not enough 4 privileges to start windows service. However 3 when it's launched via shellexec it goes 2 ok without this problem. So this is how 1 it worked to me:

[Run]
Filename: "{tmp}\file.msi"; Flags: skipifsilent shellexec waituntilterminated hidewizard; 

More Related questions