Determine if debugger is attached.

Got a problem you cannot solve? Try here.
Post Reply
bsweeney
Posts: 34
Joined: Fri Aug 27, 2010 1:51 pm

Determine if debugger is attached.

Post by bsweeney »

Is there a technique for determine if the debugger is attached? Maybe a compiler variable? I'd like to omit certain sections of script conditionally, only if i'm running the software from the IDE. Could i define my own compiler variable? Is there some other way I could accomplish this?

thanks,
brian
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Determine if debugger is attached.

Post by mills »

There isn't quite an equivalent to C++ #if DEBUG.

You could use compiler variables to simulate this pretty closely, though. (requires Studio edition or better)

You can find the compiler variables in the Project Settings->Compile Variables.

You'll probably want to set the default value to TRUE. Just remember to change it accordingly for non-debug testing and release.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
bsweeney
Posts: 34
Joined: Fri Aug 27, 2010 1:51 pm

Re: Determine if debugger is attached.

Post by bsweeney »

I like the sounds of this approach, thanks!
Post Reply