Perform Custom Action - WPF ClickOnce Deployment

4. May 2010

 

If you’d like your WPF application deployed via ClickOnce to execute a custom action the first time the application is run you can use the following code:

 

if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
{
      if (System.Deployment.Application.ApplicationDeployment.CurrentDeployment.IsFirstRun)
      {
                 // do some initialization here
       }
}

 

IsNetworkDeployed is a Boolean value indicating whether or not the application has been deployed via ClickOnce. IsFirstRun indicates whether this is the first time the application has been ran on the current machine. Be sure to add a reference to System.Deployment.

Enjoy!

.NET, WPF ,

Comments

5/6/2010 1:30:42 AM #
Pingback from topsy.com

Twitter Trackbacks for
        
        Brent Lamborn | Perform Custom Action - WPF ClickOnce Deployment
        [brentlamborn.com]
        on Topsy.com
Comments are closed