Error 2732 – Directory Manager not initialized

I was working with InstallShield 2011. It was a Basic MSI project. One of the features is to automatically show a checkbox in the final dialog of the installation to view the MSI logs, if MSI logging is enabled. This feature works if Windows Installer 4.0+ is installed in the target machine.

Now, if the installer fails during the LauchCondition action, the “Show the Windows Installer log” checkbox is checked and the wizard is closed, the following error is seen.

Error 2732 - Directory Manager not initialized

Searching at the InstallShield forums did not end up at a solution.

So, I started digging deeper to figure out a solution myself.

First, I found that the custom action that gets called on the “Finish” button click was ShowMsiLog

This action was not seen in Installation Designer | Behavior and Logic | Custom Actions and Sequences. So, I went to the Direct Editor and checked CustomAction table. Voila – There it was.

Type: 226. Name: ShowMsiLog.Now what does Type 226 mean? A quick look at MSDN gave some information about the Type field.

226 in binary is 11100010. The 6 least significant bits tells us the type of the custom action.

100010 in decimal is 34 – which means the custom action is “EXE file having a path referencing a directory”. And the Source column is a key to the Directory table. Sounds like the error is happening due to invoking a custom action that requires the Directory table to be completely constructed before it is actually done.

One solution that I could think of at that time was to change the custom action type to “EXE file having a path specified by a property value” (Type: 50), update the relevant entries and check if it works.

50 in binary is 110010. I did not want the execution scheduling and other options to be changed. So I got the binary value 11110010, which in decimal is 242. Type column was updated to 242.

Source column was set to NOTEPADPATH. I created a “Set Property” custom action, scheduled it before LaunchCondtion. I set NOTEPADPATH to [SystemFolder]\notepad.exe.

Target column refers to the command line argument that gets passed to the executable in Source column. It was set to [MsiLogFileLocation].

Recompiled the project and tested.

The problem was solved. 🙂

Posted in Installer | Tagged , | 2 Comments

int main()

My first post.

More than a year since I thought of starting this, I have finally kicked my laziness out and started writing this. I will make posts on interesting problems in everyday (code) development and how I solved them.

Happy reading!

Posted in Uncategorized | Leave a comment