How to build your own components

This article describes how to build your own components.

In essence, components are .ini files that are located in the components directory inside rescup.dat. There may be any other files in that directory as well, but only .ini files are examined by rescman. The file called core.ini is a component that will always run first and does not appear in any dialog boxes.

Although they are called .ini, they do not follow the traditional Windows INI file format. It is just a convenient extension that is opened with notepad by default. Instead, the file consists of two parts separated by an empty line – the header and the body. Any lines starting with a # sign are ignored, so these are handy for comments. In the body, empty lines are ignored as well.

The header lists some metadata about the module, in a key=value format. Keys may occur more than once.

Currently, these keys are used:

Name= gives a human readable name of the component, shown in the components dialog.

Depends= gives a filename of another component (without path, but including the .ini extension) that has to be executed before this module can be executed. There may be more than one Depends= key in a file.

Author= states the author of a module. This value is not used yet.

InstalledSize= states the size in bytes that this module will need on the ramdisk (X:) when it has been executed. This is optional, and not used yet.

There may be any other keys in the file, they are just ignored. In later versions, more keys may be added.

The body consists of a list of commands, which all start with a keyword, followed by parameters.

Run command: Runs a command. In fact, the command is appended to stage3.bat which is executed when all components have been run, so you can use everything you can use in batch files for that command.

RegAdd line: Append a line to reg.reg. This file is imported with regedit when all components have been run. Just copy your registry file into the module and prepend RegAdd to all lines.

Copy [/m] [/x] path filename: Copies a file from the Vista install.img into the ramdisk. If /x is given, the target folder is the same as in the ramdisk, without it it is stored into x:\rescup\temp. This folder may end up on another ramdisk with more space in a future version, so if your files do not need to be in the Windows directory, do not use /x. The /m switch is a shortcut that looks for a .mui file for the file given (in a language-specific subfolder) and copies it as well. As most dlls have those mui files around in Vista, this is quite handy as you do not have to state every file twice.

That’s it. Now, it’s up to you: make nice components that include Internet Explorer, Paint, or the .NET framework. I’m eagerly waiting for your contributions!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: