Twitter <%=Resources.labels.subscribe %>

Perform Custom Action - WPF ClickOnce Deployment

  •  

    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!

    Tags: ,

    Permalink |

Pingbacks and trackbacks (1)+

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading


Intro

My name is Brent Lamborn. I´m 35 years old and I live in Nebraska. I've been coding with the .NET Framework since 2003. I'm a former Marine and I have 5 boys.


View Brent Lamborn's LinkedIn profileView Brent Lamborn's profile

Sponsored By

Categories

Tag Cloud

Blog Roll