View Full Version : Custom Action is not running.....

John Morley
07-13-2010, 04:33 PM

I specify two Custom Actions in my Install, one is 'After File Transfer', and does not seem to be running, and the other is 'After Setup Is Complete', and does seem to be working properly. Both Custom Actions are executables that I wrote, and I've got some diagnostics in each of them to let me know they are being run. One runs successfully, and the other does not. Neither needs to wait for completion or anything like that.

Is there some kind of Install time logging that will tell me if my CA is being launched? Or, how do I troubleshoot this issue?



07-14-2010, 08:25 AM
Yes, you can have a verbose log created by running the installation from the command line and specifying something like this:

Setup.exe /v"/l*v \"c:\MyLog.log\""


msiexec /i "C:\package.msi" /l*v "d:\MyLog.log"

The log is a good place to start when troubleshooting something like this.

John Morley
07-15-2010, 03:24 PM
Hi Debbie,

I can see that my Custom Action that isn't working is being invoked in the install log. Here is the pertinent section

MSI (s) (5C:5C) [15:59:49:182]: Doing action: InstallTIMDrivers
Action 15:59:49: InstallTIMDrivers.
Action start 15:59:49: InstallTIMDrivers.
Action ended 15:59:49: InstallTIMDrivers. Return value 1.

I can explore the installation disk and run the executable manually and it works fine, so I'm not sure why ISE is not able to run it as a CA??

My CA that is working shows up like this in the log:

MSI (c) (34:48) [15:59:57:794]: Doing action: CopyFiles
Action 15:59:57: CopyFiles.
Action start 15:59:57: CopyFiles.
MSI (c) (34:48) [15:59:57:794]: PROPERTY CHANGE: Adding CopyFiles property. Its value is 'CopyFiles'.
Action ended 15:59:57: CopyFiles. Return value 0.

I note that the return value for the non-working CA is '1', while the working CA returns '0'. Is that significant?



07-19-2010, 08:30 AM
Well, the Windows Installer documentation for logging indicates that return value 0 is "function not called" and 1 is "an action completed successfully."
That seems odd, given your observations of which action seemed to work, and which one did not.

Do these custom actions require anything that is installed with the product? How did you configure the settings for these actions in your project?

Can you try posting the entire log file? The snippets do not contain enough information to diagnose the problem.


John Morley
07-21-2010, 03:01 PM
Hi Debbie,

Each executable does require some additional files. One executable copies some customer specific data files from the installation CD to the target system (this one works!), and the other installs some hardware drivers on the target machine (and doesn't work!)......

The Custom Action that doesn't work can be invoked manually from the installation CD and works just fine, but does nothing (apparently) when run as a CA from the installer.

The full log file is an attachment.



07-21-2010, 10:43 PM
The verbose log for the installation does not provide much information that helps identifying your issue. So I would recommend that you debug your code by logging your own debug messages for your custom action using the MsiProcessMessage API with INSTALLMESSAGE_INFO (http://msdn.microsoft.com/en-us/library/aa370354(VS.85).aspx) or displaying your own debug messages using the MessageBox API (http://msdn.microsoft.com/en-us/library/ms645505(v=VS.85).aspx).

Hope that helps.