7 Is a (Hopefully) Lucky Number

Illustration

It seems that Microsoft likes number 7.

New version of Microsoft’s OS for mobile phones looks like nothing we’ve seen on their mobiles before. And, taking all into consideration, I must say it is a good thing.

There is video on Channel 9 with whole demo and I will just make short summary here.

Biggest change is start screen. It works like all screens on modern phones and OEMs will not be able to change it anymore. At last there will be common interface among phones and not whole variety that we used to see.

Internet Explorer got rework. Finally it works like mobile browser should. It has all touch-gestures you would expect. Even complicated pages can be rendered and while one page is being loaded, you can switch to other tab to check something else. Yes, you read it correctly, it has multi-tab support.

E-mail and calendar along with Exchange integration are still remain strong sides. Nice addition is ability to have business and personal calendar displayed side-to-side.

And finally there are more stricter hardware requirements. It requires capacitative screen, accelerometer, GPS… It also restricts screen resolutions to manageable number. Older versions of Windows Mobile had bunch of screen resolutions and rations added over years and it was pain-in-the-ass to support them all.

Viewing all these things make my heart hurt a little since there is no talk about my favorite non-touch screen devices. It seems that their days are numbered (and that number is not seven).

I do hope that this operating system will have better adoption than Windows Vista had and that Microsoft takes back some of Smartphone cake. They do have best development environment for mobile phones. I hope that they will finally have Smartphone worth enough for it.

P.S. You might also wish to check Windows Phone 7 Series website.

VHD Attach 1.50

Illustration

It has been a while since I released VHD Attach. It worked perfectly for me and, judging from comments on Internet, for quite a few other people.

One thing that gave me most grief was necessity of going through UAC prompts. This “feature” is gone now. VHD Attach will install itself as service during setup and thus all UAC prompts will be avoided.

Another feature long overdue is ability to work properly on Windows 7 that are not of English descent. Although most of features weren’t affected, this is definitely step forward.

You can download new version here.

How to Create Self-installing Service

Creating Windows Service quite often comes as natural choice when some long-term task needs to be done or, god forbid, you need something running while there is nobody to log on. Although services are useful, there are two things that annoy me and they are just too non-obvious to do. One is debugging services and another one is installing them.

For quite a while I’ve been using installutil.exe in order to install services. Since I am fan of being able to put things on system without actually installing them, that meant that I went through hoops to write C# code which will find installutil.exe in all it’s possible locations, under any combination of service packs and then to parse output once it gets executed.

I am not proud that it took me literally years to get idea to open installutil.exe in Reflector. And there, under whole glory, there was single function that does everything. And to make things even better parameters for this function are same as parameters for installutil.exe itself.

In order to install service, it is enough to pass name of executable (executing assembly in this example) and magic will happen:

ManagedInstallerClass.InstallHelper(new string[] { Assembly.GetExecutingAssembly().Location });

Uninstall is same story. Additional “unistall” (or “u”) flag is all it takes:

ManagedInstallerClass.InstallHelper(new string[] { "/u", Assembly.GetExecutingAssembly().Location });

Design of whole thing leaves lot to be desired. It just doesn’t feel like .NET - it feels like whole thing was pushed in after somebody noticed that there is no installer and there are only 2 hours before final version of .NET comes out.

One could get into refactoring whole thing out and making “proper” installer without too much effort. However, personally I will not do it. Although this function annoys me, I am also assured that Microsoft takes care of testing it and that it will work on every supported version of .NET Framework on every supported platform. Services are difficult enough without risking installation issues on some obscure combination.

Things that are not (badly) broken should not be fixed.

P.S. Not to forget, you need reference to System.Configuration.Install.dll in your program.

Kingdom for a Spoon

Illustration

I love Ben & Jerry’s ice cream. Since that particular brand is not available in Croatia where I live, I like to indulge myself when I am in Berlin.

Since tonight I was having sweet tooth decision was made, for the first time, to try big 500ml box. It came quite costly but I didn’t care. I was eager to go into my hotel room to be alone with it…

However, unlike small cones, big packaging does not include any spoon-like contraption. That presented quite a problem since there was no spoon in sight.

For benefit of those among you that cannot handle horror movies, I will not go into too much details. I will just say that I managed to eat it. And I will remember to pack a spoon on my next trip. :)