1
votes

I spent time searching for an answer but still can't quite figure this out.

I have this MSI file that I can run this command to silent install it.

msiexec.exe /i theapp.msi /q INSTALLDIR=C:\myapp [email protected]

With Inno, I attempted the following and my MSI will not silently install. What I do receive is this window image will pop up automatically so obvious there is a probleming passing the commands to the msiexec process.

#define MyAppName "fooApp"
#define MyAppVersion "1.0"
#define MyAppPublisher "fooUser"
#define MyAppURL "http://foo.com"
#define MyAppExeName "MyProg.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{E633BAE8-81C7-4190-9964-D86287FAA8F4}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
CreateAppDir=no
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
ShowTasksTreeLines=True

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "D:\theapp.msi"; DestDir: "    {tmp}";
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Run]
Filename: "msiexec.exe"; Parameters: "/i /q [email protected]    {tmp}\theapp.msi"""; Flags: runascurrentuser shellexec

Underneath the [Run] section if I use this line I the MSI is launched correctly in interactive mode where the user will fill in the parameters manually which I don't want the m doing.

Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\theapp.msi"""

In another post, I saw someone mention to use this function but I couldn't find any sample code on how to actually use it.

function ParamStr(Index: Integer):

Thanks for any direction here.

2
Since posting this one solution that I figured out is to use this command Filename: "msiexec.exe"; Parameters: "/i {tmp}\theapp.msi /qb [email protected]"; Flags: runascurrentuser shellexec I am curious what other ways there are to do this. - practice every day
Convert your comment to the answer since you figured it out. By the way, what is the point in using Inno Setup to install MSI? - Alexey Ivanov
The MSI was given to me by a third party and the requirement given was that I had to use INNO to pass in parameters and automatically do things automatically after the MSI was installed but before the INNO setup was done. Personally, I wanted to use Qwerty.MSI to hard code everything in the MSI directly but that wasn't allowed. - practice every day

2 Answers

0
votes

Here is one way I figured out how to do what I wanted to do.

Filename: "msiexec.exe"; Parameters: "/i {tmp}\theapp.msi /qb [email protected]"; Flags: runascurrentuser shellexec
0
votes

Use "/passive" parameter on "msiexec.exe" line.

Example: Source: "D:\Onedrive\vbfiles\InstaladorCrystal\CRRedist2005_x86.msi"; DestDir: {tmp}; CopyMode: alwaysoverwrite;

Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\CRRedist2005_x86.msi"" /passive"; WorkingDir: "{tmp}"; StatusMsg: "Installing Crystal Reports 32bits..."; Check: not IsWin64(); Flags: skipifsilent