Coauthor: Vishwas S Gudiyavar

In this blog we are going to discuss how to install MQ on Windows using msiexec.exe.

IBM MQ can be installed on Windows using either GUI or MSIEXEC. MSIEXEC provides both an interactive installation and a non-interactive installation. An interactive installation displays panels and ask questions. And a non-interactive install takes the commands from command line and executes them in the background without asking/displaying anything to the user. Refer here to know more about MSIEXEC.

Scenario 1: Installing MQ on Windows for the first time

The below command installs MQ silently using msiexec.

msiexec /i path\MSI\IBM WebSphere MQ.msi /l*v c:\install.log /q TRANSFORMS=1033.mst AGREETOLICENSE=yes

“/i” parameter – specify the path of the *.msi file
“/q” parameter – installs MQ silently (non-interactive)
“/l*v” parameter – installation logs are written to the path specified here
TRANSFORMS=1033.mst – Transform file for US English Language. You can specify the required language by using the TRANSFORMS property in a property=value pair
Note : “AGREETOLICENSE=yes” is mandatory to install MQ, if you forget to mention this, installation fails silently.

Scenario 2: Installing MQ on Windows for the first time Using Response File

Alternatively, you can use the msiexec command with a parameter that calls a response file. A response file is an ASCII text file that contains the parameter values that you want to set for the installation. You can use response file to specify the installation parameters instead of providing them on command line. To do this create your response file (refer to the below example/refer here ) and provide the full path of it as “USEINI” parameter. For example, you can use response file and edit the default PGMFOLDER / DATFOLDER.

msiexec /i path\MSI\IBM WebSphere MQ.msi /l*v c:\install.log /q TRANSFORMS=1033.mst USEINI=C:\responsefile.ini

Response File (Eg) :-
[Response] PGMFOLDER=”c:\mqm”
DATFOLDER=”c:\mqm\data”
LOGFOLDER=”c:\mqm\log”
AGREETOLICENSE=”yes”
LAUNCHWIZ=””
ADDLOCAL=”Server,Client”

Scenario 3: Installing multiple instances of MQ on Windows

The following example shows how to install multiple instances (versions) of MQ using MSIEXEC silently (non-interactively). The installation is same as mentioned in scenario 1 except that we have to set the parameter MSINEWINSTANCE to 1 which indicates this is subsequent installation of MQ. Also provide TRANSFORMS=:InstanceId2.mst. The instance ID provided in transform should be available for use as mentioned in Choosing MSI Instance IDs for multiple installations. Here in this example we are choosing InstanceId2.mst and hence MSIInstanceID 2 should be free for use.

msiexec /i path\MSI\IBM WebSphere MQ.msi /l*v c:\install.log /q TRANSFORMS=:InstanceId2.mst;1033.mst AGREETOLICENSE=yes MSINEWINSTANCE=1

Scenario 4: Upgrading MQ on windows that has only one MQ instance installed

Note:Before upgrading or uninstalling MQ, ensure that you have, “Stopped all your IBM MQ applications, Shut down your listeners, Stopped all your queue managers and backed up your data”

If you are upgrading the only IBM MQ installation, where the installation has the default values, following command can be used.

msiexec /i path\MSI\IBM WebSphere MQ.msi /q AGREETOLICENSE=YES INSTALLATIONNAME="Installation1"

Scenario 5: Upgrading MQ on windows that has multiple MQ instance installed

If you are upgrading an installation on a machine that already has one or more IBM MQ installations of the level you are upgrading to, you must provide additional parameters to select a free MSI instance ID. Refer Choosing MSI Instance IDs for multiple installations. Following command shows an example upgrading MQ, here InstanceId 2 should be free to use. If you are upgrading from MQ 8 to MQ 9 and if the machine already has 2 instance of MQ 9 installed, each having MSIInstanceId 1 and 2 respectively, then you need to choose MSIInstanceId 3 and provide the same in TRANSFORMS.

msiexec /i path\MSI\IBM WebSphere MQ.msi /q AGREETOLICENSE=YES INSTALLATIONNAME="Installation2" NEWINSTANCE=1 TRANSFORMS=”:InstanceId2.mst;1033.mst”

Scenario6: Uninstalling MQ using MSIEXEC on Windows

Following are few commands which can be used to uninstall MQ :-

1) This command invokes an interactive installation giving you the option to remove queue manager data. Click Run to allow the uninstallation to continue.
msiexec /i "path\MSI\IBM WebSphere MQ.msi" REMOVE="All"

2) This command invokes a silent uninstall and does not remove any queue manager data.
msiexec /i "path\MSI\IBM WebSphere MQ.msi" /q REMOVE="All"

3) This command invokes a silent uninstall and removes queue manager data
msiexec /i "path\MSI\IBM WebSphere MQ.msi" /q REMOVE="All" KEEPQMDATA="delete"

4) This command invokes a silent uninstall and does not remove any queue manager data.
msiexec /x "path\MSI\IBM WebSphere MQ.msi" /q

5) To silently uninstall IBM WebSphere MQ using a response file, enter the following command:
msiexec /i "path\MSI\IBM WebSphere MQ.msi" /q USEINI="response_file"
where response_file is the file that contains the [Response] stanza and the required property=value pairs.
An example of a typical uninstallation response file is:
[Response] KEEPQMDATA=”delete”
REMOVE=”Server,Client”

Scenario 7: Uninstalling a specific installation of MQ on Windows silently

Following command is an example to uninstall a specific installation of MQ. To uninstall a specific instance you will have to specify the product code with “/x” switch. This can be used when multiple instances of MQ are installed in the system.

msiexec /x "product code" /q

TO find “product code”, run “dspmqinst” in command prompt which will list all the MQ installations. The parameter MSIProdCode in the listing is the product code to uninstall specific instance of MQ.

Eg: Following is the command to uninstall MQ 9002 using its product code fetched from dspmqinst
msiexec /x CB2E1CA6-BA62-4CE6-A8B8-0701B2A8B37F /q
dspmqinst output:-
InstName: Installation1
InstDesc:
Identifier: 1
InstPath: C:\Program Files\IBM\MQ
Version: 9.0.0.2
Primary: No
State: Available
MSIProdCode: {CB2E1CA6-BA62-4CE6-A8B8-0701B2A8B37F}
MSIMedia: 9.0 Server
MSIInstanceId: 1

Choosing MSI Instance IDs for multiple installations :-
Since MQ 7.1 multiple instance of MQ can be installed. In order to perform a non-interactive multiple installation using msiexec, you need to find out whether the instance ID you want to use is already in use or not and choose the appropriate one. For each installation media (for example, each 7.5 client and 7.5 server), Instance ID 1 is the default ID which is used for single installations. If you want to install alongside Instance ID 1 you need to specify which instance you want to use. If you have already installed instance 1, 2, and 3 then you need to find out what the next available instance is, for instance, Instance ID 4. Similarly, if instance 2 has been removed, you need to find out that there is a gap that can be reused. You can find out which Instance ID is currently in use using the dspmqinst command.

The following dspmqinst output shows that in case of MQ 8 (MSIMedia 8.0 Server) installation, Instance ID 1 and 3 are in use. Hence if you want to install another instance of MQ 8, you will have to choose Instance ID 2 or any number greater than 3. In case of MQ 9 installation, Instance ID 1 and 2 are in use. Hence if you want to install third instance of MQ 9, you will have to choose any number apart from 1 and 2.

dspmqinst output:-
InstName: Installation1
InstDesc:
Identifier: 1
InstPath: C:\Program Files\IBM\WebSphere MQ
Version: 8.0.0.5
Primary: Yes
State: Available
MSIProdCode: {74F6B169-7CE6-4EFB-8A03-2AA7B2DBB57C}
MSIMedia: 8.0 Server
MSIInstanceId: 1

InstName: Installation2
InstDesc:
Identifier: 2
InstPath: C:\Program Files\IBM\WebSphere MQ_1
Version: 8.0.0.5
Primary: No
State: Available
MSIProdCode:
MSIMedia: 8.0 Server
MSIInstanceId: 3

InstName: Installation3
InstDesc:
Identifier: 3
InstPath: C:\Program Files\IBM\MQ
Version: 9.0.0.1
Primary: No
State: Available
MSIProdCode: {80B9C730-0533-4060-A44B-16549476F111}
MSIMedia: 9.0 Server
MSIInstanceId: 1

InstName: Installation4
InstDesc:
Identifier: 4
InstPath: C:\Program Files\IBM\MQ_1
Version: 9.0.0.1
Primary: No
State: Available
MSIProdCode:
MSIMedia: 9.0 Server
MSIInstanceId: 2

1 comment on"Installing MQ using MSIEXEC on Windows"

  1. Harish Nallabothu March 09, 2018

    Good one

Join The Discussion

Your email address will not be published.