Goal: The goal of this HowTo is to use component scripting available in XP Embedded to generate a custom boot.ini with every build.
Challenge: If the /bootlogo boot.ini flag is desired the boot.ini file must be modified after each build in Target Designer. You could also run a script during FBA to accomplish this same thing.
Prerequisites:
Script: Much of the CMI scripting interface in the Windows Embedded Studio toolkit is undocumented. This tip is actually pulled from an update to RTM from many years ago. The update was shipped as a component and the script was still accessible (whoops!
). I noticed that there were a few lines in the Base Component script that created the default boot.ini. So I modified them to add our custom boot.ini flags. Copy the script below into a new file named boot.vbs
<script>
'////////////////////////////////////////////////////////////////////////////
' $Header:$
' Windows Embedded Boot.ini Script
' Version: 1.00
' Author: bcombs
'////////////////////////////////////////////////////////////////////////////
Option Explicit
'//event fired as part of the processing of method calls on CMI objects
Sub cmiOnEndBuild(dwFlags)
'//Trace Enter
Dim sProcName : sProcName = "BootLogo ::cmiOnEndBuild"
oPL.TraceEnter sProcName ' //oPL - global object present in Platform Script
oPL.BootSwitches.Add "bootlogo", Empty
'//Trace Exit
oPL.TraceLeave sProcName
End Sub
</script>
Next, open Component Designer and create a new component called MyBootLogo. Add this script under the Component Script option in Component Designer. Add a file resource to your component that points to the bitmap to be displayed at runtime. Remember, the file must be:
-
A bitmap
-
16 colors (not 16 bit color!)
-
640x480
-
Named boot.bmp and stored in \Windows
Create a repository for your boot logo. Save and import the MyBootLogo component and add it to your configuration. Build the image and check in the resulting boot.ini that your flags are there.