How can a program know whether it's ClickOnce or not?
I want to release a program for two versions, general and clickonce.
In general one, it include updating code for updating program, but clickonce one is not.
But, they are in the same solution开发者_StackOverflow/project code.
That is to say, I want to know how to know if a program or application can tell if it is clickonce or not itself by code.
You can tell if your app is installed via ClickOnce via the ApplicationDeployment.IsNetworkDeployed
property.
From the MSDN documentation:
If you want your application to run both inside and outside of a ClickOnce deployment (for example, if you need to debug your application on the local computer before deploying it), test IsNetworkDeployed before accessing the CurrentDeployment property.
IsNetworkDeployed will return true regardless of whether the application is installed or hosted online, and regardless of whether it was installed from a Web site, file share, or CD-ROM.
精彩评论