Windows Installer error 1904

Article:TECH7296  |  Created: 2005-09-02  |  Updated: 2011-09-09  |  Article URL
Article Type
Technical Solution


Runtime error: Windows Installer error 1904 "Module [2] failed to register. HRESULT [3]" occurs during an .MSI-based installation.


All Windows Installer versions
All Windows* operating systems


The file in the error message cannot be registered on the target computer. This could be because:

  1. The file cannot be self-registered
  2. A dependency file is missing from the installation
  3. The file must be registered after other files in the same .MSI. Note: This can occur when your files must register after files included in a merge module.


Determine if the file can be registered by right-clicking on the file at its source and selecting Properties. Click the Version tab and look for an entry in the Item name list called OLESelfRegister. If that entry exists, then the file can be self-registered.

If that entry does not exist, then the file cannot be self-registered. In this case, go to Setup Editor > Tables > SelfReg. Right-click the row containing the file and select Delete Row(s).

To check for missing dependency files you can use a utility called the Dependency Walker. It is a free utility that you can download at Once you identify the dependency files, add the appropriate files to the .MSI package. Microsoft's DLL Help page can help you determine if a missing file is operating system specific or not (

If all dependency files are in the installation and the error still occurs, the error may be the result of not registering files in the correct order within your .MSI. File registration order can be modified using the Files page of Installation Expert:

  1. On the Installation Expert > Files page.
  2. Find the .DLL that you need to sequence, click it and then click Details. The File Details dialog appears.
  3. Switch the Registration Method from "Unordered" to "Use the order specified below"
  4. Select this option for all .DLLs. As you add .DLLs, you can switch the relative order.


If the .MSI is not missing dependent files and Windows Installer still fails to register a file, then manually register the .DLL.

To resolve the issue where Windows Installer simply cannot register .DLL, call regsvr32.exe in your installation:

  1. Go to MSI Script.
  2. Add an Execute Program from Destination custom action after InstallFinalize in the Execute Immediate tab.
  3. The Execute Program from Destination dialog appears. Fill in the following information:
    • Custom Action Name: Enter a name.
    • Working Directory: Enter SystemFolder.
    • EXE and Command Line: Enter the full path to regsvr32.exe and the full path to .DLL.
    • Example: [SystemFolder]regsvr32.exe [WindowsFolder]Test.DLL
  4. Accept all other defaults and click OK.

Legacy ID


Article URL

Terms of use for this information are found in Legal Notices