Whem I\'m writing a Windows Service and just hit F5 I get the error message that I have to install it using installutil.exe and then run it. In practice this me
installutil.exe
You can use Environment.UserInteractive variable. Details of implementation here
Environment.UserInteractive