How to build your own components

March 26, 2008

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!


Making it better :)

March 25, 2008

A small Visual basic executable (rescman.exe) has been added to make Livista Rescup better. It will take care of

  • closing the setup properly and shutting down when you have finished
  • showing a dialog to select which Vista edition to take files from (if you have a modded vista DVD with more than one language on it, for example)
  • showing a dialog to select additional features you want to load. These features are .ini files in a components folder in the source file structure. So just drop more inis there and you can load more stuff. Currently the only option is the security tab of Windows Explorer. More about that ini format later

I also added a readme.txt file by popular demand. Apart from that, rescup-0.0.2 works as well as 0.0.1 did.

Thanks to Nuno Brito from Boot Land, there is a Subversion repository with all the source available, as well as a place to store downloads

A website will follow soon. Stay tuned!

How to overcome these limitations?

January 20, 2008

This is how far I got by now. The result is a batch file that will open a task bar and an explorer. There is a script to extract files from the install.wim. The shutdown link will not work yet, and the setup window will still be displayed (and can be used to shut down). I hope to fix this soon (so that the setup window is invisible and will be closed once you click shutdown). For download, see the article on the right.

First problem was extracting files. Fortunately, the latest version of 7-Zip can extract files from WIM files. There is a command line version available that works well within the Vista Setup, (you will only need 7z.exe and 7z.dll), so this one is solved quickly.

Getting Explorer to work was a bit more tinkering, resolving dependencies with Dependency Walker, copying registry settings (which were missing according to Sysinternals Registry Monitor) from a real Vista installation
until it worked, and when I got it working, I gradually reduced the number of DLLs and registry keys until it still worked.

So, as a result, you will need these files from your install.wim to run Explorer (add MSVBVM60.DLL so that portable apps which are written in Visual Basic work as well):


%LNG% means the language version of your Vista CD, i. e. en-US for English or de-DE for German. To autodetect this version from a batch file, use the folder that matches x:\sources\??-?? and save its name to %LNG%.

You will also need about 8K of registry settings (mostly the result of registering the DLLs mentioned above) to get Explorer working. Import those with regedit.

Then run explorer and be happy about your nifty taskbar that appears.

How to contribute

January 20, 2008

If you have any suggestions or know ways to improve this tool, drop me a message. But how to find such improvements? How to tinker with the Vista Setup?

Of course, you do not want to reboot your machine everytime you want to try something. So, you will want to use a virtualization solution. Microsoft’s Virtual PC looked like being the optimal choice, because it is free and from Microsoft (like the Vista setup). However, for some reasons, the mouse acts somehow jumpy while being in the setup. It is hard to describe,  but it is very annoying. Using VirtualBox worked much better for me, the mouse is much smoother. I use a temporary 1GB virtual partition to store scripts and tools I use for tinkering, like:

  • Sysinternals Suite
  • 7-Zip
  • Dependency Viewer
  • OllyDebug

So I can reboot my Vista Setup as often as I want and still have my tools. For transferring tools onto that disk, I use a virtual floppy. Copy stuff on there (if needed split with 7-Zip first) and copy it to the virtual hard disk.

The built-in rescue system and its limitations

January 20, 2008

You might have installed Vista for a lot of times, but never found the rescue system?

The reason for this is that the rescue system is a bit hidden in the setup to avoid newbies to get confused by it, I guess.

When you boot up your Vista setup, The pre-setup wizard will ask you to select language and keyboard settings. After clicking “Next” and “Install” you will notice that the screen background changes color slightly and soon the screen to enter the product key will appear. At that point (somewhen after the screen background changes and before you entered your product key) you will have to press Shift+F10 to open a command shell.

Now you can exit the setup (which will give you some more free RAM), but you may not exit the pre-setup wizard; as soon as you exit that one, your Windows will reboot.

From there you can start several utilities that are included in the setup, but unfortunately you can neither start an explorer nor extract files from install.wim.

For the explorer problem: You can load notepad (the Windows Editor) and abuse its Open dialog as some kind of notepad. But that does not help you: if you want to start applications from there, you will have to use the command shell for that (which is hard if you do not use that very often).

The larger problem (from my point of view): if you hosed your Windows installation and maybe even know which file got destroyed, you cannot restore just that file manually. This also means that you cannot extract files from install.wim into the ramdisk and run them from there out of the box.

Of course, there are solutions for both of these problems and I will post them soon. If you know better ways (or other problems) feel free to write a comment.

Why not use BartPE or VistaPE?

January 20, 2008

There are two well-known rescue systems based on Windows (and some rescue systems based on one of those two): BartPE (which uses Windows XP) and VistaPE (which uses Windows Vista). Both are great projects, sure. But they have several drawbacks:

  • You cannot distribute the finished CD (because they include files from Windows), so everyone has to build his own one
  • You will need a working Windows to build it
  • Usually, a Linux live CD (like grml or Knoppix) is more useful than a Windows Live CD
  • They are huge (hundreds of megabytes) and you will most likely not carry them with you all the time because CDs are larger than USB pens
  • If you have an USB pen, putting portable apps on there is better since you will use them much more often than BartPE/VistaPE.

As a result, you will usually have lots of portable apps and Linux live CDs handy, but no BartPE/VistaPE, if you need one (and if not, you will quickly find some computer magazine CDs that have a customized Linux live CD included…). You will never find a computer magazine that has a usable BartPE or VistaPE included…

So, LiVista Rescup should provide the following:

  • Be small – not larger than necessary
  • Include no files from Microsoft that cannot be redistributed
  • Enable you to use all your Portable Apps you have with you.

What is LiVista Rescup?

January 20, 2008

By today, Windows Vista has been sold a lot of times. Regardless whether you have a retail version, an OEM (“system builder”) version or a pre-installed version, you always get an installation DVD (or an “Anytime Upgrade DVD”) that includes a simple rescue system you can use if your Windows does not longer boot. That DVD will be the same for all Vista versions of the same language (okay, there will be one 32-bit and one 64-bit DVD for each language), and all installed files are stored in an install.wim file on there. So, everyone that is using Vista, basically has one of those DVDs.

The aim of this blog is to document and discuss about ways of making the rescue system built into the Vista Setup more usable. By default, you have no taskbar, no explorer, and cannot even extract files from the install.wim file separately. You can use some of your portable apps (like Firefox), but a lot just do not work.

So I want to build an addon (ideally an exe file you store on your USB pen) that you can execute from the rescue system and it will automagically build a nice user interface for you – without containing any files that are from Vista (or even without any files that are not open source). So you have to carry that one around with you (you have an USB pen with portable apps with you anyway, don’t you?) and whenever you forgot to wear that “No I do not fix your computer” T-shirt and anyone asks you if you can fix their Vista, you have everything you need.

The current state is a bunch of batch files that load up a taskbar and an explorer, and add support to extract single files. But, of course, we can do better 🙂

Why that name, you ask. Take Live Rescue and Vista Setup and move them together like in the picture below:

LiVista Rescup animation