Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Click-Once install location from within application

I'd like to programatically determine the "publish location" (the location on the server which contains the installation) of the click-once application I'm running. I know that the appref-ms file contains this information and I could parse this file to find it but the application has no idea as to the location of the appref-ms file and I can't seem to find a way of determining this location.

Does anyone have any ideas how I can easily determine the publish location from within my application?

like image 426
rein Avatar asked Feb 20 '26 09:02

rein


1 Answers

There's a bunch of properties on System.Deployment.Application.ApplicationDeployment.CurrentDeployment that should answer your question.

You probably want to look at .ActivationURI, or .UpdateLocation for the path you want.

(It's probably worth checking that ApplicationDeployment.IsNetworkDeployed is true first otherwise you'll get an exception.)

like image 130
Simon P Stevens Avatar answered Feb 22 '26 02:02

Simon P Stevens



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!