Runtime error: Windows Installer error 1904 "Module  failed to register. HRESULT " occurs during an .MSI-based installation.
The file in the error message cannot be registered on the target computer. This could be because:
- The file cannot be self-registered
- A dependency file is missing from the installation
- 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.
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 http://www.DependencyWalker.com. 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 (http://support.microsoft.com/dllhelp).
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:
- On the Installation Expert > Files page.
- Find the .DLL that you need to sequence, click it and then click Details. The File Details dialog appears.
- Switch the Registration Method from "Unordered" to "Use the order specified below"
- Select this option for all .DLLs. As you add .DLLs, you can switch the relative order.
To resolve the issue where Windows Installer simply cannot register .DLL, call regsvr32.exe in your installation:
- Go to MSI Script.
- Add an Execute Program from Destination custom action after InstallFinalize in the Execute Immediate tab.
- 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
- Accept all other defaults and click OK.
All Windows Installer versions
All Windows* operating systems