Detecting a ClickOnce Application
A: You can see if a ClickOnce application is running in the current AppDomain by checking the AppDomain.CurrentDomain.ActivationContext property. If that value is non-null, then the domain is running a ClickOnce application. The ActivationContext will also get you the name of that application. There may be situations (such as choosing an isolated storage scope), where having this information is necessary and useful.
For more info, visit http://blogs.msdn.com/shawnfa/archive/2006/01/20/514411.aspx