I am running custom action that suppose to execute some function in provided dll. this function connects to sql db and do some select with return, but i cannot see the return value. How can i debug this function in dll, or check if it is really executed.
-
1Never got money on installshield, so we're using NSIS, anyway if it is custom action which you own, you can either write logging info to to text file (with timestamp) or display message box in start of custom action, then attach visual studio to the process once messagebox is shown.Ondrej Svejdar– Ondrej Svejdar2013-06-25 07:56:32 +00:00Commented Jun 25, 2013 at 7:56
-
Thanks Ondrej Svejdar.Alexander Gorelik– Alexander Gorelik2013-06-26 07:36:42 +00:00Commented Jun 26, 2013 at 7:36
2 Answers
I've use C++ custom action DLLs, so I'm not entirely sure how a C# custom action DLL differs. However, I usually use the method Ondrej mentioned: logging to the MSI log file and/or message boxes that pause the custom action execution so I can attach to the process via Visual Studio.
Are you familiar with how that is done?
3 Comments
InstallShield has native SQL script handling for most of your needs. This will automatically give you a lot of logging in the MSI log file. However returning result sets is one thing it doesn't do.
The best thing to do is write your managed C# custom action using Windows Installer XML (WiX) Deployment Tools Foundation (DTF). This builds custom actions that appear as C++ custom actions to the Windows Installer and is fully compatible with InstallShield.
Inside of a DTF custom action you can use session.Log() to record useful debugging information in the Windows Installer log file. You can also attach a debugger to the custom action and step through it if you want. See the following for more information: