I want the program to check if it’s installed on the computer (using Clickonce) or just being run (e.g. by Visual Studio).
EDIT: Not a duplicate of How to detect that C# Windows Forms code is executed within Visual Studio? . “e.g.” means for example.
You can use the ApplicationDeployment.IsNetworkDeployed property. Please note that this only works with ClickOnce installations.