Run a Custom Script (Standard 8)
7/8/2014
Learn how to automatically run a custom script after first startup on your Windows Embedded 8 Standard (Standard 8) image by using Image Builder Wizard (IBW).
Image Builder Wizard (IBW) is the program that installs Windows Embedded 8 Standard (Standard 8). IBW is also the basis for IBW in unattended mode and Windows Deployment Services (WDS).
IBW Installation Types
IBW can perform two types of installations:
- Interactive installation using IBW.
- Unattended mode using the Unattend.xml file produced by Image Configuration Editor (ICE).
Image Builder Wizard Process
IBW starts and restarts the computer, collects information, copies files, and creates or adjusts configuration settings. The following table shows the overall process for IBW.
IBW phase |
IBW actions |
---|---|
Windows Preinstallation Environment (Windows PE) 4.0 (for starting one of the Standard 8 DVDs or starting a custom Windows PE 4.0 image) |
|
Online configuration |
Creates specific configurations. This makes the Standard 8 installation unique. |
Windows Welcome |
|
Installation Modes
There are two modes in which a Standard 8 installation can start:
- Windows Welcome
Windows Welcome is the first user experience and enables end-users to customize their Standard 8 installation. Users can create user accounts, read and accept the Software License Terms, and choose their language and time zones.
By default, all Standard 8 installations start Windows Welcome first. - Audit Mode
Audit mode is used by OEMs and IT professionals to add customizations to their Standard 8 images. Audit mode does not require settings in Windows Welcome to be applied. By bypassing Windows Welcome, you can access the desktop more quickly and make your customizations. You can add device drivers, install applications, and test the validity of the installation.
Oobe.xml Content File
In addition to the unattended IBW configuration file, you can use the Oobe.xml content file to configure what a customer sees when they start Standard 8 for the first time. Settings in an Oobe.xml content file are applied after the oobeSystem configuration pass, before Windows Welcome starts.
Oobe.xml is a file that is used to collect additional text and images for customizing Windows Welcome, Welcome Center, and ISP Sign-Up. If you build a single Standard 8 image that contains multiple languages and can be delivered to more than one country/region, you can add multiple Oobe.xml files to customize the content based on the language and country/region selections of the end-user.
Automatically Run Scripts after Image Builder Wizard Is Complete
You can make additional customizations to the Standard 8 installation by adding commands to the %WINDIR%\Setup\Scripts\SetupComplete.cmd file. This file enables you to install additional applications or make other modifications to the system before a user logs on. You can use the SetupComplete.cmd file to run custom Standard 8 scripts (CScript/WScript).
In addition, if IBW encounters a fatal error, you can configure the system to automatically run a script. For more information, see Create Custom Modules.
There are several states assigned to a Standard 8 image during installation. This state information can be used to automatically detect the different states and stages of IBW.
The Standard 8 image state is stored in two locations:
- In the registry
Key: HKLM\SOFTWARE\Microsoft\Windows Embedded 8 Standard\CurrentVersion\Setup\State
Type: REG_SZ
Value: <StateName> - In a file
File: %WINDIR%\Setup\State\State.ini
Section: [State]
Value: <StateName>
The following table describes the different values that exist for StateName.
<StateName> |
Description |
---|---|
IMAGE_STATE_COMPLETE |
The state of an image that has been successfully installed. The specialize and oobeSystem passes are completed. This image is not deployable to alternative hardware because it is now hardware-dependent. |
IMAGE_STATE_UNDEPLOYABLE |
The default state of an image in a given phase of IBW that is not yet completed. If a process queries the IMAGE_STATE value and IMAGE_STATE_UNDEPLOYABLE is returned, the image is in one of the following conditions:
|
IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE |
The state of an image that has successfully completed the generalize pass and continues to the oobeSystem pass when IBW is started. |
IMAGE_STATE_GENERALIZE_RESEAL_TO_AUDIT |
The state of an image that has successfully completed the generalize pass and continues to audit mode when IBW is started. |
IMAGE_STATE_SPECIALIZE_RESEAL_TO_OOBE |
The state of an image that has successfully completed the specialize pass and continues to the oobeSystem pass when IBW is started. |
IMAGE_STATE_SPECIALIZE_RESEAL_TO_AUDIT |
The state of an image that has successfully completed the specialize pass and continues to audit mode when IBW is started. |
The following examples show you how to access state information.
To access state information from the registry, type the following at a command prompt.
C:\>reg query HKLM\SOFTWARE\Microsoft\Windows Embedded 8 Standard\CurrentVersion\Setup\State /v ImageState HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Embedded 8 Standard\CurrentVersion\Setup\State ImageState REG_SZ IMAGE_STATE_SPECIALIZE_RESEAL_TO_OOBE
To access state information from a file, type the following at a command prompt.
C:\>type %windir%\Setup\State\State.ini [State] ImageState="IMAGE_STATE_SPECIALIZE_RESEAL_TO_OOBE"