PC Review


Reply
Thread Tools Rate Thread

Debugging A setup project ? how to debug the 'Custom actions' dll functions ?

 
 
Sagaert Johan
Guest
Posts: n/a
 
      20th May 2004
I have a solution that contains :
-ppc application
-msi setup project
-classlib that contains functions called from the msi setup 'custom actions'
events.

The setup program works, and the functions in the classlib execute normaly.

Now i would like to debug the code in the classlib.
I have set the debug properties of the classlib to 'program' and i have
selected the 'msi setup' output setup.exe as the application to run. However
when i start debugging, the breakpoints i have set in the classlib
(Installer_AfterInstall and
Installer_AfterUnInstall) are never hit. (but the code executes)



How can i debug my classlib ?



Regards

Johan



 
Reply With Quote
 
 
 
 
Neville Lang
Guest
Posts: n/a
 
      21st May 2004
Sagaert,

In the past, I too has the need to debug the methods pointed to from custom
actions. It took a while to research and figure it out but here is how I do
it.

The key to it is that you can start the debugger manually once your full
..NET Framework method has halted. In order to halt you method, you need to
add a temporary MessageBox.Show("whatever"); near the top of your method
that you want to debug. After the Winodws Setup.exe has completed, it checks
if there are any custom actions and if so, it makes the call to your method.
The MessageBox will display and halt processing waiting for user input. At
this point, you need to do the following steps to get the VS. NET 2003
Debugger started to begin debugging your method. Here is a snippet from my
notes:

/// When debugging a call to the Custom Action methods, ensure the
/// MessageBox line is activated in your code. When the Windows
/// Install/Uninstall runs and displays this MessageBox at runtime,
/// do the following:
/// a) Alt-Tab to Visual Studio .NET 2003
/// b) Click on the the Debug menu item
/// c) Click on Processes...
/// d) Locate msiexec.exe with Type .NET and click on it to highlight it
/// e) Click on the Attach button
/// f) Ensure Common Language Runtime is ticked then click on OK
/// g) Check that that msiexec.exe now appears in the list of Debugged
Processes
/// h) Click on the Close button
/// i) Press F9 to set a breakpoint on a line in your method
/// j) Alt-tab back to the MessageBox then click on the OK button to begin
the Debugger
/// It will then stop at your breakpoint ready to step through.

NOTE: Ensure that your method in your DLL has been compiled first in Debug
mode and not Release mode and that the Custom Actions are pointing to the
debug version of your DLL.

I hope this helps you.

Regards,
Neville Lang



"Sagaert Johan" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I have a solution that contains :
> -ppc application
> -msi setup project
> -classlib that contains functions called from the msi setup 'custom

actions'
> events.
>
> The setup program works, and the functions in the classlib execute

normaly.
>
> Now i would like to debug the code in the classlib.
> I have set the debug properties of the classlib to 'program' and i have
> selected the 'msi setup' output setup.exe as the application to run.

However
> when i start debugging, the breakpoints i have set in the classlib
> (Installer_AfterInstall and
> Installer_AfterUnInstall) are never hit. (but the code executes)
>
>
>
> How can i debug my classlib ?
>
>
>
> Regards
>
> Johan
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
localization in the setup custom actions =?Utf-8?B?bGQ=?= Microsoft C# .NET 0 19th Jul 2006 09:03 PM
ASP.NET web setup, custom actions, windows installer SDK lyl209@gmail.com Microsoft ASP .NET 1 22nd May 2006 04:46 PM
Custom actions in deployment project Jonas Bergman Microsoft Dot NET 2 5th Jun 2004 08:05 PM
Custom Actions for .NET project setups Microsoft C# .NET 1 3rd Feb 2004 03:47 PM
Custom Actions for .NET project setups Microsoft Dot NET Framework 1 3rd Feb 2004 03:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 PM.