About Windows Installer, the .NET Framework, and Visual Studio.
Debugging custom actions isn't exactly the easiest action to do; Windows Installer spawns separate processes - remoting servers - to run in-process custom actions. Any opportunity to diagnose issues without debugging can be helpful.
For example, an issue that comes up from time to time is leaked handles. A Windows Installer debug log might show something similar to the following:
MSI (s) (CC:1C) [17:40:29:055]: Doing action: MyCustomActionMSI (s) (CC:58) [17:40:29:165]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI1B.tmp, Entrypoint: MyCustomActionAction start 17:40:29: MyCustomAction.MSI (s) (CC:58) [17:40:29:906]: Leaked MSIHANDLE (219) of type 790531 for thread 3676MSI (s) (CC:58) [17:40:29:906]: Leaked MSIHANDLE (190) of type 790540 for thread 3676MSI (s) (CC:58) [17:40:29:906]: Leaked MSIHANDLE (189) of type 790540 for thread 3676MSI (s) (CC:58) [17:40:29:906]: Leaked MSIHANDLE (188) of type 790540 for thread 3676MSI (s) (CC:58) [17:40:29:906]: Leaked MSIHANDLE (179) of type 790541 for thread 3676MSI (s) (CC:58) [17:40:29:906]: Note: 1: 2769 2: MyCustomAction 3: 5 DEBUG: Error 2769: Custom Action MyCustomAction did not close 5 Action ended 17:40:30: MyCustomAction. Return value 3.
Windows Installer provides a clue in the log that can help with a code review. The Windows Installer team has provided the following information:
With this knowledge, you should be able to review your code and spot cause of the issue.
PingBack from http://msdnrss.thecoderblogs.com/2008/02/12/
[msi] カスタムアクションのデバッグ:MSIHANDLEのリークの検出
Silly question time.... are those values for the types actually documented anywhere other then this blog? I don't recall ever reading it in the SDK, in any header files and any other web pages.
I'm glad you shared this tidbit, but it just goes to show how you have to work inside the firewall to get access to useful information.