October 2007 - Posts

It's been quite some time since I've been blogging over here... Things have been quite busy the last couple of weeks to settle in over here in Redmond, both personally and professionally but rest assured: everything's going fine! In this blog post I wanted to answer a few questions...


What are you working on?

Very good question indeed. As you know from a previous post I've joined the Microsoft Corporation headquarters in Redmond to work on the Windows Presentation Foundation. More specifically, I'm part of a team called AppModel and we own all sorts of stuff that doesn't fit in some other category or feature area. Examples include the Window and Application classes, XBAP stuff, resource loading, etc. So you'll most likely hit our code in virtually any WPF application out there in the wild :-). The last two weeks I've familiarized myself with the code-base and various internal tools we use to build and test our stuff. During that time I've been working actively on this project for our team.

And, next to this, I keep myself busy with various other fun projects and experiments which might hit the blogosphere some time in the near or distant future :-).


Is LINQ to SharePoint still alive?

You bet it is! Although the latest check-in on the project is almost two months ago, I've been working on a next set of features offline. Once time permits and a few other things have been figured out, I'll start to continue regular work on the project and give you an update on the project's status and goals. For now, it's my pleasure to announce you I'll be covering LINQ to SharePoint on Channel 9 geekSpeak next week on October 31 at 12:00 PM Pacific Time! For more information and to register, check out this site: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032352641&Culture=en-US. Topics covered include the use of LINQ to SharePoint, a look under the covers of LINQ query providers and an update on the project's future roadmap.


TechEd EMEA Developers

Another reason it's been pretty calm over here is the prep work for my sessions (and side-activities) on TechEd EMEA Developers. I'll be presenting two sessions:

  • INF305 Next Generation Manageability – Windows PowerShell and Microsoft Management Console (MMC) 3.0 Extensibility

    With the advent of Microsoft Management Console (MMC) 3.0 and Windows PowerShell more recently, manageability has been taken to the next level. In this session you’ll learn how to write your own managed code MMC 3.0 snap-in and how to extend Windows PowerShell with custom Cmdlets and providers. Finally, we’ll put the pieces together by layering MMC 3.0 snap-ins on top of Windows PowerShell runspaces. See what’s in it for you and learn how to close the gap between IT Pros and Developers.
  • WIN305 Windows Presentation Foundation (WPF) Data Binding In-Depth

    Ever written an application without data? Didn’t think so. Data is everywhere nowadays and so is the need to work with data in a convenient way. Get familiar with Windows Presentation Foundation (WPF) data binding features and learn how to bind with various types of data sources. This session will also cover the use of templates that will help to close the gap between business objects and presentation.

Oh yes, and there's a pre-event interview with me over here. Other great videos from Belgians over there include Gunther's on the database track, Profke's covering SharePoint sessions and Gert's on the overall event. Of course, check out the others as well: Scott Guthrie, Mike Hall, etc - just a few names.

If you're attending TechEd EMEA Developers this year, definitely come and see this year's Speaker Idol competition. I won't be a participant this year of course, but will be there! We have four waves with three participants each and one final to find this year's Speaker Idol. Check it out on the Speaker Idol page.


That's it for now - I promise to start blogging on a more regular basis again when things calm down a little bit.

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

This is going to be a somewhat unfamiliar post on my blog. The history for it goes back to 2003-2004 when I was involved in a local Microsoft Belux project called "SchoolServer". At that time, we used a Windows PE (where PE stands for "Pre-Installation Environment" and not "Portable Executable") version extracted from the Windows Server 2003 branch (NT 5.2), which was available to volume licensing customers only. But what's Windows PE?

Windows PE is a version of the Windows OS that runs without installation entirely in memory (no harddisk required) and boots from a cd-rom or the network (as we'll see it goes further than that in v2.0).

The reason to use it is pretty straightforward: for "Pre-Installation" tasks, such as disk partitioning, or even to build a (scripted) system setup that runs in a familiar Windows environment right from the start (e.g. generating a winnt.sif unattended installation file using a nice graphical wizard, making the right partitions, copying setup sources to the harddrive and invoking setup using winnt.exe or so). But also for day-to-day computer (disk) administration tasks, this proves very useful. Indeed, Microsoft's Windows PE solution isn't the only one out there but are others as well which have similar ideas like BartPE (I'm not that Bart).

If you've installed Windows Vista or Windows Server 2008 already (I hope you did), you'll have noticed that there's no blue-background textual setup anymore, the system boots into Windows from the cd to have an end-to-end graphical setup which is based on the Windows PE technology. As a developer I loved to have such a Windows PE version myself bootable from USB Flash and for free. In this post I explain how I did it from A to Z. I'll also explain how to create an ISO image for Windows PE cd's.


Getting started: download and install the WAIK

WAIK stands for the Windows Automated Installation Kit and is available as a download. It's a big download, but it's worth to put your connection under stress for :-). Burn it to a cd or mount it using some ISO/IMG mounting tool and install it.


The Windows PE Tools Command Prompt

Next, open up the Windows PE Tools Command Prompt from the Start Menu and make sure to Run as Administrator:


Alternatively, you can change the shortcut's properties, Advanced..., Run as Administrator to run it everytime elevated as an administrator:


You should see something like this:


Notice the message points you at a few usable executables: peimg, oscdimg and imagex. We're going to use these in a minute.


Building your Windows PE

In order to build your custom Windows PE, follow the next steps:

  1. Run copype.cmd as follows:

    > copype.cmd x86 c:\winpe_x86

    This makes a copy of the Windows PE files to the specified folder. Alternatively, you can specify amd64 for 64-bit machines. We'll manipulate this folder in the next steps.

  2. Next, you can customize the Windows PE image (using the Windows Imaging Format, aka WIM) using ImageX:


    You can mount a WIM file to a folder like this:

    > mkdir c:\winpe_x86\mount
    > imagex /mountrw c:\winpe_x86\winpe.wim 1 c:\winpe_x86\mount



    For the curious, this works through a file system driver called WimFltr (see sc queryex WimFltr).
  3. Add all apps you like to add to the image in the mounted folder. Windows PE is based on packages that can be added to the image at will. This is done through peimg, like this:

    > peimg /list /image=c:\winpe_x86\mount\Windows

    to show a list of all images:


    Next, you can add packages by calling:

    > peimg /install=<package> c:\winpe_x86\mount\Windows

    where package is either * (all packages) or one from the list shown by invoking peimg with the /list switch.
  4. You could add drivers and language packs as well, but for that I refer kindly to the excellent help documentation that comes with the WAIK. When you're done with the image customization, run peimg with the prep switch:

    > peimg /prep c:\winpe_x86\mount\Windows

    and unmount the image using ImageX:

    > imagex /unmount c:\winpe_x86\mount /commit

    and copy the created .wim file to the ISO folder:

    > copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim
  5. Next you can create an ISO file for the image using oscdimg:

    > oscdimg -n -bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso

    where the -b flag specifies the El Torito boot sector for the ISO to be created. It just takes a few seconds to complete:

  6. To test your image, just create a new Virtual PC virtual machine (e.g. with 256 MB of RAM) and mount the ISO file. No harddisk or network adapters needed:


    VPC should boot like this:

    image    image    image

    Feel free to start taskmgr and notepad or so to get familiar with your next big friend :-). Finally shut it down using wpeutil shutdown.
  7. You might have noticed the image has the QWERTY keyboard layout, but you can change that if you like to do so. Go back to step 2 to mount and do the following on the mounted image using intlcfg:

    > intlcfg -inputlocale:<locale> -image:c:\winpe_x86\mount
    > intlcfg -syslocale:<locale> -image:c:\winpe_x86\mount
    > intlcfg -userlocale:<locale> -image:c:\winpe_x86\mount

    where <locale> is replaced by the locale you want (e.g. nl-be for Belgian Period keyboard).


    Go back to step 4 to unmount, commit, prep and create the iso. Rerun VPC to test.

    For the curious, this changes some of the <mount>\Windows\System32\config\*.* registry hives:


    In regedit.exe you can mount these hives to see what's in. To do this, open regedit, select HKLM and choose File, Load Hive. Next select the file to load (e.g. DEFAULT) and specify a name for the loaded hive (e.g. Mount):


    As you can see, intlcfg has changed the Keyboard Layout\Preload list. Of course, the hardcore ones of you might prefer to make changes to the registry hive directly this way. By the way, while you're in the loaded hive, check out other settings like:

    - desktop wallpaper via Control Panel\Desktop\WallPaper
    - (from the SYSTEM hive) command line to invoke after starting Windows PE via Setup\Cmdline

    Tip: regedit.exe is also available in Windows PE itself, so you can check the outcome over there. However, changes mage while running Windows PE won't take effect since the registry is loaded in memory.
  8. Finally, it's time to put the whole thing on a USB Flash key or to burn the ISO created in step 5 to a cd-rom. I'll cover the former option. Open up diskpart and execute the following commands:

    WARNING! Make sure to select the right disk in step 1; you can view all disks using the "list disk" command. In the steps below, all data from the USB Flash disk will be removed!

    > select disk 1
    > clean
    > create partition primary
    > select partition 1
    > active
    > format fs=fat32
    > assign
    > exit

    Now copy to the c:\winpe_x86\ISO folder contents to the USB disk (which I assume has letter E: assigned):

    > xcopy c:\winpe_x86\ISO\*.* E: /E
  9. Now you should be able to boot from the USB Flash disk. Make sure to select the right boot device during the boot cycle or to change the boot order in your computer's BIOS.



Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Just to let the community out there know I'm alive and kicking in Redmond now... A while ago I announced to join Microsoft Corporation HQ in Redmond to work on the Windows Presentation Foundation. After a long wait to gain access to the United States under H1B status, I've finally arrived yesterday in my temporary apartment in Bellevue and will start to work on the team next Monday. I'll come back to you with more (interesting) news the next couple of days.

For now, this is something you really need to check out: Scott Guthrie announced the source code for the .NET Framework Libraries will be made public under MS-RL license. This is awesome news for those of you interested to know how things work and to gain a better understanding of the system. In the past we had Rotor (officially called the SSCLI) but the code in there wasn't guaranteed to be an exact match with the code of the framework that was released by Microsoft. Furthermore, the new initiative reaches way beyond Rotor's goals: a bunch more namespaces will be made available, there's an integrated debugging experience if you're using VS2008 (source is grabbed from the MSDN source server directly), etc. It seems you'll be able to read my code in the future (H).

Stay tuned for more exciting news from here!

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

More Posts