A user-defined extension can detect which version of WebSphere® Message Broker is installed.
Use the following instructions in your installer scripts on Windows® to test for the following versions. To detect each version, look for the registry key given for each version. In the examples shown, x can be any integer.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ WebSphere MQ Integrator V2.1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ mqsi.studio\DisplayVersion = 5.x.x.x
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ mqsi.ib\DisplayVersion = 5.x.x.x
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ WMBT60\DisplayVersion = 6.x.x.x
The default working directory is %ALLUSERSPROFILE%\Application Data\IBM\MQSI where %ALLUSERSPROFILE% is the environment variable that defines the system working directory. With the default value of %ALLUSERSPROFILE%, the working directory is C:\Documents and Settings\All Users\Application Data\IBM\MQSI. The actual value might be different on your computer; use %ALLUSERSPROFILE% to ensure that you access the correct location.
Each line in the file is of the following format:
PATH_TO_INSTALLATION = VERSION_OF_INSTALLATION
For example, if you have installed Version 6.0 Fix Pack 5 in the default installation location, the line contains the following text:
C\:\\ Program\ Files\\IBM\\MQSI=6.0.0.5
The backslash character \ is interpreted as an escape character. It is inserted before each non-alphabetic and non-numeric character in the string to preserve the character. A colon, a space, and several backslash characters are escaped in this example.
Parse each line of the file to detect all the installed versions and the directory paths for the runtime components, and ignore all duplicates and non-existent directories.
Linux® and UNIX® systems do not have a common packaging method: you must check which files are present in the file system. Look for the files listed below for each version of WebSphere Message Broker that you want to detect.
Check for the presence of /usr/opt/mqsi/bin/mqsilist and
check that /usr/opt/mqsi/bin/mqsiprofile and /usr/opt/mqsi/bin/mqsisetdbparms are
not present.
On other Linux and UNIX systems, check for the presence of /opt/mqsi/bin/mqsilist, and make sure that opt/mqsi/bin/mqsiprofile and /opt/mqsi/bin/mqsisetdbparms are not present.
Check for the presence of /usr/opt/mqsi/bin/mqsilist.
Also check that /usr/opt/mqsi/bin/mqsiprofile is
not present.
On Linux and other UNIX systems, check for the presence of /opt/mqsi/bin/mqsilist, and make sure that opt/mqsi/bin/mqsiprofile is not present.
To detect Version 6 and later toolkits, look for the existence of /etc/IBM/WebSphereMessageBrokersToolkit/products/com.ibm.wbmt.
if [ -e /etc/IBM/WebSphereMessageBrokersToolkit/products/com.ibm.webt ] # Event Broker installed if [ -e `grep location /etc/IBM/WebSphereMessageBrokersToolkit/products/ com.ibm.webt | sed 's/location=//'`/webt_prod/version.txt` ] # it is FP1 or greater get version from version.txt else #version is 6.0 fi fi if [ -e /etc/IBM/WebSphereMessageBrokersToolkit/products/com.ibm.wmbt ] # Message Broker installed if [ -e `grep location /etc/IBM/WebSphereMessageBrokersToolkit/products/ com.ibm.wmbt | sed 's/location=//'`/wmbt_prod/version.txt` ] #It is FP1 or greater get version from version.txt else #version is 6.0 fi fi
To detect Version 6.0 and later runtime components, look for the file /var/mqsi/install.properties. Each line in this file contains an installation path and V.R.M.F version information.