XP SP3: Evil Plot to Get Me to Switch Back to Vista?

I grabbed Service Pack 3 for Windows XP from MSDN and nearly hosed up my machine tonight.

After backing up my drive, I installed SP3.  Once the installation finished, it wanted to reboot the system (of course).  Problem was, it wouldn’t start back up.  It just hung there on the Windows XP logo screen  with the "progress bar" going around and around forever.  I reset the box and tried again.  This is standard operating procedure with Windows – sometimes just trying something again works.  But not this time.

Fortunately, I could still boot into safe mode and uninstall SP3.  After that, everything returned to normal.  So now, I’m left wondering if I’m going to be stuck at SP2 on this machine and unable to get future security updates.  Is this Microsoft’s way of getting me to try Vista again?  At least under Vista things sort of worked and I could get updates.

Maybe it’s time to reconsider getting a Mac.

UPDATE: 5/10/08 – Installed SP3 via Microsoft Update with no problems. Mac purchase delayed for now. 🙂

JScript.NET

From the things I didn’t know department comes JScript.NET.  What is JScript.NET?  In a nutshell, it’s a .NET version of JScript, i.e. a .NET version of JavaScript!  Why should you care about JScript.NET?  Well, here’s a scenario I had recently:

The company I work for uses Nagios to monitor it’s mission critical systems.  One common use is to simulate a user logging into a web application by POSTing credentials to a login form and checking for specific strings in the response.  This usually gives you an end-to-end check that all systems (web server, database server, etc.) related to the app are functioning.

I was asked to investigate how we could monitor one app in particular that couldn’t be checked with the simple tools included with Nagios.  This application was encrypting the user’s password two different ways using JavaScript before submitting it to the server.  To make matters worse, it was using a random key generated by the server each time the login page was opened.

Since I’m primarily a .NET developer and have very little experience with *NIX systems and PERL (most Nagios plug-ins are written in PERL), my approach was to build a simple web page that Nagios could check that would act as a proxy to this particular app.  This still left me with the problem of how to simulate what the browser was doing in JavaScript. 

One solution would be to translate the JavaScript to C#.  Another would be to try to host the Windows scripting engine in my .NET app and invoke the existing scripts as-is.  Or maybe I could write a "classic" ASP page using JScript.  None of these options appealed to me much, so I consulted Google.

I eventually came across JScript.NET.  I knew about J# (Microsoft’s attempt to lure Java programmers to the .NET platform), but what the heck is JScript.NET?  When I create a new project in Visual Studio, there’s no JScript options…

Hidden away in the .NET SDK is jsc.exe, the JScript.NET compiler.  So, now it was just a matter of taking the JavaScript code I wanted to use from C# and compiling it using jsc /t:library <source file> and I had a DLL I could reference and call.  A few minor tweaks were needed, like wrapping stuff in a class, but overall it was pretty painless and it worked!

Not sure if I’ll ever need to do something like this again, but it’s nice to know JScript.NET is there…