Create custom components for Windows XP Embedded

  
        Introduction There are several ways to create custom components for Microsoft Windows XP Embedded. For example, you can import the imported device driver .inf file directly into the Component Designer tool (this is a huge improvement over Microsoft Windows NT Embedded 4.0). You can create components by importing Devices.pmq (the output of Target Analyzer Probe (TAP) or Target Analyzer (TA) - everything goes well so far - but how do you create a component that can describe a custom application? For the purposes of this article, I decided to build a security appliance that uses TimerShot Windows XP PowerToy — a very cool application that captures images from connected imaging devices and stores the image in a default location — I On your local hard drive, or on a network share (you can find a link to Windows XP PowerToy at the end of this article). TimerShot can be configured to fetch an image every few seconds or every few minutes; all of this is configured inside the application and stored in the Windows XP registry. I will also include another application called "PhotoDisplay", which I wrote specifically for this article. PhotoDisplay can be used to view stored JPEG files. Unfortunately, there are no tools that automate the process of building Windows XP Embedded components for your application — some detective work is required. Therefore, I will get rid of the deer hunter, call my friend Watson (here is a pun), and start working. Installation Options
There are several options for adding third-party applications/technologies when building Windows XP Embedded devices. These options depend primarily on the hardware configuration of the device and the method used to manufacture the device. Maximum flexibility is gained when building devices that boot from R/W media (usually hard drives) and contain CD-ROM/DVD-ROM drives, monitors, keyboards, and mice. In this configuration, you can run a third-party installer directly on the Embedded Target, which will copy and configure the application directly on the target device. This option is useful if you are building a one-time device, or if you want to test your application on Windows XP Embedded to ensure that all required operating system components are present (discussed below). Another option is to generate a Windows XP Embedded image (usually generated into the \\Windows Embedded Images folder) and manually add the required applications/resources to the build folder. The Windows XP Embedded operating system image (and applications/resources) can then be copied to the bootable media and the application can then be tested. This only applies to simple applications that do not require registration of COM objects or installation of underlying operating system services. The best approach is to create a component that can be used inside Target Designer and can be selected just like any other Windows XP Embedded component. This is an ideal option if you have already installed the Windows XP Embedded tools in a multi-user situation. However, this requires some work to be done. Let's analyze how to install the application and what parts of the operating system are usually modified. The installer is available in different forms and sizes, either as simple xcopy, IExpress, or as a GUI installer that requires the user to provide registration information and may issue multiple CDs/DVDs. The installer may install the database engine or operating system services, device drivers, or support DLLs, and may make changes to the operating system registry or INI files—in some cases, the installed files may be installed on multiple PCs. In the folder: Program Files for the core application, "\\Windows\\System32" for the device driver, or other folders depending on the installer. To determine what should be included in your Windows XP Embedded components, it may not seem like a normal job at first glance. The good news is that there are tools and techniques to assist you. The next section provides a high-level overview of the tools you need to determine which file/registry settings and operating system components to include in the Windows XP Embedded components. Detective Toolkit
This section outlines the tools you need to build custom Windows XP Embedded components. Two sets of tools are required when building and testing components. Some of these tools will run on the development PC, while other tools will be included on the target device to debug the application or component. Let's divide these tools into the above two categories and then examine how each tool is used. Tools Used on Developing PCs
Although you cannot change the behavior of an application's installer, you can monitor your operating system to determine what changes have occurred since the application was installed. There are many tools that can be used to assist with this process. Because some installers require a reboot during the installation process, it is ideal to use a tool that can monitor changes to the PC's file system and registry after a reboot. Applications such as Inctrl5 (ZDNet) and SysDiff (Microsoft) take a snapshot of the file system and registry before installing the application, then take a snapshot of the file system and registry after installation and provide a difference between the two Report — This can help determine which files should be included in the component. Note that applications and services that are already running when the application is installed may also make changes to the file system and registry. Below is a list of tools that have been used on my development PC to determine which files/registry entries should be included in my custom component - I will explain each tool through the steps in the process described later in this article. Usage. • InCtrl5 — Takes a snapshot of the file system and registry and provides a list of differences (ZDNet) • Dumpbin – used to determine which DLLs are used by the application/DLL (Microsoft Visual Studio .Net) • Depends — can also be used to determine Which DLLs (and APIs) are used by the application • RegMon — dynamically monitor changes to the registry (NT System Internals) • FileMon — NT System Internals • Windows XP Embedded Development Tools — Target Analyzer Probe, Component Designer, Component Database Manager, Target Designer Tools for use on target devices
Using the tools above to determine which files and registry keys are required is only part of the puzzle. After the Windows XP Embedded image has been generated, the application will also need to be tested to ensure that it works as expected — it is possible for the application to dynamically load the DLL or create an instance of the COM object, but it cannot be captured using Dumpbin or Depends. Therefore, some debugging tools are needed on the target device. Below is a list of tools that have been used on my target device (these tools should be removed before deploying the final operating system image). • RegMon — dynamically monitor changes to the registry (NT System Internals) • FileMon — NT System Internals In the next section, I will walk through the use of these tools. Overview
Process Overview First, let's recap the security device and list the available components. Our plan is to generate security devices based on Windows XP Embedded. In this example, I will use the Toshiba Tecra 9000 laptop as my development PC, using the Logitech USB Camera and Windows XP Embedded TimerShot PowerToy (for the download location of this component, see the link at the end of this article) as my goal. Device and use the detective kit mentioned earlier. The Toshiba laptop has two hard disk partitions. The primary partition contains Windows XP Professional and all of my development tools (Windows XP Embedded, Visual Studio .Net, etc.) and is formatted as NTFS. I also have a 700MB secondary partition (approximately equal in size to the disc) and formatted as FAT32. I have modified my BOOT.INI (it resides in the root of the bootable drive to add a secondary boot option for Windows XP Embedded - note that Boot.ini is configured to have the System and Hidden properties) - Boot.ini As shown below: [boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\\Windows [Operating systems] multi(0)disk(0)rdisk(0)partition(1 )\\WINDOWS="Microsoft Windows XP Professional" /fastdetect multi(0)disk(0)rdisk(0)partition(2)\\WINDOWS="Microsoft Windows XP Embedded" /fastdetect At startup, I got two options: Boot to Windows XP Professional (on my primary partition) or boot to my Windows XP Embedded image (on my secondary partition). After a 30 second timeout, the default option is to boot to Windows XP Professional. Step 1 — Capture information from the installer The first step in creating a custom component is to determine the file and registry settings required by the application. The installer and detective tools should run on Windows XP Professional. You can run and test your application against a fully configured operating system image — this article will test the application for Windows XP Embedded later. The Windows XP PowerToys Web site lists some PowerToys; when you click the appropriate link to download a PowerToy, you are prompted to select Open, Save, Cancel, or More Info. Click Save to save the TimershotPowertoySetup.exe program to your hard drive. Note that PowerToy will be downloaded and installed when "Open" is selected. At this point, you do not need to capture information during the installation process. A file system and registry snapshot tool will also be required. For the purposes of this article, I have chosen to use Inctrl5 from ZDNet, although many similar tools are available. The following is the appearance of Inctrl5: the location of the installer is inserted (in my example c:\\stuff\\XP-PowerToys\\TimershotPowertoySetup.exe), the report output location is changed to point to my installation folder, then I click GO!. Figure 1. InCtrl5 captures a snapshot of the registry and file system of my development PC and launches the PowerToy installer. After the installation process is complete, a second snapshot is taken and a report is generated. The compiled report will list all changes made to the file system, registry, INI files, and text files (autoexec.nt and config.nt) — for the case of PowerToy installation, this report is included when installing PowerToy
Copyright © Windows knowledge All Rights Reserved