Is there a simple way to detect the first launch of a new click-once application version? IE: I have published version 1, and then I publish 1.1. On the first launch of version 1.1 I would like to perform a one time process when it's launching.
Thanks,
Mark
Check this:
if(System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed && System.Deployment.Application.ApplicationDeployment.IsFirstRun)
{
//do something
}
About IsFirstRun from msdn:
Type: System.Boolean true if this version of the application has never run on the client computer before; otherwise, false.
The simplest solution would be to store the application version (ApplicationDeployment.CurrentDeployment.CurrentVersion
) in a configuration value. If the number is different from the configuration value when you launch, then you know that it's been upgraded (or downgraded, but that should be easy enough to determine).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With