Question 1

What is the correct way to find whether a certain product (msi based setup) is installed on the machine?

Answer 1

Searching for Existing Applications, Files, Registry Entries or .ini File Entries [Windows Installer] lists the built-in detect methods. In this case, the CompLocator Table [Windows Installer] is intended to have the needed functionality.

To find the ComponentId for the CompLocator row,

  1. use Orca to open the MSI of the targeted product
  2. find the key binary dependency in the file table
    1. select the file table from the Tables window
    2. Choose Edit | Find from the menu
    3. In the Find dialog, type in the name of the file that you have a binary dependency on into the Find what edit box then click the Find Next button
    4. Continue to hit Find Next on the Find dialog until a row in the file table will be highlighted so click the Cancel button on the Find dialog
  3. copy the Component_ column value from the file table
    1. Select the second column of highlighted row and choose Edit | Copy cell menu item
  4. find the component in the component table
    1. select the component table from the Tables window
    2. Choose Edit | Find from the menu
    3. In the Find dialog, paste the value from step 3 into the Find what edit box then click the Find Next button
    4. Continue to hit Find Next on the Find dialog until a row in the component table will be highlighted so click the Cancel button on the Find dialog
  5. Grab the GUID from the ComponentId
    1. Select the second column of highlighted row and choose Edit | Copy cell menu item
[Author: Robert Flaming]
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.