Windows service installation

To install a windows service you just built, here is some extra work you need to do. First have these two classes in your windows service project to configure the installation.

    [RunInstaller(true)]
    public class Installer : ServiceInstaller
    {
        public Installer()
        {
            DisplayName = "My Windows Service";
            Description = "Does cool things";
            ServiceName = "MyWindowsService";
        }
    }

    [RunInstaller(true)]
    public class ProcessInstaller : ServiceProcessInstaller
    {
        public ProcessInstaller()
        {
            Account = ServiceAccount.LocalService;
        }
    }

Next part is easy… Start the Visual Studio Commmand Prompt and go to the folder where this service is built. Run this to install the service:

installutil MyWindowsService.exe

Then go to Services in your in Computer Management to start the service. To uninstall the service; stop the service and then run:

installutil /u MyWindowsService.exe

That’s all…

Dynamic, static, weak and strong in languages

I came across this interesting post. Here is the jist:

dynamically typed language is a language where the type of a variable can be altered at any time. (It is a string, now it is a Fixnum, now it is a Time object, etc.)

statically typed language is the opposite. (Decide what x is once for all and don’t change your mind!)

strongly typed language is a language that is being strict about what you can do with your typed variables. (Don’t mix them… or I will throw you an error in the face!)

weakly typed language is the opposite. (Do what you want with your different types. Mix them all! We’ll see what happens!)