mai 27

For once, a non .NET post :-)

I have bought recently a new laptop, a DELL Inspiron 1720. Quite a nice laptop in fact. The only thing is that I bought with it Windows Vista Professional and that I was not completely ready for the change. Anyway, note that DELL will stop its support of Windows XP very soon, in June I think. Anyway, the point is that I wanted to re-install Windows XP on it. No problem ! Let's go for it !

First trial of installing Windows XP

  • Let's have a look on the drivers I was needing. I have heard before that some graphic card were using DirectX 10 which doesn't exist on Windows XP. So far so good, it's not the case of my nVidia card. And on the website of DELL, I can find the drivers of all my hardwares components. And even better, the resource CD they sent to me contains the drivers for Windows Vista AND for Windows XP ! (Note that a bit later on, I will find that it doesn't contain the drivers for my video card, sound card, and bluetooth. So you should download some from the DELL website)
  • As I have a long past with DELL computers, I also have a bunch of DELL Windows CDs, including a Windows XP SP2. It would be better with SP3 but ok. I can live with that.
  • Let's boot on it and start the installation !
  • Of course, it does'tn work. I do not have any hard driver ! The reason is simple : the recent computers have SATA drives that are not recognized by Windows XP. So what can I do ?
    • Modify some BIOS configuration that will deactivate the "Intel AHCI" behavior so Windows XP may recognize them
    • Create a new Windows CD including some additional drivers

Let's create a new Windows CD

The first proposal may work but I didn't tried it. However, creating a new Windows CD was seducing as I could also add the SP3 !

  • Let's download and install a free tool named "NLite". It's a tool that will allow us to create our CD
  • Then let's copy all the content of out original Windows CD (XP Pro SP2 in my case) in a local folder
  • Launch NLite and choose your language, then click on "Next"
  • Select the folder of your local copy of your Windows CD
    • NLite will automatically detect wich version (including SPs) and which language it is
  • Click on Next
  • As it is the first time you are doing this, you do not have any previous session, simply click on Next
  • Choose which operations you will want to do, in my case, I have selected
    • "Service Pack" as I want to migrate from SP2 to SP3
    • "Drivers" as I want to include my "Intel AHCI" drivers
    • "ISO bootable" as I want to boot from my CD to install Windows
  • Click on "Next"
  • Select the Service Pack you want to include (simply select the ".exe" file. Nlite will uncompress it and will integrate it to the local content)
  • Click on "Next"
  • Integrate your new drivers
    • You have downloaded from the DELL website (or extracted from the resource CD) you hard drive SATA drivers. Just launch the exe to uncompress it in a temp folder
    • Click on "Insert / simple driver" and select the uncompressed ".inf" file. In my case it is : "iaahci.inf"
    • Select all the drivers that are available (a simple ctrl + A) and click "OK"
    • Click on "Next"
  • Click on "OK" to launch the creating of the new CD (in memory for now)
  • Click on "Next" and now you have the possibility or to burn a CD or to simply create an ISO for later use.
  • I just decide to create an ISO I will burn with Nero later on

Second trial of installing Windows XP

Now I do have my new CD ready so I can simply boot on it to install right ?

  • Let's boot on it
  • Great now Windows recognizes my two hard drives... !
  • ...and also show me 4 partitions on my C: drive... well I had seen only 2 via Windows (my OS partition and a restore partition)
  • Ah yes... this DELL laptop has been preinstalled with "DELL Media Direct" !
  • Let's do the same

Preparation of hard drives for DELL Media Direct

  • Just to start from a clean system, I have decided via the Windows installation to delete all the existing partition on the C drive, just to let a 200 Gigs of unpartitionned space
  • Just restart and boot on your "DELL Media Direct" CD you have received
  • Note that this preparation would delete anything oon your hard drive. In my case, as I have deleted my partitions, it's already done... but be sure to do that before any other installation !
  • Now a choice to do !
    • Select "1" if you want to have a single partitions on your C drive. In that case, the DELL Media Direct installation will create two other partitions for him and will let you with a single big other one
    • Select "2" if you want another partition (typically your OS partition and a Restore / Data / ... partition)
    • And what do I need to select if I want more partitions ? well you can't... A little bit of "Partition Magic" later on ?
  • And that's all. Now you are ready to go

Last trial of installing windows XP

  • Now you can reboot on your Windows XP CD to install it !
  • Note that you MUST install Windows XP on your C drive, the drive where DELL Media Direct has created its partitions
  • When finished, you will need to re-put you Dell Media Direct CD to complete the installation also
  • And here you are with the installation of all your drivers !
Tags:
mai 10

I have given here some clues about creating control adapters. A few days after I have started to use them, I have encountered some very special problems. In fact the adapters have the following hierarchy :  the .NET framework expose a ControlAdapter from which derives a WebControlAdapter and a PageAdapter. THe name of these classes being explicit enough to let you know in which cases you should use which one.

As a consequence, when you want to adapt a WebControl, you should use a WebControlAdapter or one of its derived classes. So far, so good, so simple.

But what you should know is that the framework expose in the WebControl class a method called Render. Never seen it or overriden it ? Normal it's a protected internal one. This method is responsible of the rendering of the control and so does : RenderBeginTag, RenderContent and RenderEndTag. And these are the three methods you will normally work with.

And so what does the WebControlAdapter : it will redefine the Render method to do the same work : RenderBeginTag, RenderContent and RenderEndTag. And each of these methods will either call the apdater's equivalent method, or the one of the control itself.

Pretty normal. No problem there.

Well... Almost... Let's imagine just one moment, that someone has defined some other code in the Render method ? Well... That would bring some troubles no ? Right it would break the .NET standard but let's imagine. Of course, in that case, using a WebControlAdapter would just bring a you a no-longer working control.

It's in fact what happens in the BaseValidator class (which inherits from WebControl of course). The Render method does a lot more, like rendering javascript, the "display" and "visibility" attribute.

Which conclusion, what can we say now ? Never use a WebControlAdapter when working with a BaseValidator (or any derived class). Prefer working with a ControlAdapter instead !

Tags: | | | |