Initializing an Application

[This is preliminary documentation and subject to change.]

To enable the Microsoft® Windows® installer functionality, there are a number of functions an application must call when it is initializing. The following steps describe how to use the installer to initialize an application:

    To initialize an application
  1. Call the MsiGetProductCode function so the application can identify itself to the installer.

    The product code is a required parameter for many installer functions.

  2. Call the MsiGetUserInfo function to collect user information the first time the application starts.

    If the call to MsiGetUserInfo fails, call the MsiCollectUserInfo function to collect user information.

  3. Display a default user interface, if necessary, by calling the MsiSetInternalUI function.

    To author your own user interface, register it with the installer by calling the MsiSetExternalUI function.

  4. Call the MsiEnableLog function to set the logging level.
  5. Present the user with available features by enumerating the features of your application. You can enumerate features in the following ways:
  6. Get detailed information about the current installation by calling the following enumeration functions repeatedly, incrementing an index variable for each call:

    If the return value on an enumeration function is ERROR_SUCCESS, there are still more items to be enumerated and the function should be called again with an incremented index variable. If the return value is ERROR_NO_MORE_ITEMS, then all of the items have been enumerated, and the function should not be called again.

For more information on initializing an application, see Initializing an Application and Installation Mechanism.