How to apply .NET Framework hotfixes on Windows XP Embedded devices

As I'm sure some of you have already noticed, it is proving a bit difficult to install .NET Framework hotfixes (such as the recently released MS05-004 ASP.NET hotfix) on Windows XP Embedded devices. On my previous team, two of the setup packages I worked on were the .NET Framework 1.0 and 1.1 components for XP Embedded, so fortunately I have some background that I could use to figure out exactly how to get this to work. I used the following steps to patch some embedded runtimes on my office test machines and I wanted to share it with everyone:

  1. Figure out the exact version of the .NET Framework you have (major and minor version plus service pack). If you are using the .NET Framework 1.0 component we shipped, it will be 1.0 SP2. If you are using the .NET Framework 1.1 component we shipped (either the original QFE version or the one that comes with XPE SP2), it will be 1.1. If you are using the .NET Framework 1.1 with SP1 component in the value-add folder of XPE SP2, it will be 1.1 SP1

  2. Download the setup package for the hotfix that matches the version of the .NET Framework that you have in your embedded image (make sure you choose the "save" option instead of the "run" option because you need a copy of the exe on your local hard drive). You will notice that these packages say that they are for Tablet/Media Center or Windows Server 2003. That is OK and expected because the underlying setup technology we use to install the .NET Framework in our embedded components is the same as on those operating systems.

  3. Extract the exe to a local folder by running <name of exe> /x:<folder>

  4. Go to the folder that you extracted the .NET Framework hotfix to in the previous step and open each of the files named update*.inf in the update subfolder. There is a [Version] section at the top that you will need to change the following values for:

    NtBuildToUpdate=2600
    NtMinorVersionToUpdate=1
    MinNtServicePackVersion=###
    MaxNtServicePackVersion=###
    ThisServicePackVersion=###

    The values of MinNtServicePackVersion, MaxNtServicePackVersion and ThisServicePackVersion should match the data in the registry on your embedded device for the CSDVersion value at HKLM\System\CurrentControlSet \Control\Windows. For example, on Windows XP Embedded SP2 this value should be 512. This value represents the OS service pack level and each service pack is a multiple of 256.

  5. If you have 1.0 SP2 or 1.1 SP1 installed in your embedded image you will need to add an additional registry value that the hotfix update package is checking for as a prerequisite (so if you have the 1.1 component you can skip this). You need to add a registry key named HKLM\Software\Microsoft\Updates \.NETFramework\1.0\SP2 or HKLM\Software\Microsoft\Updates \.NETFramework\1.1\SP1 and a REG_DWORD value named Installed with a value of 1 under this key.

  6. Now you can run update.exe from the update subfolder on your embedded device assuming that your embedded device includes the dependencies update.exe needs to run correctly

As you can see, this process is fairly complicated so I am going to work on a way to generate a DUA script to install these hotfixes automatically. I am hoping to add support for this scenario to DuaScriptGen in the near future.

As always, please let me know if you have any questions about any of this or run into any trouble getting the steps to work.