views:

40

answers:

1

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/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.

+1  A: 

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.

Matt Hamilton