WinBuilder Help Manual

Welcome to the help pages of WinBuilder!

Inside this manual you'll find details and quick start guides related to wb. If you haven't found enough information to answer your questions, please let us know what you think needs to be changed or added to make this manual easier to understand. You are kindly invited to place your comments here.

Starting up is easy and you can do it in 3 steps
  1. Start WinBuilder.exe from an empty folder.
  2. Get your fresh projects using the Download Center.
  3. Select the project you want to build and click play.

Please follow the Step-by-Step installation description recommended here

Contents

  • Overview
  • Installing
  • Compatibility
  • Tools
  • Scripts
    • Syntax
    • Syntax added in version 080
    • Interface
    • Application scripts
  • Projects
    • VistaPE
    • LiveXP
    • nativeEx
    • NativePE
    • picoXP
    • MobileOS
    • ReactOS
  • Bugs
  • License
  • About WinBuilder

Overview

WinBuilder is a flexible boot disk builder.

This program can create all sort of bootable environments based on the source that is used. There are several projects available for winbuilder so please remember to read the instructions found inside each project to understand which compatible sources can be used.

Some of the features to expect from wb

- Friendly User Interface
- Users can freely select, download, and update new scripts from the internet
- Scripts can be configured without needing to edit any code in most cases
- Most scripts already come included with freeware applications
- Customizable projects, everything can be customized and improved.
- Many built-in tools to edit and create new scripts inside wb
- Much smaller/efficient boot-disks and more flexibility to add changes.
- Tool specially targeted for boot method challenges.
- Last but not least - A very active community

This help manual is also available as a single .chm file download here

Installing

This program should be placed inside an empty folder and you can all projects you wish to try from the Download Center in wb.

There are no restrictions about spaces on path names or using non-ascii characters. We're using c:\WinBuilder as an example but you can also place it on your desktop if you wish.
By default wb starts with the Recommended level and you only need to click the Download button to get the recommended files from each project.

After the initial download is concluded - the program will restart itself to start fresh and find all available projects.

These projects and files can be found under a new sub-folder called Projects.

This program is not based on static paths meaning that you can move your wb work folder to other locations and still let your projects work.

Please read the chapters below to understand in more detail how this process works.

Important details when downloading

In the Download Center you find a few folders called Tools - althought these folders do not contain any projects at all - they do contain a small set of third party applications (tools) and files that are shared and required by projects.

In most cases this folder only needs to be downloaded once.

Please include it when downloading files for the first time.

Download Profiles

The download center contains some servers - each server can contain hundreds of megabytes worth of project scripts and files.

The first time you try wb - You don't need to download everything.

To ensure that you can test each project without having to download all files - you can use the profiles box at the top of the download center window.

This box allows you to choose scripts automatically.

  • Minimum - Selects newer versions of indispensable scripts
  • Recommended - Only chooses newer scripts marked as recommended
  • Complete - Marks all newer scripts for download
  • Beta - Profile used only for beta testing.

Using this profile box you can easily select to only download the Minimum profile which is helpfull for dial-up connections. You may select the Complete download if bandwidth is not a restriction and you wish to get all available scripts.

Running your first project

Click on the root item of each project to view how it should be used.
In most projects you just need to click the Play button (blue triangle) and a wizard will ask you for the project source files location and continue the project build.

Whenever you need to change this default location, you can click on the "Paths" tab and modify as needed.

Please read here to view the pages that detail how to use each project so that you can understand more about the needed conditions to build your project.

Compatibility

WinBuilder.exe is supported on Microsoft Windows 95/98/ME, Microsoft Windows NT4/2000/XP/2003 and Microsoft Windows Vista.

It will require Internet Explorer (5.0 and above) to be installed on your machine to properly acess these help pages and use the Web tab.

It won't require any .NET framework or any similar component. It is mostly a standalone application without special external dependencies. (you can even disable the whole network access and IE won't be needed at all).

Vista support

Under this OS it will be necessary in most cases to disable UAC (User Account Control) to allow creation of the needed registry hives when building a new boot disk. Unfortunately, Vista disables by default any atempt to access the registry even when running under the administrator level account.

This is not a default requirement for all projects - only for those who require the load hive functionality

Scripts

Script files are simple text files that use the extension .script which can be edited with wb's internal editor, you can also use your favourite text editor or a simple text notepad.

Detailed information about scripts
  • script syntax
  • script variables
  • application scripts

FAQ
  • Where do I place my scripts?
  • Why some scripts only work with some projects?

It's recommended to use wb's internal editor to let help you customize the script and highlight the source code syntax while scripting.

You can use wb's internal editor by selecting a script and clicking on the Edit button.

When running WinBuilder, click on the Tools button where you can also find a small utility to help you creating your scripts from available templates.

The learning curve to make your own script is very simple and acessible.

You can use other scripts as example to create your own scripts and then share them in the forums to help others if you wish - also a good place to ask for scripts that support the programs you like.

Where do I place my scripts?

You can place your scripts inside the same folder where the project you want to create is placed.

Using LiveXP as example, you can place your scripts inside the %BaseDir%\Projects\LiveXP folder, where %BaseDir% is the same path where WinBuilder.exe is found. Placing your script inside this folder is more than enough to make it available from the the main window when browsing your project.

Also worth noting that some projects also have a specific folder where all related scripts are grouped. Using the same LiveXP example, you can place your scripts with programs inside the %BaseDir%\Projects\LiveXP\Apps folder.

Why some scripts only work with some projects?

Even thought all scripts are created equal and use the same scripting language - different projects can use very different ways to add programs and functions.

In most cases you should understand which projects are compatible with your script before trying to use it. There is also an ongoing effort to make scripts work in a wider variety of projects, read here for more details.

If you are using the Download Center as source to get your scripts from the internet, then you won't need to worry about this since each server only contains scripts that are always correctly placed inside compatible projects.

If a script is growing outdated, you can try to adapt it yourself. Pick a similar script that works the way you need and use it as example, adapting things as needed.

You can also post all your inquiries about .script file coding in our community where others can tell you which specific steps may be needed or even teach how to update your script.

Available Projects

Projects are the way to build a specific boot disk and you should always read the information page of each project you intend to use before you start building a project.

Specific details are included to help you use compatible sources and learn how to debug some common issues that might sometimes appear. If you still have any doubts about how to proceed that are not covered in this manual, you're invited to ask for help on our community forums.

  • VistaPE
  • LiveXP
  • nativeEx
  • NativePE
  • picoXP
  • MobileOS
  • ReactOS

Bugs

WinBuilder is a tool in progress and there are always bugs being reported and properly solved, we always appreciate your feedback and reports in case a bug is found.

Bugs can be divided in two types: WinBuilder or Project.

  1. WinBuilder - Visit this page and check if you're using the latest version - report here if you need. It's always good to use the latest versions since they contain several improvements at each time a new version is released.
  2. Project related - Each project has a specific forum where all related issues and fixes can be found, please visit the respective forum page for more details.

In both cases, when reporting for a bug it is recommended that your search the forums to check if any other person has already posted a similar report and post a comment in the respective thread. Your feedback will help others who may be able to assist in quickly finding a solution.

AntiVirus debugging

It was ocasionally reported by a few users that some AntiVirus can interfer while scripts are copying or deleting files. It's advisable to temporarily disable the anti-virus only when debugging while the building process is running to check for possible causes that keep your project from being concluded as expected.

Under normal circunstances there is no need to disable your Antivirus.
Please be aware that antivirus programs will scan any files being copied which may impede performance.

Special project settings

 Please note that some projects may require specific conditions to be properly executed such as VistaPE which requires being used exclusively on NTFS partitions to properly handle WIM images, please read the specific project page to view more details.

WinBuilder itself can run quite happily both on FAT32 or NTFS partitions.

License

This program is freeware and can only be used under the terms of the respective license.

The full scope of WinBuilder's license is available to read inside the program by clicking on:
Tools --> Options --> View License Agreement and is applied only to WinBuilder.exe.

Projects, Scripts and other files distributed along with WinBuilder are subject to their own licensing terms whenever applied and always according to the respective author terms - which should always be credited for their work when creating distributions or derivated versions of wb.

WinBuilder.exe is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.

The Developer of WinBuilder.exe is Nuno Brito (mail@nunobrito.eu).

Copyright © 2006-2007 Nuno Brito. All Rights Reserved.

All relevant trademarks are acknowledged.

About WinBuilder

Wb was coded with the intention of creating a flexible boot disk tool with an easy to use interface. All projects available today were only made possible due to the long and constant help of people who believe and keep struggling to make this sort of solutions freely available for everyone else enjoy.

If you found our work useful, why not drop a quick visit to the good folks in our community and say hello

Thank you for using wb.

Please let us know if this page is not complete or in case you still haven't found needed information.


Tools

Contents

  • Overview
  • Compatibility
  • Internal Tools
  • Script editor
  • Backup
  • Create new script
  • Convert tool
  • Upload
  • FTP client
  • New Web Server
  • Single script upload
  • Options
  • Language
  • CodeBox
  • Web
  • Help system
  • Third Party tools (look in Overview)
  • FAQ
  • Bugs

Overview

This page will focus the tools that can be used to assist scripts in the process of completing a project or tools available for some specific tasks.

We can divide these Tools under two categories and will describe each one of internal WinBuilder tools.

  • Internal tools and settings
  • Third party tools
  • H7SE plugin Builder
  • MakeScript

These tools were added with the purpose of combining the several steps necessay to produce, test, run and publish new scripts. Whenever this information is not complete enought and you have doubts on how to make things work, don't hesitate in placing your questions on our forum so that aditional information can be added on these pages.

We also welcome requests for new tools to be added in the future.

Compatibility

These tools were added with the intention to work under Windows 32 bit environments since Windows 95 up to Windows Vista. Not major compatibility issues are present, except for some tools like WimUtil who should be executed on NTFS partitions to properly handle WIM images.

You might also require to run some of these third party tools under an account with Administrative level.

Internal Tools and Settings

As mentioned on the introduction we will now detail each one of the tools that are included inside WinBuilder.exe - some of the focused tools might only be available from more recent wb versions.

Please use the latest published binaries or stable beta releases to ensure the best results.

If you find any bugs that need to be corrected, please let us know so that they can be solved quickly - thanks!

Script Editor

Scripts are not static and you can edit or modify them as needed - this is a very simple and intuitive process.

Select the script you wish to edit from the Main window and then click on the Edit button

Note: Clicking on the logo image of the script will also enter edit mode.

This script editor contains several tabs - each one with a specific purpose
  • Interface Editor
  • Description
  • Attachments
  • Options
  • Source Code

Interface Editor

With this tool you can manage the objects placed within the interface of the script. These objects are very simple to handle. You just need to press the add button and select the object you wish to add from a list.

If you wish to remove a component you should select it and then press the delete button.

Selecting an object will also allow you to resize it and add your customizations. You don't need to edit

Some scripts have this interface locked - clicking on the small lock at the upper-right corner will unlock the interface.

There is a known issue when you are working with only one object - to solve this little annoyance you can either add another object to allow reselect it or leave and re-enter edit mode. It should be corrected soon.

Description

On this tab you can write the details that will be mentioned on the [main] section of your scripts.

It also lets you select a logo image to help identify your script. You can use images in some popular formats like BMP, JPG and GIF - animated Gif's are also supported.

Attachments

Use this tool to add files inside your scripts.

To allow your script to properly include binary files and still be editable with any text editor - these files will be encoded using a process similar to the attachments included inside email messages.

When adding your files, please be careful not to include big sized files or software that is not authorized to be freely distributed inside scripts.

The interface is very similar to any other archiving utility like 7zip and you should be able to quickly learn how to use it properly.

These files can later be extracted while the script is running to the location you wish. Look here for more details

Options

On this tab you can change the behavior of the script when it is enabled from the main window.

It was added to ensure that other required scripts or even other scripts that are incompatible get disabled or enabled to automatically to help users.

  • Dependencies - all scripts listed here will be enabled whenever possible
  • Disable - the scripts on this list will be disabled if they are enabled on your project.

In each box you can specify the path to the scripts you wish to control. To avoid using static paths you can use these variables to make the path dynamic
  • %ProjectDir% - is the full path to your project folder
  • %ScriptDir% - it's the path where this script is located
  • %BaseDir% - is the path where WinBuilder.exe was executed from (base)

You can also list more than one script on this text box, just split each script with a comma.

Inside this tab you also find some good examples on how it should be used.

Source Code

This tab allows you to edit the source code of your script.

It's the place where you can view and add your commands. To help you on this task you can press the right-click button of your mouse to view a menu that contains all available commands.

This menu will help to perform tests quickly and browse all available functions. Once you select a command it will be added in the place where your cursor is placed.

This command will also contain a quick template of the proper syntax as an example to show how to use it. With this menu you won't need to memorize all functions.

Changes on the [interface] and [main] sections are ignored for security reasons.

Backup

This tool can be found inside the Tools menu when you click the "Tools" button on top of the program.

What sort of backup is done?

It will simply copy the contents of the selected folders to a new folder that is labeled with a date and displayed on the list of backups window.

You can select to backup the following folders
  • Projects
  • Target
  • ISO

There is also an option that allows to completely remove the copied folders after the backup is completed.

This tool is mostly used to help starting wb in fresh condition - or to create multiple projects snapshots to test different results.

You can restore each one the available backups using the available buttons, or browse the backup with any file manager.

By default a folder called Backup is placed in the same folder where WinBuilder.exe is placed (%basedir%) and you can view all backuped files.

Create new script

This is a tool that helps creating new scripts and use a small set of templates and wizards to make this process as user friendly as possible.

To create a new script you will only need to specify where you wish to place it on the "Location" box and write a filename under the "Filename" box.

On the right you find a text window that is already filled with some default values.

Pressing the create button will create a script with details and code you've written.

Using the templates tab

Inside this tool you also find a tab called "Templates" - this tool helps you browse some specific code templates that most of the coding and allow you to add pieces of code already written by other members.

Inside this tab you will also find two special programs designed to assist you on the process of creating scripts. You can click on the MakeScript or H7SEpluginBuilder to start them - please add the details such as path and filename of the script you want to create on the "script" tab before launching them.

Other templates are small text files that you can preview and add inside your code if you wish

Convert Tool

Use this tool to convert files from one file format into text compatible to be used inside scripts.

You can convert the following formats
  • Text files
  • BartPE plugins

Please note that the bartPE plugins does not completely translates all code and will only help converting most of the plugin into usable script format - you will still need to edit and adapt the resulting code as needed

Upload

This is a very important tool for everyone who wishes to create a new Download Server or upload their updated scripts.

Configuring your FTP details

You only need to configure these upload tools once in most cases.

The first tab is Settings - on this tab you find a box with the same name that contains the following fields
  • ftp:// - the path to your FTP server
  • WebServer Path - the path where your project is located
  • Username - you account username
  • Password - the security code to access the account

There also another option on this tab

Skip Upload Test - When you have this option selected, you will skip the test that will verify that a download server is already created

FTP Client

WinBuilder has an internal FTP client that will allow you browse your FTP server. It will use the same settings provided on the previous tab.

You only need to press the connect button if the Settings tab already contains your account details.

It is the best way to test your settings to see if they are correct.

New Web Server

This tab will allow you to create a new Download Server that can later be used to share your projects and scripts with others.

The Web Server is a copy of your Projects folder.
It will upload all files, scripts and projects from your Projects folder to a location on a network server using FTP.

What do you need?

Before starting you will need to have an FTP server to where you can upload your files. Popular .script developers on boot-land.net get an FTP account to host their work.

What needs to be done before creating a web server?

Before you start uploading anything please check the list below
  • Test your projects before uploading since this will be same way how users will download it.
  • Clean all personal settings that are only valid on your computer like paths to where your sources are placed, serial numbers from licensed software scripts, etc
  • Delete all temporary files created while your project was built - most projects are starting to place their temporary files outside the Projects folder, but you should still check to see if any clutter is left to clean from your folders.

What needs to be done after uploading all files?

It is recommended that test your newly created download server from an empty folder to see for sure that everything works as you expect.

These web servers can sometimes contain hundreds of megabytes containing scripts and programs. You surely don't want to spend many hours uploading your projects folder just to discover that there was something wrong and you need to repeat the same process.

Here's a little trick for quick testing and help you learn to use this tool

Install an apache server on your computer - this may sound hi-tech-geek-dificult but it's not.

I recommend you to use xammp because it's free, small and you can quickly make it work without fuss - it also comes with screenshots for each step you need to take.

Download here: xammp

I recommend that you download the 7-zipped version since you can control where you want to place it.

Install xammp on a simple folder like c:\xammp (to avoid Vista possible UAC restrictions under Program Files) and you'll quickly be running your own webserver.

You can test this server by typing localhost on your favourite web browser

Configure the FTP server application (found on \xampp\FileZillaFTP) to use the same folder as the http server

Look here for a description of the folder you'll find and configure the anonymous account from the ftp server (\xampp\anonymous) to start on the same folder as the HTTP server (\xampp\htdocs)

When they both match they you will be uploading files from your FTP the same way as found on internet servers.

For FTP account you can use anonymous leaving the password field empty.

Having a local server is the perfect way to test everything since you can control everything and repeat the same tests over and over again without spending any bandwidth or waiting a long time for this operation to complete (both uploading and downloading).

Once everything is the way as you expect - time to upload only once to the internet FTP server and share your project.

More details about the New Web Server tool

On this tab you also have the option to specify a title for your server - this title will be displayed whenever a user download the list of available files on the Download Center.

The option "Skip file upload" will do as the name indicates and won't try to upload any files - it will create two new files on your projects folder: index.html and updates.ini - the html page is a web page containing the presentation for the scripts found inside your projects folder. Updates.ini is the file that contains a full description of values needed to know about the files availables for download.

This option is used whenever you wish to use your favourite FTP client to upload your files. All you need to do is upload of all files inside your Projects folder to any location you wish.

Look here for live examples of index.html and updates.ini

Single script upload

This is a feature that allows to upload an individual script to an already existent web server.

We've already detailed how to create a New Web Server and we could always overwrite it again to reflect the changes if needed, but why upload back all scripts since we only need to update one file?

To answer this request, there's the option to click and immediately start uploading your script to the web server specified under the Settings tab.

This is a very simple one-click operation.

May take some extra seconds to authenticate on slow FTP servers while uploading (depending on the size of the script), please wait until this operation is completed and a message box is displayed.

Options

The options tab allows to change some settings to work as you prefer or read more informations about wb.

Can be grouped as
  • Local Registry
  • Log Window
  • Network support
  • License Agreement

Local Registry

This box contains settings that allow you to write associate winbuilder related files to open with your favourite text editor. You have the option to add the file association on your registry and later removed if needed.

You can also make wb ensure that these script files are predefined to your text editor when the program is starting up.

Log Window

Control the behavior of your log window after a project is concluded.

The first option "View in browser after saving" means that when you press the Save log button inside the log window your log.html file will be created and opened using you favourite browser.

The second option "Open log window after process" will show you the contents of the log window when your project has finished running all scripts. This is an usefull option when debugging your projects and scripts.

Network support

You can enable or disable network support inside WinBuilder.

This applies to
  • Web tab
  • Download Center
  • FTP client
  • New Download Server
  • Single script upload

Use this option under restricted environments where the program is not authorized to access the internet.

License Agreement

Clicking on the "View license Agreeement" box will open a new window that will display the terms of WinBuilder's license.

As you might know, this program is freeware for both personal and commercial uses - but distribution and usage has to comply under the terms of this license.

It's not meant to be restrictive to the end user since WinBuilder is always provided for free in good faith, but these are the formal terms in which WinBuilder can legally be used and shared. These terms were needed to be written in order to avoid any abuse of rights in the future.

To avoid having to distribute WinBuilder.exe along with a separate license file - these license terms were merged inside the binary itself where they are always available for everyone to read.

Language Support

WinBuilder can support multiple languages and users can submit their own language files.

Each term to be translated uses a numeric key to allow the same term be applied on similar cases. This avoids having to write thousands of messages which would only become a very tedious task for anyone proposing himself to complete a translation.

Since our program is constantly changing values and adding new features - languages would grow outdated quite quickly and surely most translators wouldn't always be available to provide the needed updates.

Whenever a language file is available, this program will compare it against the internal language database (in default english) and will add the missing terms.

This also means that even old translated language files that are not completed with the latest changes will still be valid to be used and you'll be able to complete yourself what needs to be corrected.

How to create your own language wb?

You can start by clicking on this button from the Language tab

This button will open a box asking for a filename to describe your language. Use only english compatible characters and description so that it can be understood under as many languages as possible.

Example
Language: Português - Portugal
Translation filename: Portuguese [Portugal]

As you noticed - the English designation of the language was used.

How to edit your language?

On the same tab you find the window that lists all values and corresponding translated terms - just write each term the way it best fits your language and press the save button.

Where do I find my language file?

All language files are placed under %BaseDir%\Projects\Tools\Languages

%BaseDir% is the same path from where you run WinBuilder

If this folder doesn't exist, English language is used as standard - when creating a new translation file this folder is automatically generated.

You can edit any of these language files with a simple text editor.

How do I share my language file?

Look on community forums for the language specific sub-forums where you might find more people that share the same language, if there isn't a forum created then you can post on the main winbuilder discussion forum

We are always looking for volunters to help translating so consider yourself very welcome to contribute to this effort. Thank you.

Code Box

Code box is a tool added to quickly help you test new commands.

It will create a small template script that will be executed whenever you press the play button inside this tab. With this tool you can run commands to see how they work and view the results on the log window.

You can also add commands using the right click menu in the same way as the internal source code editor

Each code box script runs exactly under the same conditions as any other script inside your selected project, making this a good tool for debugging variables and commands.

The code you add inside the Code Box is automatically saved inside a file called CodeBox.txt which can be found on the root of each project where you use it - this way we ensure that you can have a Code Box specific to a single project.

Web

The web tab was added to help people keep in touch with the community.

From the custom homepage you can quickly view the latest discussed topics from our forums and also read more pages that details the use of this program.

WinBuilder's homepage is available here: http://boot-land.net/forums/wb.php

If you have good php programming skills we would appreciate your help to make this page even more interactive and add aditional features that could help our community to share experiences and feedback in a better way.

Everyone is invited to post their ideas and requests of things that should be added or changed on our homepage.

Help system

This help system is a collection of web pages that are available on the internet where everyone can read them.

To ease offline navigation, they automatically selected for download using the Download Center and whenever these pages became available on disk, a new tab called Help will become available.

This way we ensure that help is quickly acessible, complete and updated as much as possible.

All web pages once downloaded can be found inside %BaseDir%\Projects\Tools\Help

%BaseDir% is the same path where WinBuilder.exe is placed

Since all pages were written by humans - it is only understandable that you find some errors or grammar in sentences that need to be corrected. We keep trying to make the texts bug free and clear to follow.

As always, you're very welcome to let us know if something needs to be added or corrected. We would really like to hear your opinion and thoughts since this is a true community effort where we can freely share our knowledge.

Frequently Asked Questions

Q: I want to create a new script with these tools, but I still have lots of doubts about scripting and all things that need to be done to get my programs working - where can I find more info?
A: Perhaps the best help you can get is reading other scripts that work the way you need and apply them to run your programs. Don't forget to also ask people whenever you find something a bit harder to understand or do, nobody knows everything from scratch so take one step at time and things will start to make sense quickly.

Q: One of the programs found inside the tools folder is very outdated and a more recent version has just come out - can we see it updated on the download servers?
A: Sure it can! Sometimes it takes a bit longer to updated to newer versions but whenever possible it will be done.

Q: I'm trying to create my own Web Server to share some project files with a few friends, how can I get an FTP server from boot land?
A: Hosting on boot-land.net is freely available for everyone who contributes in his own way to share his knowledge and work. Try exposing all your ideas and scripts on the forums where you'll surely get support from other members and even hosting if needed.

Q: I'm trying to upload a script but it's not working - do you have any ideas why?
A: It might be that you're using a proxy - at the moment you need to use a direct network connection do upload files. However, the Download Center should always work as long as you can also access the Internet with IE (it will share the same settings)

Bugs

Bugs and requests are welcome on our discussion forum dedicated to these reports here

Please remember to add as much details as possible and it would also help if you described exactly how this bug can be reproduced.

Also check if you're also using the latest version since a lot of bugs tend to be corrected as new versions become available.

Whenever in doubt you can also help yourself and use the Search function inside the forums to find other members who might have reported similar cases to yours. You might even find answers to how they've solved the same issue or add your comment to ensure that it gets solved sooner.

Please let us know if this page is not complete or if you still haven't found needed information.


Application Scripts

Contents

  • Overview
  • Compatibility
  • Usage
  • FAQ
  • Bugs and Exceptions
  • Log of changes

Overview

Application Scripts is the way how scripts that use this method are able to be shared and used with different projects.

These scripts are specifically designed to add programs to your projects.

Advantages
  • Quickly allow you to write a new script that adds a program to a project with very few lines of code.
  • Easy to learn with very intuitive functions
  • Creates scripts compatible across different projects
  • Long lasting scripts that don't need to be rewritten to work on newer projects that support this method
  • Available on the Create Script tab - only need to add your files and change the title, description and folder name

Disadvantages
  • Very limited scope of functions, only basic functions are supported.
  • Targeted to smaller programs that need few files and settings.
  • The target program needs to be freeware in most cases to be distributed with the script
  • Still in development

Compatibility

At the moment this script method is supported on the following projects

  • VistaPE
  • nativeEx
  • LiveXP

Usage

An application script isn't much different from "regular" scripts but it will take for granted that you follow a few definitions and rules and this way have enough conditions that are used by all compatible projects

On this chapter you can read more about the available application functions and also find a quick guide.

Let's study a script example right now and start explaining how it works.

[main]
Title=Sudoku
Description=The popular number game
Level=5

[variables]
%ProgramTitle%=Sudoku
%ProgramEXE%=sudoku.exe
%ProgramFolder%=Sudoku

[process]
Add_Shortcut,Desktop
Add_Shortcut,AutoStart
Add_Shortcut,StartMenu,Games and Fun
unpack

As you may notice - very few lines are needed, also note that this script is composed by 3 script sections:
  • Main
  • Variables
  • Process

Settings on the [Main] section
  • More settings in this section can be added but only Title, Description and Level are needed as a minimum.
  • Since this script is meant to add programs you need to use Level=5 value to group it with other similar scripts

Settings in the [variables] section
  • %ProgramTitle% - Used as title for the created shortcuts
  • %ProgramEXE% - The executable file that should be launched when clicking on shortcut (no paths required, only filename)
  • %ProgramFolder% - The name of the folder where all files should be placed

More details about the variables section

  • %ProgramTitle% is the title of this program and we can use any description as desired, no need to be directly related to the exe or folder.
  • %ProgramEXE% stands for Program Executable and is used as the target application that is launched when clicking on the respective shortcut (if created), it can also be used to launch any other files besides executables like text files, html pages, bat files, etc.
  • %ProgramFolder% is the folder name where all files inside the script will be placed. You only need to add the folder name you wish to use, there's no need to add the full path.

Settings in the [process] section

This is the section that is executed when running the script so it's where we should place our functions.

Let's list and explain each one of the available functions:
  • Add_Shortcut,Desktop - This function will add a shortcut on the desktop
  • Add_Shortcut,AutoStart - Mark your program to be included on the group of programs that runs on start up.
  • Add_Shortcut,StartMenu,Games and Fun - In this example you can add a shortcut on the start menu, notice that applying the aditional parameter as "Games and Fun" will place your shortcut inside a folder on the start menu with this name.
  • unpack - A very important function because it will do most of the hard work of adding the needed files to your project.

How does unpack work?

Very simple, just add all your files meant to be "unpacked" inside your script.
By default all these files should be located on an archive called "Folder"

For this task you can use the tools found inside WinBuilder or use some of applications created for this purpose like "MakeScript" or "H7PluginBuilder".

Look under the script syntax page for more details on how to edit scripts and add files.

More details about unpack

This script concept works very well when all program files are included inside the same script. This also means that preference is given exclusively to freeware and open source programs that can be distributed on the internet with proper legal authorization.

Shareware can also be included in this category since the first term "share" implies that we can share the software - but please remember that in all software whenever appliable - your personal serial keys/data and product activation tools cannot be included under any circunstance.

Frequently Asked Questions

Q: How is this script used after all?
A: It is used to add simple programs and tools on your project in a quick and simple manner.

Q: What can be considered as "simple programs"?
A: In this category should be considered programs labeled as "standalone" and "portable" - which use very few files and registry settings. Also note that any program under this category should also be prepared to work under all available projects that support this method.

Q: Well, I need a special icon different than the one used by the script - how can I do it?
A: Don't use this generic script for these cases, read the chapter about exceptions and how to handle them in your scripts

Q: I want to use a script to add notepad on the windows directory instead of the programs folder, why can't these functions support this?
A: This is a specific feature that should be handled as an exception, you shouldn't use this method for these cases.

Q: How can we add more functions to the application scripts?
A: You will need to suggest and discuss them on the respective discussion topic, in most cases do remember to ask functions that can also provided by other projects to make them globally available

Q: Can I use this method and the project specific way to create these scripts together?
A: Yes you can, but it is not adviced. Both methods can work well together but should be kept in separate scripts. A script that was written with this common method should avoid using methods specific to a particular type of project.

Q: Where can these scripts be found or identified?
A: They can be included either inside your projects mixed with other scripts or you can find them in the download section of the community forums under the Application scripts category. We are also discussing a common folder where all these generic scripts could be placed but it's still in development.

Q: Is this method perfect?
A: No way! But we hope that this is a good method to create scripts that can work on most projects available at this moment and even on the ones to come in the future. This way we ensure that your favourite project can use as many available scripts as possible within the next years without having to rewrite or edit anything - making it easier for you to find more available programs.

Bugs and Exceptions

Since this method uses predefined functions based on the specific project construction, there are usually no bugs to be reported directly because of the used functions.

You should look on the discussion forums for assistance in case you find a script that doesn't work as you expected so that the community can properly view it and suggest other alternative ways to solve exceptions.

Log of changes

Inside each supported project you find a file called api.script which contains the complete log of changes. You can always download the latest versions of this file using the download center.

Please let us know if this page is not complete or if you still haven't found needed information.


Script Variables

Script Escape Characters

The following are the available escape characters:

  • #$c - Comma
  • #$p - Percent %
  • #$q - Double quotes "
  • #$s - Space
  • #$x - Newline

Here is a short explanation of what can be done and what cannot be done and when the escaped characters should be used.

First some rules:
  1. WinBuilder Script Line Parameters are separated by a comma. If a comma is inside an argument, it must be 'escaped' by #$c

  2. Besides some special cases (e.g. parameters in ShellExecute) generally enclosing quotes are not needed.

  3. Enclosing quotes MUST be used if the WinBuilder Script Line Parameters contain spaces. If the spaces are replaced by the escape #$s, the enclosing quotes should be omitted.

In most cases user violation of the rules are accepted by WinBuilder and processed as assumed. E.g. unnecessary enclosing quotes or a comma inside an item enclosed by quotes.

But sometimes that can bring unexpected results.

Let me give an Example:

Item1,item2 is understood as two items, separated by the comma.

Item1#$citem2 is correctly written to have one item with the comma inside. "Item1,item2" is the same.

Now the problem-version:

Set,%Var%,"Item1","item2" cannot be understood uniquely by WinBuilder.

Let's exchange the English understandable words by the character 'x'

"xxxxx","xxxxx"

Are there two quote-enclosed xxxxx, separated by a comma? > Set,%Var%,xxxxx
Or is there on long string of 10 xes, interrupted by a nested quote pair containing a comma? > Set,%var%,xxxxx#$q#$c#$qxxxxx
Or is there on long string of 10 xes, interrupted by a nested quote pair 'escaping' a comma? > Set,%var%,xxxxx#$cxxxxx

You see how important it is to follow the rules, even if WinBuilder understands most violations correctly.


Help page

Script Interface Section

Contents

  • Help home page
  • General description
  • Component description (common)
  • Component description (type depending)
  • Component description (WinBuilder 077 and later)
  • Known issue

General description

The Interface section contains one ore more single lines describing the components shown on the GUI.

Format of a line:
<name>=<description>

<name> is generated by WinBuilder containing the component type and an enumeration number. <name> can be changed by the script author individually.

<description> is an enumeration of fields, separated by commas.
If a single field contains a space, it is enlosed in quotes.

Component Types

There are 15 different types, internally represented by a number between 0 and 14
  • cmpTextBox = 0,
  • cmpTextLabel = 1,
  • cmpNumberBox = 2,
  • cmpCheckBox = 3,
  • cmpComboBox = 4,
  • cmpImage = 5,
  • cmpTextFile = 6,
  • cmpEditValues = 7, // not implemented
  • cmpButton = 8,
  • cmpCheckList = 9,
  • cmpWebLabel = 10,
  • cmpRadioButton = 11,
  • cmpBevel = 12,
  • cmpFileBox = 13,
  • cmpRadioGroup = 14

Component description (common)

These first 7 fields are common to all implemented components:
  • Text
    • cmpTextBox: Caption
    • cmpTextLabel: Caption
    • cmpNumberBox: <Component name>
    • cmpCheckBox: Caption
    • cmpComboBox: <Choice>
    • cmpImage: <File name>
    • cmpTextFile: <File name>
    • cmpButton: Caption
    • cmpWebLabel: Caption
    • cmpRadioButton: Caption
    • cmpBevel: <Component name>
    • cmpFileBox: <File name> or <Directory name>
    • cmpRadioGroup: Caption
  • Visibility (1=shown, 0=hidden)
  • Type of component (see above)
  • x-coordinate of component upper left
  • y-coordinate of component upper left
  • width of the component
  • height of the component

Component description (type dependent)

Fields 8 and higher (if present) depend on the component type:
  • cmpTextBox: <Value>
  • cmpTextLabel: <Font size>,<Font weight>
  • cmpNumberBox: <Value>, <Min>,<Max>,<Increment>
  • cmpCheckBox: <Value>[,<Section to run>]
  • cmpComboBox<Caption 1>, ... ,<Caption n>
  • cmpButton: <Section to run>,<Picture>
  • cmpWebLabel: <URL>
  • cmpRadioButton: <Value>[,<Section to run>]
  • cmpFileBox: 'FILE' in case of file, nothing in case of directory
  • cmpRadioGroup: <Caption 1>, ... ,<Caption n>,<Selected index, starting with 0>

Additional since WinBuilder 077 RC 2

Two additional fields are optional:
  1. For cmpCheckBox, cmpRadioButton and cmpButton: <Show progress window when running>
  2. For all: Tooltip. This field starts with a double underscore __ as marker.

Known issue

If you change a script containing WB 077 features with WinBuilder 076 or lower, the features are lost!

Please let us know if this page is not complete or if you still haven't found needed information.


Script Syntax

Contents

  • Overview
  • Compatibility
  • Usage
  • Syntax
  • Variables
  • Application scripts
  • Bugs
  • Change log

Overview

Script files use a very simple to understand language to run their commands and actions.

In general terms these files use the extension .script and can be edited with any text editor or using the internal editor from WinBuilder.

Settings are written in the form of Key=Value (e.g. Color=Blue) and these values are kept inside sections (e.g. [MySection]).

You can also add additional files inside your scripts and these files are stored as attachements in a process very similar to popular email messages. This way you can share your scripts in discussion forums with all the needed tools inside.

With this .script language you can copy files, create folders, write values on the registry and do a whole lot more.

We'll start off with very simple descriptions of each command and then some quick examples so that you can easily start understanding and creating your own scripts.

Compatibility

This page is updated directly from the internet and some of the commands that you find mentioned here might have been added only on recent WinBuilder versions.

It is recommended to use the latest versions to ensure the best results.

Usage

Overview

  • sections
  • levels
  • comments

Script files can perform both specific and generic functions.

Some scripts will be responsible for creating the base structure of the project while others will be used to add extra functionality and programs.

These scripts can also use a very specific model that only works on a single project and cannot be sucessfully used on another project unless it also shares the same model as the original project from where it came. The model consists of functions and variables stored in scripts.

An effort is being made to create a generic sort of script to add programs across different projects, please read the script applications page for more details.

Sections

We use sections to group commands and settings inside script files. The easiest way to see how they are applied is to edit a few scripts and look at the source code to learn more about them.

A typical script is composed by 3 important sections

  • Main - will keep all details that identify your script
  • Variables - used to keep variable values
  • Process - where your commands are placed

Script.project has two optional sections

  • OnProcessEntry - run as first command of every script
  • OnProcessExit - run as last command of every script

Here is a small example of how it should look:

[Main]
Title=Add my Program
Description=This script will add my program
Level=5

[Variables]
%myTitle%="This is a title for the program"

[Process]
echo,%myTitle%
....
....
We can additionally use more sections to add variables from the script interface or even specify more sections with commands to be processed. We'll detail this further in these pages.

The [Interface] section is also important to scripts but we'll soon be referring to it in another chapter.

[Main] section

Inside this main section you can store the definitions that identify your script and allow it to be properly categorized inside the project. This section works like a normal INI section where you write all your data in the form of Key=Value (e.g. Color=Blue)

List of available keys

  • Title - Title that is displayed by your script
  • Description - a short description of what the script is intended to do
  • Author - the author or group involved in the initial release, following releases or branches should be mentioned in Credits
  • Credits - details the people involved making the script possible or persons involved in updating the work.
  • Date - date of changes, any text is accepted - recommended to use "Year-Month-Day" all written in numeric format
  • Version - scripts support version and they are important to mark new updated scripts on the download center
  • Website / topic discussion - place a link here to help users to find their way to a site with more informations
  • download_level - used by download center to categorize scripts under download profiles (1..4)
  • Selected - using True/False will make your be checked or not for being processed. Place a Selected=none to completely remove any checkbox
  • Locked - use True/False to allows the users to edit the script interface
  • Level - very important setting to allow your script to be placed on the correct sequence when the project is running

All of these keys can be edited easily using the wb's internal editor

These keys are optional, but it is recommended to place at least a few keys to better describe your script to others.

  • Title
  • Description

Some keys are assumed with default values if they are not found inside the script

  • Title --> Display the filename
  • Level --> 5
  • Profile --> Recommended (value=2)

[Variables] section

This section is described in more detail here

[Process] section

All commands you write in this section will be executed by the program.

From this section you can also call other sections using the run command from the same script or other scripts if necessary.

The result of each operation is written on the log window - which you can later view or save to an html page.

[OnProcessEntry] section

This section is an optional secial section exclusive in script.project.

If it is present, during build this section is processed beforet the first [Process] line of every processed script.

[OnProcessExit] section

This section is an optional secial section exclusive in script.project.

If it is present, during build this section is processed after the last [Process] line of every processed script.

Example:
[OnProcessExit]
Run,%ProjectDir%\script.project,Process-log

Levels

Levels is a feature from scripts that allow you to choose when your script should run while the project is being built.

You can select values between 1 and 10, when the project starts it will begin with the scripts that have the lower level number and will increase a level after all scripts with the previous levels are processed.

This is a very useful way to ensure that your script always runs at the correct time. First levels are usually used to be build the structure of your project, while the last levels are the ones where your project is finished and an image is created.

By default, we use level 5 as the middle value where most scripts that are only meant to add programs should be processed.

To further categorize and group your scripts you can also create subfolders and in this way ensure that these scripts are separated from others with the same level. Look for examples on the available projects to understand more about these filters.

Comments

Comment lines are skipped during processing.
Comment lines start with two slashes.

Syntax example:
// This is a comment line

Out of compatibility reasons also two hash marks are accepted as comment marker.

Syntax example:
## This is a comment line, too

Syntax

First some general rules and explanations:

  1. Besides some special cases (e.g. parameters in ShellExecute) generally enclosing quotes are not needed.
  2. Enclosing quotes MUST be used if the WinBuilder Script Line Parameters contain spaces.
    If the spaces are replaced by the escape #$s, the enclosing quotes should be ommitted.
  3. WinBuilder Script Line Parameters are separated by a comma.
    If a comma is inside an argument, it must be 'escaped' by #$c.
In most cases user violation of that rules are accepted by WinBuilder and processed as assumed.
E.g. unnecessary enclosing quotes or a comma inside an item enclosed by quotes.

But sometimes that can bring unexpected results.

.script language commands are very dependent on the use of variables to make them more flexible, please read the respective variables page for additional information.

All available commands are described on a single page so that you can later print this page to use as reference.

Usually all command which compare etc. are case insensitive.

There are some commands having a "X" at the end.

These commands work like that ones without the "X", but case sensitive.

.script commands can be grouped under the following categories

  • File operations
  • Registry handling
  • INI manipulation
  • Attachments
  • Text Files
  • IF Clauses
  • Retrieve functions
  • String format
  • Network tools
  • Miscellaneous commands

File Operations

Commands under this category were designed to handle files and are particularly useful to create the base structure of your project or add additional features that you need.

List of available functions

  • FileCopy
  • FileDelete
  • FileRename
  • FileCreateBlank
  • FileByteExtract

  • DirCopy
  • DirDelete
  • DirMove
  • DirMake

  • CopyOrExpand
  • Expand

FileCopy

FileCopy,<FromFile>,<ToDir>
This command will copy a single source file to a specified destination.
If the destination is a folder name, the file is copied there.
If the destination is a file name, the file is copied into the destination folder and finally renamed.

The command uses Win32 API as a silent operation overwriting any previously existent files. You can view the result of this operation on the respective log entry.

WB076 added:
FileCopy of a single file gives a warning in the log, if the destination file already exists.

WB078 added:
If there is a parameter PRESERVE added, FileCopy of a single file does not overwrite an existing file. A warning is still given
The warning can be suppressed by an additional parameter NOWARN

The parameters PRESERVE, and NOWARN can be used simultaneously. The order does not matter.

Syntax example:
FileCopy,c:\MyPath\myText.txt,c:\AnotherPath,PRESERVE
Wildcards
FileCopy supports wildcards like *.* , win*.dll.
Then the command will copy all suited files and respective sub folders from a given source to a specified destination directory.
In case of using wildcars the warning mechanism is switched off.

Trying do copy wildcard source to a destination file raises an error.

WB078 added:
In case of wildcards optionally parameters can be defined: SHOW: The progressbar shows single file processing, and the actual copied file name is shown. NOREC: Only all suited files of the initial folder are copied. No recursion into subdirectories.

The parameters SHOW and NOREC can be used simultaneously. The order does not matter.

Syntax example:
FileCopy,c:\MyPath\*.txt,c:\AnotherPath

On this example FileCopy will copy all text files (*.txt) from MyPath and it's subdirectories to AnotherPath

FileDelete

FileDelete,<FileToDelete>
This command will delete files. It uses Win32 API as a silent operation deleting all files that match the search criteria. You can view the result of this operation on the respective log entry. Beware that all deleted files are immediately removed instead of moved to the recycle bin.

FileDelete supports wildcards ( *.* )

Syntax example:
FileDelete,c:\MyPath\*.txt

In this example FileDelete will delete all text files (*.txt) from MyPath

FileRename

FileRename,<OldFilename>,<NewFilename>
This command will rename a single file

Syntax example:
FileRename,c:\MyPath\myTextFile.txt,c:\MyPath\myOldTextFile.txt

In this example FileRename will rename c:\MyPath\myTextFile.txt to another filename as myOldTextFile.txt

FileCreateBlank

FileCreateBlank,<NewFile>
This command simply creates a new empty file with the filename you specify. If a file with the same filename already exists it will be overwritten.

WB078 added:
FileCreateBlank gives a warning in the log, if the destination file already exists.
If there is a parameter PRESERVE added, FileCreateBlank does not truncate an existing file. A warning is still given
The warning can be suppressed by an additional parameter NOWARN

The parameters PRESERVE, and NOWARN can be used simultaneously. The order does not matter.

Syntax example:
FileCreateBlank,c:\MyPath\MyNewFile.txt

In this example FileCreateBlank will create an empty file called MyNewFile.txt

FileByteExtract

FileByteExtract,<FilesToSearch>,<OutputFile>,<ByteSignature>,<BytesLength>
This is a command with a very specific function. It will look inside all files that match the search criteria for a specific byte signature.

Byte signatures are specified in groups of two digits that are expressed in hexadecimal format. Possible value range from combinations starting at 00 and ending at FF

If this byte sequence is found, then it will copy a specific number of bytes and save them as a new file.

The bytes that compose the signature are also the header bytes on the new file.

This command was originally designed to find a byte sequence inside some system files that contained resources. Please look in the forums for practical examples of usage.

Syntax example:
FileByteExtract,c:\MyPath\*.*,c:\MyPath\NewFile.bin,001122334455,1440000

In this example, if a match is found then a new file will be created with the size specified in BytesLength

DirCopy

DirCopy,<FromDir>,<ToDir>
This command will copy a folder and respective sub folders from a given source to a specified destination. It uses Win32 API as a silent operation overwriting any previously existent folder.

Syntax example:
DirCopy,c:\MyPath,c:\AnotherPath

In this example DirCopy will copy the complete directory MyPath to AnotherPath

DirCopy,c:\MyPath\*.*,c:\AnotherPath

In this example DirCopy will copy all files and directories inside MyPath to AnotherPath

WB078 added:
The optional parameter SHOW can be added. That will open the Windows internal progress window.

DirDelete

DirDelete,<DirToDelete>
This command will delete a folder and respective files and folders inside. It uses Win32 API as a silent operation to delete the specified folder. Beware that deleted folders are not recoverable from the recycle bin.

Syntax example:
DirDelete,c:\MyPath

In this example DirDelete will remove MyPath
WB076 added:
The optional parameter FAST can be added. That will rename the directory to a random name, and then delete in the background.

DirMove

DirMove,<MoveDir>,<ToDir>
This command will move a folder and respective sub folders from a given source to a specified destination. It uses Win32 API as a silent operation overwriting any previously existent folder.

The previous location ceases to exist with this folder being found under the new location

Syntax example:
DirMove,c:\MyPath,c:\AnotherPath

In this example DirMove will move MyPath to AnotherPath

DirMake

DirMake,<NewDir>
This command will create a new folder as you specify.

Syntax example:
FileCreate,c:\MyPath

In this example FileCreate will add a new directory called MyPath

CopyOrExpand

CopyOrExpand,<FileToCopyOrExpand>,<DestinationFolderOrFilename>
This is a very flexible command that is designed for cases where we can either need to Copy or Expand a file.

It was implemented to ease the task of copying files from Install CD's where often a specified can be present either in normal format or compressed.

These compressed files use the cabinet archiving method and usually have an identifiable _ as the last character on their extensions. (e.g. myFile.Tx_ ). When this file is expanded a new file with a full extension is retrieved.

DestinationFolderOrFilename means that you can either specify a folder where this file will be placed with the original (expanded) filename or new filename that you prefer.
Syntax example:
CopyOrExpand,c:\MyPath\myTextFile.txt,c:\MyPath\myNewerTextFile.txt

In this example CopyOrExpand will first try to find a file c:\MyPath\myTextFile.txt and if it is not found then it will look for c:\MyPath\myTextFile.tx_ and expand this file if successfully found. WB078 added:
CopyOrExpand gives a warning in the log, if the destination file already exists.
If there is a parameter PRESERVE added, CopyOrExpand of a single file does not overwrite an existing file. A warning is still given
The warning can be suppressed by an additional parameter NOWARN

The parameters PRESERVE, and NOWARN can be used simultaneously. The order does not matter.

Expand

Expand,<CABfile>,<DirToDecompress>
This command will decompress all files inside CABfile to the folder you specify.

Cabinet files usually use extension .CAB

Syntax example:
Expand,c:\MyPath\MyFile.cab,c:\MyNewPath

In this example Expand will try to expand all files found inside c:\MyPath\MyFile.cab to the folder c:\MyNewPath
WB078 added:
A single file can be extracted from the cab file, by giving it's name as third parameter

Syntax example:
Expand,c:\MyPath\MyFile.cab,c:\MyNewPath,YourFile.dll

Expand of a single file gives a warning in the log, if the destination file already exists.
If there is a parameter PRESERVE added, Expand of a single file does not overwrite an existing file. A warning is still given
The warning can be suppressed by an additional parameter NOWARN

The parameters PRESERVE, and NOWARN can be used simultaneously. The order does not matter.

Registry Handling

These commands are written to write and read values from the local registry on your windows machine. You can also load the hives from the projects being built at any given time.

These registry operations are valid for any Windows Platform, you should however note that Vista restricts the specific operation to load/unload hives - it is necessary to disable the UAC (User Account Control) before running projects that need this support.

List of available functions

  • RegWrite
  • RegRead
  • RegDelete
  • RegHiveLoad
  • RegHiveUnload
  • RegImport

RegWrite

RegWrite,<HKEY>,<KeyType>,<Section>,<Keyname>,<Value>
This command will create a new registry entry as specified.

HKEY is the "Hive Key" where the key is to be placed. These hives are files that are loaded by your machine when booting and compose the registry structure. By default, most scripts use HKLM as the work hive.

Valid HKEY values

  • HKLM
  • HKCU
  • HKCR
  • HKEY_USERS
  • HKEY_CURRENT_CONFIG

Details on the functions of each hive can be found at the Microsoft Site.

Keytype will specify how the data in the registry key should be interpreted.

Valid key type values

  • 0x0 - Empty key
  • 0x1 - String - writes a text value
  • 0x2 - Expanded String - will expand any variable value contained inside %%. (e.g. %temp%)
  • 0x3 - Binary data - adds data in binary format. Each byte is specified by groups of two digits splitting each value with commas
  • 0x4 - Dword - writes a numeric value
  • 0x7 - Writes multiple NULL separated strings

Section is the complete path to the section where the key is supposed to be written

Keyname and value are similar to the method for INI files, please ensure that the value you use is compatible with the key type.

Creating an empty section: Write a key using keytype as 0x1 and omit the entries for key and value - this will create a new section at the location you specify.

Syntax example:
RegWrite,HKLM,0x4,Build\ControlSet001\Services\VgaSave\Device0,DefaultSettings.XResolution,1024
The above example writes a numeric key with the value 1024 WB078 added:
RegWrite gives a warning in the log, if the destination value already exists.
If there is a parameter PRESERVE added, RegWrite does not overwrite an existing value. A warning is still given
The warning can be suppressed by an additional parameter NOWARN

The parameters PRESERVE, and NOWARN can be used simultaniously. The order does not matter.

RegRead

RegRead,<HKEY>,<Section>,<Key>,<%Variable%>
This command will read a value from the key you specify.

It uses the same components as described above with the difference that it will copy the value of a key into a variable.

This command will only retrieve values from the following keytypes:

  • 0x1 - String
  • 0x3 - Integer
  • 0x4 - Binary

WB078 added:
All key types are supported now.

Syntax example:
RegRead,HKLM,Build\ControlSet001\Services\VgaSave\Device0,DefaultSettings.XResolution,%myXresolution%
In this example the variable %myXresolution% will store the value of the mentioned key

RegDelete

RegDelete,<HKEY>,<Section>,<Key>
This command will delete the key you specify.

It uses the same components as described above with the difference that it will delete a key from the registry.

Syntax example:
RegDelete,HKLM,Build\ControlSet001\Services\VgaSave\Device0,DefaultSettings.XResolution
In this example the specified key will be deleted

WB076 added: RegDelete,<HKEY>,<Section>

This command will delete the section you specify.

Syntax example:
RegDelete,HKLM,Build\ControlSet001\Services\VgaSave\Device0

RegHiveLoad

RegHiveLoad,<SectionName>,<HiveFilename>
This command will load an external registry hive onto your local registry system.

It is particularly useful to allow editing the hives of project when they are being built. Most scripts usually load the needed hives for editing and after writing all necessary data are properly unloaded (command described below).

This command is based on Windows 32bit API and works under any Windows platform - under Vista it is necessary to disable the UAC (User Account Control).

Syntax example:
RegHiveLoad,Build,%targetdir%\I386\system32\setupreg.hiv
In this example we will load the setupreg.hiv hive file from our work folder and place it under a registry section called Build

RegHiveUnload

RegHiveUnload,<SectionName>
This command will unload an external registry hive from your local registry system that was previously loaded with the RegHiveLoad command or with another application capable of handling external hives.

This is an obligatory step whenever you use the RegHiveLoad command otherwise your project might fail to be properly completed.

It will use as parameter the section name where the previously loaded hive was placed.

This command is based on Windows 32bit API and works under any Windows platform - under Vista it is necessary to disable the UAC (User Account Control).

Syntax example:
RegHiveUnload,Build
In this example we will unload the setupreg.hiv hive file that has been loaded under registry section Build as described above.

RegImport

RegImport,<RegFileToImport>
This command will import an external registry file (*.reg) to your local registry system.

It will use as parameter the filename to read values from.

Syntax example:
RegImport,c:\myFile.reg
In this example we add the values from myFile.reg onto the registry system

Ini manipulation

This category contains commands that were created to work with INI based text files.

INI consists in grouping information using a few rules, it is also very easy to understand and edit when needed.

We use INI files to exchange information between scripts or store data whenever needed. In most cases INI language files use extension .ini - but our commands are not limited to just this type of extension and can be used on any text file that uses a INI derivated language like .script language.

Quick explaining some INI concepts:

  • A group of data (section) is always contained between [] (e.g. [MySection] ) and will only finish whenever another section is found or when the file has no more lines to read.
  • Each entry has a Title and is followed by it's respective data. Both are separated by an equal sign (e.g. Color=Blue)

Available INI functions

  • IniWrite
  • IniRead
  • IniDelete
  • IniAddSection
  • IniDeleteSection
  • IniWriteTextLine
  • IniMerge

IniWrite

IniWrite,<Filename>,<Section>,<Key>,<Value>
This command will write the key and value on the section inside the file you specify.

Syntax example:
IniWrite,C:\myFile.ini,mySection,myKey,myValue
In this example the specified myKey and respective myValue will be written in the section mySection in C:\myFile.ini
IniRead

IniRead,<Filename>,<Section>,<Key>,<%variable%>
This command will read the key from a section inside a file that you specify.

Syntax example:
IniRead,C:\myFile.ini,mySection,myKey,%myVariable%
In this example the value of the specified key will be stored inside %myVariable%
IniDelete

IniDelete,<Filename>,<Section>,<Key>
This command will delete the key from a section inside a file that you specify.

Syntax example:
IniDelete,C:\myFile.ini,mySection,myKey
In this example the specified key and respective value will both be deleted

IniAddSection

IniAddSection,<Filename>,<Section>
This command will add a new section inside the file you select.

If this section already exists - no action will take place otherwise it will create a new empty section in the respective text file.

Syntax example:
IniAddSection,C:\myFile.ini,mySection
In this example we're adding a new section.

IniDeleteSection

IniDeleteSection,<Filename>,<Section>
This command will delete a given section inside the file you select.

All keys and values inside this section are completely removed as well.

Syntax example:
IniDeleteSection,C:\myFile.ini,mySection
In this example we're deleting an existing section.

IniWriteTextLine

IniWriteTextLine,<Filename>,<Section>,<StringLine>
This command will add a text line to given section inside the file you select.

This line is placed on the top of the section.

Syntax example:
IniWriteTextLine,C:\myFile.ini,mySection,ThisIsMyLine
In this example a new line is added on the top of the section and all remaining lines are moved below.

WB078 added:
Optional APPEND argument

Syntax example:
IniWriteTextLine,C:\myFile.ini,mySection,ThisIsMyLine,APPEND
In this example the new line is added on the end of the section

IniMerge

IniMerge,<UpdatedINIfile>,<INIfileToUpdate>
This command will update all values from a INI file based on the contents from another INI file.

All Sections are compared inside both files and newer keys or items with different values are added to INIfileToUpdate

Syntax example:
IniMerge,C:\myNewValues.ini,mySection,ThisIsMyBaseFile.ini
In this example the command will read all keys found inside myNewValues.ini and if they aren't present, ThisIsMyBaseFile.ini will be added, overwriting older values if necessary.

Attachments

Attachments are files that can be included inside your script.

Since script files are meant to be edited by any text editor, these files are encoded in a process similar to email attachments.

This method allows to add small files along with your scripts in order to keep everything together.

While a script is running you can use some of the following commands to best take advantage of this feature.

List of related commands

  • ExtractFile
  • ExtractAndRun
  • ExtractAllFiles
  • ExtractAllFilesIfNotExist
  • Encode

ExtractFile

ExtractFile,<%ScriptFile%>,<Folder>,<Filename>,<DirToExtract>
This command will extract a single file from a folder inside a given script.

  • %scriptfile% is a variable that refers the filename of the script, it is used when you want to extract a file from the same script that you are running. You can also replace this variable with other filenames and extract files from them.
  • Folder is a directory where the file is placed under the attachments structure which is similar to a very simple filesystem, this way you can add several folders inside a script to organize your files the way you prefer.
  • Filename is the name of the file that you want to extract. No path is required, only the file name.
  • DirToExtract is the target folder where you want to place this file.

Syntax example:
ExtractFile,C:\myFile.script,Folder,myFile.txt,c:\
Using this example we will extract a given myFile.txt from myFile.script to c:\

ExtractAndRun

ExtractAndRun,<%ScriptFile%>,<Folder>,<Filename>[,<parameters>]
This command will run a file that is attached inside a script file.

Optional run parameters can be defined. They must not contain spaces, quotes or commas. Use the escapes #$s, #$q, #$c instead.

It is usefull when you only wish to run a file for a very specific purpose and this way avoid having to add extra commands to extract run and then delete the file from a temporary location when it is no longer needed.

Syntax example:
ExtractAndRun,C:\myFile.script,Folder,myApp.exe
Using this syntax we will extract myApp.exe to a temporary location and then delete this file when it has finished running.

ExtractAllFiles

ExtractAllFiles,<%ScriptFile%>,<Folder>,<DirToExtract>
This command will extract all files from a given folder inside a script.

Uses the same syntax as the ExtractFile command that extracts a single file, but with the advantage that you can extract all files from a folder without needing to specify any filenames.

Syntax example:
ExtractAllFiles,C:\myFile.script,Folder,c:\
Using this example we will extract all files found inside a folder in a given script file to c:\

ExtractAllFilesIfNotExist

ExtractAllFilesIfNotExist,<%ScriptFile%>,<Folder>,<DirToExtract>
This command uses the same syntax with the difference that it will only extract files from a section in a given script if they aren't already found in DirToExtract

It was added to support cases where it is required to download only newer files and keep the older ones unchanged

Encode

Encode,<%ScriptFile%>,<Folder>,<Filenames>
This command will encode and add files inside a given folder to a script.

You can either specify a single filename or use wildcards that match a file criteria.

If the folder doesn't exist, it is created otherwise files are added to the already available folder.

Syntax example:
Encode,C:\myFile.script,Folder,c:\myApp.exe
With this syntax we add c:\myApp.exe inside Folder to C:\myFile.script

Text Files

With this set of commands we can handle text files and modify them as needed. All these commands can be applied to either a single or multiple file using wildcards.

Description of commands

  • TxtAddline
  • TxtReplace
  • TxtDelLine
  • TxtDelSpaces
  • TxtDelEmptyLines

TxtAddLine

TXTAddLine,<Filename>,<StringLine>,<Action>
With this command we can add a text line at a given location inside a text file, you can specify this location using an action option.

Action options

  • PrePend - Will add the text line on the top of the text file
  • Append - The same as above but on the bottom of the file.
  • Place - Will place the text line after a specified number of lines (see example for details)

Syntax example:
TXTaddLine,C:\myFile.txt,Hello World!,place,5
With this syntax we add a line saying Hello World! in the 5th line counting from the top. If the text file doesn't have 5 lines, then it will be placed as the last line. There is no limit to this count value.

TxtReplace

TXTReplace,<Filename>,<OldString>,<NewString>
This command will look inside a given filename and replace all text that match the value of OldString and replace them with NewString

Syntax example:
TXTReplace,C:\myFile.txt,"Hello World!","Have a good day"
All matches to Hello World! within a text file will be replaced by Have a good day

TxtDelLine

TXTDelLine,<Filename>,<StringToDelete>
This command will look for lines that match the StringToDelete value and will remove these lines from the text file.

StringToDelete doesn't need to be the value of the entire line, it will only need to match the beginning of the line.

Syntax example:
TXTDelLine,C:\myFile.txt,Hello
All lines that start with Hello inside C:\myFile.txt will be removed.

TxtDelSpaces

TXTDelSpaces,<Filename>
This is a very simple command that will delete all spaces inside a text file. It was created to make some specific INI files smaller in overall size.

Syntax example:
TXTdelSpaces,C:\myFile.txt

TxtDelEmptyLines

TXTDelEmptyLines,<Filename>
With a similar function to the above detailed command, this function will remove all empty lines from a given text file.

Syntax example:
TXTdelEmptyLines,C:\myFile.txt

If Clauses

In .script language you can use If clauses to ease your life when running a script and to be able to evaluate certain conditions.

If a condition is true when you test it with the IF command then a command will be executed.

General format: If,<condition>,<command>
WB076 added second, optional line: Else,<command>

If a condition is false when you test it with the IF command then the second command will be executed.

<command> can be

  • Any valid script command

WB076 added:

  • A command block

List of available IF conditions

  • ExistFile
  • ExistDir
  • ExistSection
  • NotExistFile
  • NotExistDir
  • NotExistSection
  • Equal
  • Smaller
  • Bigger
  • NotEqual
  • Ping
  • Online
  • License
  • NotLicense

WB076 added:

  • ExistRegSection
  • ExistRegKey
  • ExistVar
  • Not
  • Question

IF Exist.. or IF NotExist..

If,<test>,<FilenameOrDirectory>,<Command>
You can use this test to determine if a file or directory exists in a given location. If this test is true, then a Command is executed.

When testing sections, you need to add the filename and then the section name.

Available tests

  • ExistFile
  • ExistDir
  • ExistSection
  • NotExistFile
  • NotExistDir
  • NotExistSection

Syntax example:
If,NotExistFile,c:\myFile.txt,FileCreateBlank,c:\myFile.txt
In this given example we are testing if c:\myFile.txt does not exist. If this condition is true, then FileCreateBlank,c:\myFile.txt will be executed

IF Equal, Smaller, Bigger, NotEqual

If,<%var%>,<test>,<value>,<Command>
This set of IF clauses will test number values

Available tests

  • Equal
  • Smaller
  • Bigger
  • NotEqual

WB078 added:

  • EqualX (compares case sensitive)

Syntax example:
If,%myVariable%,Equal,10,FileCreateBlank,c:\myFile.txt
In this given example we are testing if %myVariable% is equal to 10. If this condition is true then FileCreateBlank,c:\myFile.txt will be executed

IF Ping

If,ping,<xxx.xxx.xxx.xxx>,<Command>
Ping will test if a given IP is valid and run a command if this test is true.

Syntax example:
If,ping,10.111.8.1,FileCreateBlank,c:\myFile.txt
In this given example we are pinging a machine on the network. If this condition is true then FileCreateBlank,c:\myFile.txt will be executed. WB078 added:
Host domain name accepted

Syntax example:
If,ping,winbuilder.net,FileCreateBlank,c:\myFile.txt

IF Online

If,online,<Command>
Ping will test if the computer is online and run a command if this test is true.

Syntax example:
If,online,FileCreateBlank,c:\myFile.txt
In this given example we are checking if a machine is connected on a network. If this condition is true then FileCreateBlank,c:\myFile.txt will be executed.

IF License/NotLicense

If,License,<textfilename>,<Command>
This command was added to be used as tool to accept a license agreement whenever needed. It will open a special tab where the user has the option to read the terms of the license and then press a button corresponding to his decision to agree or not with the displayed terms.

TextFilename is the text file that will be displayed on the license window.

The option License runs a command when the user agrees with the license conditions and NotLicense will run a command if the user doesn't agree.

Syntax example:
If,NotLicense,c:\myEULA.txt,halt,"User doesn't agree with license."
This example will present the contents of myEula.txt - in case the user doesn't agree with this license the project build will be aborted.

IF ExistRegSection

If,ExistRegSection,<HKEY>,<Section>,<Command>
Syntax example:
If,ExistRegSection,HKLM,SOFTWARE\Classes\xyz,RegRead,HKLM,SOFTWARE\Classes\xyz,Language,%var%
This command will read the value of HKLM\SOFTWARE\Classes\xyz,Language, if RegSection HKLM\SOFTWARE\Classes\xyz does exist.

IF ExistRegKey

If,ExistRegKey,<HKEY>,<Section>,<Key>,<Command>
Syntax example:
If,ExistRegKey,HKLM,SOFTWARE\Classes\xyz,Language,RegRead,HKLM,SOFTWARE\Classes\xyz,Language,%var%
This command will read the value of HKLM\SOFTWARE\Classes\xyz,Language, if RegKey HKLM\SOFTWARE\Classes\xyz,Language does exist.

IF ExistVar/NotExistVar

If,ExistVar,<%var%>,<Command>
If,NotExistVar,<%var%>,<Command>
Syntax example: Set,%var%,NIL
If,ExistDir,C:\Program Files\IrfanView,Set,%Var%,1
If,ExistVar,%var%,Message,"'%var%' does exist",Information
In this given example we’ll check if the program path C:\Program Files\IrfanView does exist, if it’s true the value of %Var% will be set to 1. Then we’ll check if %Var% does exist, if it’s true a message windows with text ‘1’ does exist appears.

IF Not

If,Not,<Condition>,<Command>
Syntax example: If,Not,%var1%,EQUAL,%var2%,FileCreateBlank,C:\myFile.txt
In this given example the file c:\myFile.txt will be created if value of %var1% is different to value of %var2%.

Note:
If,Not,%var1%,EQUAL,%var2%,command is equivalent to If,%var1%,NOTEQUAL,%var2%,command
The current NOTEQUAL, NOTEXISTDIR, ... commands are still processes because of compatibility reasons.
But before processing they are internally changed into If,Not,...
Therefore:
If,NOT,%var%,NOTEQUAL,%test%,command is equivalent to If,%var1%,EQUAL,%var2%,command

If Question

If,QUESTION,<Question>,<Command>
As question, also all strings defined in the language files can be used like variables, identified by their ID number $#nnnn.

Syntax example: If,QUESTION,$#1541?,command (The question mark is part of the TEXT, not part of the ID!)

The resulting dialog box shows in case of default language (English):
Save changes to disk?
In case of e.g. italian language:
Salva cambiamenti al disco?
WB076 added:

Usually the question dialog waits for ever for the user's input.
You can cause to close it after a timeout, by adding the timeout (in seconds) and a default answer (Yes / No) as last arguments. If,QUESTION,"Exit Script?",Exit,"User decided",10,yes

Else

If,<Condition>,<Command>
Else,<Command>
The Else command must follow the If command immediately.

Syntax example: If,Not,ExistFile,C:\myFile.txt,FileCreateBlank,C:\myFile.txt
Else,Message,"File already exists",INFORMATION
In this given example we are testing if c:\myFile.txt does not exist. If this is true, then FileCreateBlank,c:\myFile.txt will be executed, otherwise a message windows with text File already exists appears.

Retrieve Functions

This set of functions will enable you to get some specific values when running your script.

They can be grouped as

  • FolderSize/FileSize
  • File/Dir
  • MD5

WB076 added:

  • FileVersion

Retrieve FolderSize/FileSize

Retrieve,FolderSizeOrFileSize,<DirectoryOrFilename>,<%var%>
This function is used to calculated sizes and store them inside variables.

  • FolderSize is used to get the overall size of folder along with respective files and sub-folders inside.
  • FileSize will report back the filesize of the specified file
  • DirectoryOrFilename is the target, it can be a file or a directory
  • %var% is the stored value (expressed in bytes)

Syntax example:
Retrieve,FolderSize,c:\myFolder,%var%
This example will write the size of myFolder as a new value for %var%

Retrieve File/Dir

Retrieve,File/Dir,<DirectoryOrFilename>,<%var%>
This function will bring a box asking the user to select a folder or a filename. Once a value is selected and the user clicks "Ok" to close the box, this value will be stored inside %var%

  • File is used when we want the user to select a file. You can specify the path to use and filter the accepted extensions or filenames to be accepted
  • Dir will open a box allowing the user to select a folder, you can specify where the initially selected folder is placed.
  • %var% is the stored value of the selected filename or foldername

Syntax example:
Retrieve,File,c:\*.txt,%var%

You can use this example to open a box asking the user to select a file. This box will start in c:\ and will only display files that match the filter criteria which is *.txt on this case. Once a file is selected, the %var% will contain the full filename of this selected file.

Retrieve MD5

Retrieve,MD5,<Filename>,<%var%> MD5 is a way to calculate a number known as a 'hash' or 'checksum' that is based on the filesize of a file.

It is used as a safety check to ensure that files are complete when they are downloaded from a server. You can also call this function to ensure that your files were not modified.

Syntax example:
Retrieve,MD5,c:\MyText.txt,%var%

This function will write the value of the MD5 result on %var%, you can compare against a security value written elsewhere to prove that your file is intact.

Retrieve FileVersion

Retrieve,FILEVERSION,<Filename>,<%var%>
Syntax example: Retrieve,FILEVERSION,”c:\Program Files\IrfanView\i_view32.exe”,%var%
This example fills %var% with the file version string, as it can be seen by EXE-file’s properties.

String Format

This category details a command that is used to perform numeric calculations or extract specific details from a given text line (string).

List of available options

  • inc - increase a given value
  • dec - decrease a given value
  • mult - multiplies a number
  • div - divides the number
  • filename - extracts the filename of a string removing any path details
  • path - extracts only the path removing any filename details
  • ext - outputs the extension of a given filename
  • bytes - convert a number of bytes into a human readable format (Kb, Mb, Gb, etc)
  • date - gives the current date

WB076 added:

  • Ceil - round up a number
  • Floor - round off a number
  • LTrim - left trim any chars in a given string
  • RTrim - right trim any chars in a given string
  • CTrim - trim the first and/or the last char of a given string
  • Left - get left chars in a given string
  • Right - get right chars in a given string
  • Mid - get chars in the midst of a string
  • Replace, - replace a part of a string with other chars
  • Split - split a string
  • CharToOem - convert between DOS and ANSI charset
  • OemToChar - convert between ANSI and DOS charset
  • Pos - find the first position of string#2 in string#1

WB078 added:

  • ReplaceX - replace a part of a string with other chars (case sensitive)
  • PosX - find the first position of string#2 in string#1 (case sensitive)
  • Len - return length of a string
  • NTrim - remove all numerical characters at the end of a string
  • ShortPath - convert to 8.3 path name
  • LongPath - convert NT siyle path name

StrFormat INC/DEC/MULT/DIV

StrFormat,<Action>,<%var%>,<n> This option is used to modify the value of a given number based on the arithmetic operation you select. It's also important to specify the value to use to perform this operation (only positive values). The result is outputted to the used variable (%var%), negative numbers are supported by this variable value.

List of possible Action values

  • inc - increase (%var% + n)
  • dec - decrease (%var% - n)
  • mult - multiply (%var% * n )
  • div - division (%var% / n)

n is the last parameter on this command and should always be a numeric value.

Syntax example:
StrFormat,Inc,%LoopAgain%,5

In this example we have a variable called %LoopAgain% with a value of 10. Once we increase the value of this value with the last parameter of this command we will get the same variable %LoopAgain% with a value of 15. This same example applies for all other available actions.

StrFormat FILENAME/PATH/EXT

StrFormat,<Action>,<Filename>,<%VarResult%> This option is used to extract specific information from the given text related to filenames.

List of possible Action values

  • Filename - returns the filename portion (no path)
  • Path - gives the path of the given text
  • Ext - outputs only the extension of the filename

Syntax example:
StrFormat,filename,c:\myPath\myFile.txt,%myVar%

This example will output to %myVar% a value of myFile.txt

WB076 added: The command now also can extract path, filename and extensions from URLs

Syntax example: Set,%DownloadURL1%,http://live.sysinternals.com/Bginfo.exe
StrFormat,PATH,%DownloadURL1%,%var1%
StrFormat,FILENAME,%DownloadURL1%,%var2%
StrFormat,EXT,%DownloadURL1%,%var3%
In this example we extract path, filename and extension from an URL with result

%var1%=http://live.sysinternals.com/
%var2%=Bginfo.exe
%var3%=.exe

StrFormat BYTES

StrFormat,bytes,<%VarResult%> This option is used to convert a specific number of bytes from the given text. to a human readable format. Any amount of bytes specified will be converted to Kb, Mb, Gb and Tb.

Syntax example:
StrFormat,bytes,1440000,%myVar%

In this example %myVar% will output a value of 1,44Mb

StrFormat DATE

StrFormat,Date,<%var%>,<yyyy-mmm-dd hh:nn am/pm> This option is used to retrieve the current hour and date and output it to a variable using the format you prefer.

  • yyyy - year in 4 digit
  • mmm - 3 initial letters of the month
  • dd - day number
  • hh - hour number
  • nn - minute number
  • am/pm indicates to use 12 hours cycle instead of 24 hours

The last parameter will define the way how these values will be written to your variable. You can omit values that aren't needed and even add custom text inside.

Syntax example:
StrFormat,date,%myVar%,yyyy-mmm-dd

In this example %myVar% will output the current year, month and day - for example: 2007-jun-07

StrFormat CEIL/FLOOR

StrFormat,<Action>,<%var%>,<%size%>
size may be:

number (e.g. 512)

character ‘k’ meaning 1024 (= kilobyte)

character ‘m’ meaning 1024 * 1024 (= megabyte)

List of possible Action values

  • Ceil
  • Floor

Syntax example: Set,%var%,37
Set,%size%,10
StrFormat,CEIL,%Var%,%size%
In this given example we are rounding up the value of %var% to the next multiple of %size%. The result is filled into %var% with the value of 40.

StrFormat LTRIM/RTRIM/CTRIM/NTRIM

StrFormat,<Action>,<%string%>,<CharsToTrim>,<%var%>
List of possible Action values

  • LTrim
  • RTrim
  • CTrim
  • NTrim

Syntax example: Set,%string%,tomorrow
StrFormat,LTRIM,%string%,3,%var%
In this example we have a given string tomorrow and we trim 3 chars from the left. The remaining rest is filled into %var% with value orrow.
The same syntax applies for StrFormat,RTRIM trimming 3 chars from the right resulting as tomor.

Set,%string%,Programs\
StrFormat,CTRIM,%string%,\,%var%
This option is used to trim the first and/or the last char of a given string if the char to trim is matching with the first and/or the last char of the string.
If the char does not exist the string remains unchanged.
In this example we trim the backslash of given string Programs\ with result Programs.

StrFormat,NTRIM,pTextBox12,%var%
This option is used to trim numbers from the end of a string.
It can be used to extract the class name from interface components.
Here %var% will contain: pTextBox

StrFormat LEFT/RIGHT

StrFormat,<Action>,<%string%>,<CharsToObtain>,<%var%>
List of possible Action values

  • Left
  • Right

Syntax example: Set,%string%,tomorrow
StrFormat,LEFT,%string%,3,%var%
In this example we have a given string tomorrow and we want to get 3 chars from the left filled into %var% with value tom.
The same syntax applies for StrFormat,RIGHT with result row.

StrFormat MID

StrFormat,MID,<%string%>,<PositionOfFirstChar>,<CharsToObtain>,<%var%>
Syntax example: Set,%string%,tomorrow
StrFormat,MID,%string%,3,4,%var%
In this example we have a given string tomorrow and we want to get 4 chars beginning with the third char. The result is filled into %var% with value morr.

StrFormat REPLACE

StrFormat,REPLACE,<%string%>,<CharsToReplace>,<ReplacementChars>,<%VarResult%>
Syntax example: Set,%a%,BROWN
Set,%b%,yellow
Set,%source%,”The quick brown fox jumps over the lazy dog”
StrFormat,REPLACE,%source%,%a%,%b%,%VarResult%
StrFormat,REPLACEX,%source%,%a%,%b%,%VarResultSens%
In the first example we replace (case insensitive) brown by yellow resulting as new string in %VarResult%:
The quick yellow fox jumps over the lazy dog
In the second example there is nothing replaced, because uppercase brown is not found, resulting the original string in %VarResultSens%:
The quick brown fox jumps over the lazy dog

StrFormat SPLIT

StrFormat,SPLIT,<%string%>,<DelimiterChar>,<Index>,<%VarResult%> (Index=0 --> number of items)

Syntax example: Set,%source%,”The quick brown fox jumps over the lazy dog”
StrFormat,SPLIT,%source%,#$s,0,%count%
Loop,%ScriptFile%,Section,1,%count%

[Section]
StrFormat,SPLIT,%source%,#$s,#c,%VarResult% In this example we split the string “The quick brown fox jumps over the lazy dog” using the delimiter space (#$s) and get the single words in the separate loop passes.

StrFormat SHORTPATH/LONGPATH

StrFormat,<Action>,<%string%>,<%VarResult%>
List of possible Action values

  • ShortPath
  • LongPath

This will return the DOS 8.3 path ot the NT style path.

StrFormat CHARTOOEM/OEMTOCHAR

StrFormat,<Action>,<%string%>,<%VarResult%>
List of possible Action values

  • CharToOEM
  • OemToChar

Syntax example: StrFormat,CHARTOOEM,'aüöäasf',%var1%
StrFormat,OEMTOCHAR,%var1%,%var2%
In this example we change the german umlauts 'aüöäasf' (ANSI charset) into %var1% with result 'a�”„asf' (DOS charset) and
%var1% into new %var2% with result 'aüöäasf'.

StrFormat LEN

StrFormat,LEN,<%string%>,<%VarResult%>
Syntax example: StrFormat,LEN,"Hello World",%var1% Returns 11 into %var1%

StrFormat POS

StrFormat,POS,<String>,<SubString>,<%VarResult%>
Syntax example: StrFormat,POS,”Hello World”,orl,%VarResult%
In this example we verify the position of (case insensitive) 'orl' in 'Hello World' with result 8.
StrFormat,POSX,”HELLO World”,l,%VarResult%
In this example we verify the position of lowercase 'l' in 'HELLO World' with result 10.

Network Tools

Functions on this category allow you to work with the network environment whenever available.

  • WebGet
  • WebGetIfNotExist

WebGet / WebGetIfnotExist

WebGet,<FileToDownload>,<FileOnDisk>[,MD5]
WebGetIfNotExist,<FileToDownload>,<FileOnDisk>[,MD5] WB076 added: WebGet,<FileToDownload>,<FileOnDisk>[,MD5][,Comment][,Timeout]]
WebGetIfNotExist,<FileToDownload>,<FileOnDisk>[,MD5][,Comment][,Timeout]]
Use this function to download files from a network server to the local machine. It is assumed that both machines (local and remote) are prepared for this operation.
No checks are done to ensure that the local machine is online or that is has enough disk space to download the file. The remote server must also be accessible and the file must be available for download.
Only direct download links are accepted, dynamic internet pages are not valid.
MD5 check is an additional parameter that is added to ensure that your file matches a security check based on the MD5 hash calculation. This is an optional parameter, only needed for cases when it is important to only accept a file that passes on this download integrity test. If a file fails this test it won't be copied over to the final destination as FileOnDisk.
If the target filename folder doesn't exist, it will be created. If a file already exists it will be overwritten (read WebGetIfnotExist for alternative behavior)
The WebGetIfNotExist command will only download a file if it is not already found as FileOnDisk - particularly useful to download a zipped file once from an internet server and ignore on the following times the script is executed.
Syntax example: WebGet,http://boot-land.net/winbuilder/WinBuilder.exe,c:\WinBuilder\WinBuilder.exe Using this example we will download a WinBuilder.exe file from the server at boot-land.net to directory c:\WinBuilder.

Syntax example for enhanced WebGet functionality: WebGet,http://irfanview.tu.wien.ac.at/iview423.zip,c:\IrfanView\iview423.zip,fd490d07cc236cb44ef29abfd9daf13d,ZIP-file,10
In this example we download the file iview423.zip from server irfanview.tu.wien.ac.at to folder c:\IrfanView\iview423.zip

  • only if MD5sum is fd490d07cc236cb44ef29abfd9daf13d
  • with question dialog's comment 'ZIP-file'
  • and question dialog timeout 10 seconds

To use optional comment the line Ask before ‘WebGet’ in Tab TOOLS\OPTIONS has to be checked.
To use optional timeout the line Use Timeout when asking in Tab TOOLS\OPTIONS has to be checked.

Miscellaneous Commands

Under this category you find the commands which aren't grouped under any specific category but are still quite used on most scripting tasks.

  • run / exec - runs a section from a script file
  • shellexecute / shellexecuteex / shellexecutedelete - launches an external file
  • beep - uses the system speaker
  • message - outputs a message window
  • system - used to refresh values on the program itself
  • echo - outputs a message (viewable on the log)
  • wait - "sleeps" the script for specified time
  • exit - stops processing current script
  • halt - stops building the whole project
  • set - changes the value of a variable
  • addvariables - adds all variables listed inside a section

WB076 added:

  • Loop

 Run / Exec

Run,%ScriptFile%,<Section>[,parameters]
Exec,%ScriptFile%,<Section>[,parameters] This command is used to run the commands found in a section inside a script file. You can run sections from any script including the script from where run is originally called. Use %scriptFile% as a parameter to call another section found inside the same script.

By default this command willl use the same variables available in the original script from where it was

called. If you wish to load the variables from the external script then you should use Exec.

Syntax example:

run,%scriptfile%,mySection

In this example we run a section called mySection inside the same script file Parameters support
This command also allows you to use parameters - this is a very useful feature to create a section that works based on these variables and this way avoid the need to add very long similar lines of code.

Inside each section that is called by run you can use the respective parameters which are numbered from #1 to #9

This means that you can use a Run,%scriptfile%,mysection,"Hello World!"
And inside the [mysection] of the same script you can use a command like echo,#1 to display "Hello World!" on your log.
WB078 added: If a 'Run' has more than 9 parameters, they can be accessed by two new commands:

GetParam,Index,%Var% writes parameter #index into %var%
PackParam,Start,%Var% packs all parameters beginning with <start> into %var%, each enclosed in quotes, and separated by comma, like: "param4","param5",...

PackParam optionally has an additional argument.
PackParam,Start,%Var%,%Num%. It writes the number of arguments into %Num%.
%Num% is always the number of ALL arguments, independent from Start The parameters can be declared as "OUT" variables, that means when returning from "Run", they will be updated with the actual value.

Syntax example: Run,%scriptfile%,mySection,%first%,OUT:%second%,%third%
After returning from the "Run", %first% and %third% are unchanged, regardless whether inside the "Run" #1 and / or #3 are changed.

%second% will get the actual value of #2 when "Run" is finished.
Exec This command has a very similar behavior to the one described by the run command. It will additionally add all the variables found inside the [variables] section. Identical variables found on the new script will overwrite the older ones.

The "OUT" mechanism is not supported by EXEC.

ShellExecute / ShellExecuteEx / ShellExecuteDelete

ShellExecute,<Action>,<Filename>[,Parameters][,StartDir]
ShellExecuteEx,<Action>,<Filename>[,Parameters][,StartDir] This function will launch a file using the settings you specify. Action is the specific method you wish to use to start the external file. By default "Open" is the most used one. Possible action values

  • Open - will open the file using the default associated application
  • Hide - will also open the file, but it will be launched in hidden mode (not user viewable)
  • Print - print a file using the default printer
  • Explore - open an explorer window (used to display the contents of folders)

Filename is the complete filename to where the file can be found, you can omit the dir part if this file can be found on the system paths.

Parameters (optional) are the set of switches that you can pass along as command line parameters when executing the file.

StartDir (optional) is the location that you wish to specify as your default work directory.

The script will wait (pause) for the launched file or application to be closed before continuing processing the remaining commands.

ShellExecuteDelete - has a similar behavior but will delete the application after it has been finished.

ShellExecuteEx - has a similar behavior but won't wait for the application to be finished and will continue with the script processing right after launching the target filename.

Syntax example: ShellExecute,open,cmd.exe In this example we can open a new console window (cmd.exe)

Beep

Beep,<Action> This is a very simple command that will use the default sound profile used on your machine to beep messages that requires the attention of the user.

Action can be one of the following values

  • Ok
  • Error
  • Asterisk
  • Confirmation

Syntax example: beep,ok

Message

Message,<message>,<Action> This command will pop a small text window displaying the contents of your message. The additional action parameter will allow you to customize the icon displayed along with the message box.

Action can have of the following values

  • Information
  • Confirmation
  • Error
  • Warning

Syntax example: message,"Script has been completed!",Information
WB076 added:
Usually the message dialog waits for ever for the user's ok.
You can cause to close it after a timeout, by adding the timeout (in seconds) as last argument.
message,"Script has been completed!",Information,10
System

System,<Action> This command is used to perform some program internal actions and refresh values that were modified during the script execution. It will set a flag that reminds the program to perform the specified action once the project is completed.
Action can have of the following values

  • ReScanScript s - will repeat the procedure to find and categorize scripts displayed on the main window. Useful for cases when new custom scripts are created while building a project.
  • RefreshInterface - mostly used on buttons to refresh the script interface with changes, avoiding to make the user re-select again to refresh values.
  • RefreshVars - if a variable is changed this action performs updating needed for variables that are dependent upon other variables (unnecessary and removed since WB076)

WB076 added:

  • FileRedirect - processed in 64bit systems only
  • RegRedirect - processed in 64bit systems only
  • GetFreeSpace
  • GetFreeDrive
  • ErrorOff
  • OnScriptExit
  • OnBuildExit
  • RebuildVars
  • GetEnv
  • IsAdmin
  • Cursor
  • SaveLog
  • SplitParameters

System,FILEREDIRECT
System,FILEREDIRECT,{ON|OFF}

 Syntax example: System,FILEREDIRECT,OFF
ShellExecute,Hide,"cmd.exe","/c imdisk -d -m %FreeLetter%"
System,FILEREDIRECT,ON
Maybe necessary when WinBuilder is running on a 64bit system. Some directory calls are getting redirected by the OS to avoid possible conflicts.
Using a 32bit system this command is without effect.

System,REGREDIRECT
System,REGREDIRECT,{64|32|OFF}

Syntax example: System,REGREDIRECT,64
RegRead,HKLM,”SOFTWARE\Sun\xVM VirtualBox",InstallDir,%VBPath%
System,REGREDIRECT,OFF

 Maybe necessary when WinBuilder is running on a 64bit system. Some registry calls are getting redirected by the OS to avoid possible conflicts.

  • 64 causes next accesses to the 64 bit entries.
  • 32 causes next accesses to the 32 bit node.
  • OFF causes Host OS decision

Every definition is valid from "now" to "ever"

Using a 32bit system this command is without effect.

System,GetFreeSpace
System,GETFREESPACE,<Path>,<%var%>
Returns the free space of Path's drive in megabytes
(megaybtes = free bytes / 1024 / 1024)

Syntax example: System,GETFREESPACE,%BaseDir%,%var%
System,GETFREESPACE,C:,%var%
System,GETFREESPACE,C,%var% Result:
%var% indicates the free space of %BaseDir% or of “C:”

System,GetFreeDrive
System,GetFreeDrive,<%var%>
This command returns the highest available free drive letter, mostly “Z:”

System,ERROROFF
System,ERROROFF[,lines]
This command causes that a script processing error is not marked as error and therefore the program continues.
By default this functionality is valid for the next script line. That can be changed by defining the optional number of lines.

Syntax example: System,ERROROFF
RegRead,HKLM,"CurrentControlSet\Services\Eventlog\Application\VMware Virtual Mount Service Extended",EventMessageFile,%VMtmp%
If,NOT,EXISTVAR,%VMtmp%,Begin
System,ERROROFF,2
RegRead,HKCR,Wow6432Node\Applications\vmware-mount.exe\shell\Mount\command,,%VMtmp%
If,NOT,EXISTVAR,%VMtmp%,RegRead,HKCR,Applications\vmware-mount.exe\shell\Mount\command,,%VMtmp%

System,ONSCRIPTEXIT
System,ONSCRIPTEXIT,<Command>
This statement can be written anywhere inside the running part of a script.
It will be executed after the last script's statement has been executed.

If command is 'Run' as parameter #1 the 'type' of the exit is passed

  • DONE normal finish
  • STOP the user clicked the STOP button
  • ERROR the script has been finished because of an error
  • COMMAND the script has been finished because of a System,Halt or System,Exit command
  • EXCEPTION a system exception occurred during process, e.g. 'index out of bounds'

Syntax example:
System,ONSCRIPTEXIT,Message,"Everything Done!",INFORMATION

Syntax example:
System,ONSCRIPTEXIT,Run,%ScriptFile%,MYEXIT
// force an error:
FileCopy,y,x

[MYEXIT]
If,#1,EQUAL,ERROR,Beep,ERROR
If,#1,EQUAL,STOP,Beep,WARNING
If,#1,EQUAL,DONE,Beep,OK
If,#1,EQUAL,COMMAND,Beep,CONFIRMATION

System,ONBUILDEXIT
System,ONBuildEXIT,Command
This statement can be written anywhere inside the running part of a script.
Always the last executed statement is valid.
So different scripts can define different actions or deactivate with System,ONBUILDEXIT
It will be executed after the last script in the project has been processed. More examples in System,ONSCRIPTEXIT

System,REBUILDVARS
This is a successor of System,RefreshVars, which since WB076 in most cases is not more necessary.

Syntax example: Set,%First%,first
Set,%Result%,"Here is %first%"
Echo,Value of #$pResult#$p is: %Result%
// >> Here is first
Set,%First%,second
Echo,Value of #$pResult#$p is: %Result%
// >> Here is first
System,RebuildVars
Echo,Value of #$pResult#$p is: %Result%
// >> Here is second

System,GETENV
System,GETENV,<EnvironmentVariable>,%var%
<EnvironmentVariable> must not be enclosed in percent!

Syntax example: System,GETENV,Temp,%var%
Echo,%var%

System,ISADMIN
System,ISADMIN,%var%
Sets %var% to True or False, depending on whether WinBuilder has been started by an admin.

System,Cursor
System,CURSOR,{WAIT|NORMAL}
Sets the system cursor as hourglass or the default cursor.

System,SAVELOG
System,SAVELOG,<OutputFile>
Saves the actual accumulated log to <OutputFile>. <OutputFile> should have the extention '.html'.
Usefull for debugginp purposes:
When a build reproducable hangs in a certain script, you can save the log before or in the beginning of this script.

System,SPLITPARAMETERS
System,SPLITPARAMETERS,{ON|OFF}
Splits in a 'Run' or 'Exec' command a single parameter which contains commas, into severel parameters.

The System,SPLITPARAMETERS,ON command can be given once in the project, e.g. in [Process] of script.project, and is then valid for the complete project (or until it is switched off by System,SPLITPARAMETERS,OFF, and then switched on again, and ....) Syntax example: [process]
Set,%List%,"a,b,c"
Run,%ScriptFile%,Test,%List%
System,SPLITPARAMETERS,ON
Run,%ScriptFile%,Test,%List%
System,SPLITPARAMETERS,OFF

[Test]
Echo,#1
Echo,#2
Echo,#3 Log result:
Processing section: [process]
File [%BaseDir%\Projects\win7_pe\CodeBox.txt] Version [1]

SetVar - Sucessfuly changed the value of [%List%] to: [a#$cb#$cc]
Run - Processing section: [Test] From file: [%BaseDir%\Projects\win7_pe\CodeBox.txt]
with parameters: [a,b,c]
a,b,c

Run - Processed section [Test] in file: [%BaseDir%\Projects\win7_pe\CodeBox.txt]
System,SplitParameters,ON
Run - Processing section: [Test] From file: [%BaseDir%\Projects\win7_pe\CodeBox.txt]
with parameters: [a],[b],[c]
a
b
c
Run - Processed section [Test] in file: [%BaseDir%\Projects\win7_pe\CodeBox.txt]
System,SplitParameters,OFF

Echo

echo,<message>
This is a very simple command that will output your message to the processing window while the script is running. This message will only disappear until another message is displayed or the script finishes. These messages are also stored in the log and are used to inform the user about operations being performed by the script.

Syntax example: echo,"Hello World!"

Wait

wait[,seconds]
Using this command will pause the script processing the value of seconds that you specify. After this period is concluded, the process will continue.

 Syntax example: wait,5 This example will make the application wait 5 seconds before continuing

Exit

Exit,<exit message>
This command will force the script to be finished and will make the process continue to the next script on the list.
Exit message is a small text message that is displayed on the log where you can specify the reason why Exit was called.

 Syntax example: Exit,"File was not found"

Halt

Halt,<reason>
This command will force the overall project to terminate.

Reason is a small text message that is displayed in the log where you can specify the reason why Halt was called.

 Syntax example: Halt,"Incompatible Source"

SET

Set,<%Variable%>,<NewValue>
With this command we can change the value of a variable

If more variables are linked to this variable, then you might need to call

System,RefreshVars to ensure that all variables get refreshed values and work properly. Syntax example: Set,%workdir%,c:\myPath

WB076 added:
A new variable handling makes System,RefreshVars unnecessary. Usually the variables definition has a lifetime of the current script.

You can make it valid for the rest of the actual Build by adding a ',GLOBAL' and valid for ever (write into script.projects) by adding a ',PERMANENT.

AddVariables

AddVariables,<%ScriptFile%>,<Section>
Use this command to add more variables to the script based on the entries found inside another section from any script file.
When a script is started it will read the [variables] section, during the script processing you can repeat this procedure and read the variables found inside any section you wish to use.

Use %scriptfile% to read a section from the same file from where this command is called.

Older variables with the same designation are overwritten with newer values.

Syntax example: AddVariables,%scriptFile%,AlternativeVariables

WB076 added: There is an additional optional parameter possible:
GLOBAL: If this parameter is set, the additional variables will be known through the complete build.

Loop

Loop,%ScriptFile%,<Section>,<start>,<end>
Section in %Scripfile% is repeatedly executed with a counter between start and end value. The loop can be prematurely exited by Loop,BREAK

Syntax example: Set,%Result%,?
Loop,%ScriptFile%,Try-OEM,0,100,SourceDisksFiles,VBoxUSB.sys
Echo,%Result%

[Try-OEM]
Set,%file%,C:\Windows\inf\oem#c.inf
If,ExistFile,%file%,IniRead,%file%,#1,#2,%Var%
If,-%var%,NotEqual,-,Set,%Result%,%file%
If,%Result%,NotEqual,?,Loop,BREAK
This code is searching in all oem.inf files in path C:\Windows\inf (oem0.inf up to oem100.inf) for entry VBoxUSB.sys in section [SourceDisksFiles].
If it’s found the oem.inf file name is set as result and the loop ends.
NOTE:
oem.inf files are always beginning with ZERO (=oem0.inf)!

Loop statement can run between characters, e.g. drive letters

Syntax example: Set,%a_searchFile%,”Program Files\IrfanView\i_view32.exe”
Loop,%ScriptFile%,Try,a,z
If,EXISTFILE,%pstart%,ShellExecute,OPEN,%pstart%

[try]
Set,%pstart%,#c:\%a_searchFile%
If,EXISTFILE,%pstart%,Loop,BREAK
In this example the Loop statement is looking for the EXE-file on all drive letters from A: to Z:.
If the EXE-file is found it will be executed.

Command Blocks

If the evaluation of an If condition is 'True', the command following the condition is processed. If the evaluation of an If condition is 'False', the command of the Else command (if present), is processed.
In both cases, instead of a command, there can also be a command block.
Begin
<command>
<command> ... <command>
End <command> can be any valid script command.
Because <command> can also be an If, nested command blocks are possible.

Syntax example: If,%OSName%,Equal,xp,Begin
If,%SP%,NotEqual,sp3,Begin
If,%pCheckBox1%,Equal,True,Run,%ScriptFile%,Process-KB893803
End
Else,Begin
Set,%hotfix%,1
Run,%ScriptFile%,Process-Copy
End
End
Else,...

Bugs

When a command doesn't work as expected you should follow these steps to ensure that it is a true bug and not a human error:

  • Check the source code and see if the syntax is correct
  • Add small tests to the used variables to check if the respective values are outputted correctly. (ex. echo,%myVariable%)
  • Read the special conditions under which the project has to be run (found the project page)
  • Check if there aren't any external interferences as locked files or no disk space on the target folder
  • Try whenever possible from a fresh project to avoid any chance of corrupted files or invalid project settings

If none of the above solves your issue then here's the recommended way to proceed:

  • Visit the community forums and search for similar reports of the same behavior as you notice
  • If a similar case is found you should post a reply on this topic, otherwise start a new topic in the appropriate category
  • Writing advice before posting a bug : Include a descriptive title in your message including your log.html file and a test script so that it can be debugged and used by others

Log of changes

Changes in script language can be followed in each newer WinBuilder beta discussion where changes to the script code are suggested and debugged by other members.

Projects also follow their own script rules and these methods can change occasionally, whenever in doubt you should post your questions in each project forum discussion.

Please let us know if this page is not complete or if you still haven't found needed information.


Script syntax

Script Syntax 080

Contents

  • Compatibility
  • Syntax
  • Back to index

Compatibility

This page describes new functionalty introduced with WinBuilder 080.

Older WinBuilder versions cannot work with this functionality.

Here you can download WinBuilder 080.

Syntax

.script commands can be grouped under the following categories

  • Registry handling
  • IF Clauses
  • Miscellaneous commands

Registry Handling

These commands are written to write and read values from the local registry on your windows machine. You can also load the hives from the projects being built at any given time.

These registry operations are valid for any Windows Platform, you should however note that Vista restricts the specific operation to load/unload hives - it is necessary to disable the UAC (User Account Control) before running projects that need this support.

List of available functions

  • RegWriteBin, RegWriteBinEx
  • RegReadBin
  • RegMulti

RegWriteBin

RegWriteBin,<HKEY>,<KeyType>,<Section>,<Keyname>,<Value>
This command will create a new or overwrite an existing registry entry as specified.

The command is used to write Wide Strings (e.g. Unicode) into the registry. The wide string is defined by a series of hexadecimal values, separated by comma.

RegWriteBinEx has the same syntax, but writes every value of every type unchecked into the registry.
It is in the responsibility of the script's author to make shure that only valid registry entries are created.

HKEY is the "Hive Key" where the key is to be placed. These hives are files that are loaded by your machine when booting and compose the registry structure. By default, most scripts use HKLM as the work hive.

Valid HKEY values

  • HKLM
  • HKCU
  • HKCR
  • HKEY_USERS
  • HKEY_CURRENT_CONFIG

KeyType will specify how the data in the registry key should be interpreted.

Valid key type values for RegWriteBin

  • 0x1 - String - writes a text value
  • 0x2 - Expanded String - will expand any variable value contained inside %%. (e.g. %temp%)
  • 0x7 - Writes multiple NULL separated strings

Section is the complete path to the section where the key is supposed to be written

Keyname is the name of the name of one of the 'child keys' of a section.

Value can be

  • an explicitelly written list of hexadecimal values, separated by comma
  • a variable containing the list. Instead of the comma the variable must contain the escape #$c
The substrings of a 0x7 entry can be divided by ",00,00" bytes (without the quotes) or by the escape #$z.

Syntax examples:
RegWriteBin,HKLM,0x2,WB-Software\SOFTWARE\Classes\.bfc\ShellNew,Command,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,00,00

Set,%Value%,25#$c00#$c53#$c00#$c79#$c00#$c73#$c00#$c74#$c00#$c65#$c00#$c6d#$c00#$c52#$c00#$c6f#$c00#$c6f#$c00#$c00#$c00

RegWriteBin,HKLM,0x2,WB-Software\SOFTWARE\Classes\.bfc\ShellNew,Command,%Value%

RegReadBin

RegRead,<HKEY>,<Section>,<Key>,<%Variable%>
This command will read a value from the key you specify.

It uses the same components as described above with the difference that it will copy the value of a key into a variable.

This command will only retrieve values from the following keytypes:

  • 0x1 - String
  • 0x2 - Expandable String
  • 0x7 - Multiple String

Syntax example:

RegReadBin,HKLM,WB-Software\SOFTWARE\Classes\.bfc\ShellNew,Command,%Value%

In this example the variable %Value% will store the value of the mentioned key

RegMulti

The command uses the same components as described above.

RegMulti,<HKEY>,<Section>,<Key>,APPEND,<String>
RegMulti,<HKEY>,<Section>,<Key>,PREPEND,<String>
RegMulti,<HKEY>,<Section>,<Key>,BEFORE,<SubString>,<String>
RegMulti,<HKEY>,<Section>,<Key>,BEHIND,<SubString>,<String>
RegMulti,<HKEY>,<Section>,<Key>,PLACE,<Index>,<String>

Writes a string at the specified place.

If the string already exists in the current value, a warning is written and the current value is left unchanged.

RegMulti,<HKEY>,<Section>,<Key>,DELETE,<SubString>

Removes the specified substring.

RegMulti,<HKEY>,<Section>,<Key>,INDEX,<SubString>,%Index%

Queries the index of the specified string.

If the substring does not exist, the returned value is 0.

If Clauses

In .script language you can use If clauses to ease your life when running a script and to be able to evaluate certain conditions.

If a condition is true when you test it with the IF command then a command will be executed.

General format: If,<condition>,<command> Optional line: Else,<command>

If a condition is false when you test it with the IF command then the second command will be executed.

List of IF conditions new in WinBuilder 080

  • ExistRegMulti
  • ExistMacro

IF ExistRegMulti

If,ExistRegMulti,<HKEY>,<Section>,<Key>,<SubString>,<Command>

The command checks for the existence of a substring in a multiple string

Syntax example:
If,EXISTREGMULTI,HKLM,SYSTEM\ControlSet001\Control\ServiceGroupOrder,List,"FSFilter Infrastructure",Echo,YES

IF ExistMacro

If,ExistMacro,<Macro>,<Command>
 The command checks whether the macro is defined in the [Variables] section.

Miscellaneous Commands

Under this category you find the commands which aren't grouped under any specific category but are still quite used on most scripting tasks.

addinterface - adds all interface values to the variables list

AddInterface

AddInterface,<Script>[,<Interface>],<prefix>

Use this command to add the values of an interface to the variables List.

The optional <Interface> is used to read alternative interfaces, e.g. [Interface-Language]

Default is the standard interface [Interface]

The prefix is used to distinguisch to already existing interface values ot the same name.

If it is omitted, also the underline in the name of the generated variables is omitted

Syntax example:

AddInterface,%ScriptFile%,Interface-German,DE

Values of the German interface are now accessable like

Echo,%DE_pTextBox1%

AddInterface,%ScriptFile%,Interface-German,

Values of the German interface are now accessable like

Echo,%pTextBox1%

Log of changes

Changes in script language can be followed in each newer WinBuilder beta discussion where changes to the script code are suggested and debugged by other members.

Projects also follow their own script rules and these methods can change occasionally, whenever in doubt you should post your questions in each project forum discussion.

Please let us know if this page is not complete or if you still haven't found needed information.


Script Variables

Contents

  • Overview
  • Usage
  • FAQ
  • Bugs

Overview

Variables are expressions that you can use to store a value that can be changed as needed.

These variables can be used to avoid fixed settings and keep the script language as dynamic as possible. This also makes your script become portable and work under any path or quickly change script settings when needed.

We can group variable into 3 categories, Fixed, Custom, and Runtime, each one having a specific sequence which we detail over the next chapter.

Usage

Variables are meant to be used inside your commands while your script is running.

They allow you to make changes at a global level. Changing the value of single variable can change the way how the whole project is built.

When a project starts to run - a list of variables is created using this specific order level
  1. Fixed variables
  2. Custom Variables
  3. Runtime variables

If needed, we can overwrite a variable with a new value, meaning for example that a fixed variable can start with a value which can later be changed if we add a variable with the same name on our script, overriding the previous fixed value.

This is only valid while this script is running and these changes will be removed when running another script.

These explanations may seem complicated now but it's simple to understand once you follow each one of the chapters below. You don't have to worry much about this information until you decide to begin coding your own scripts in a more efficient way. In either case, it will be detailed here should you need it one day.

Fixed Variables

These variables are created by default just before a project start to run.

WinBuilder retrieves information found inside your Operating System and a few others definitions related to your project settings.

Date related (output present date settings)
  • %day%
  • %Month%
  • %Year%

User environment variables
  • %TempDir% - path to the temporary folder
  • %ProgramFilesDir% - path to localized "Program Files"
  • %Username% - extracts current logged User name
  • %UserProfile% - contains the path to the User Profile folder
  • %WindowsDir% - path to your Windows directory
  • %WindowsSystemDir% - in most cases pointing to your windows system32 folder

WinBuilder specific
  • %BaseDir% - folder from where WinBuilder.exe is running
  • %tools% - path where the common Tools folder can be found
  • %version% - current version of WinBuilder

Project specific
  • %SourceDir% - path to use as source for your project
  • %TargetDir% - work folder that will have the project build files
  • %ISOfile% - filename of the image to be created
  • %ISOdir% - path of %ISOfile%
  • %ProjectDir% - path to the respective project folder

Custom Variables

These are additional variables that can be added by script authors.

How to create them?

Place a section called [variables] and write your variables in INI style. It is obligatory to use the percentage (%) for labeling it as a variable.

Example

[variables]
%workdir%=c:\myPath
%project_title%="My Boot Disk"

For this example we are creating two variables, available while the script is running, which can be used inside script commands.

Macros

Macros are defined in the [Variables] section, too.

Unlike Variables they do not have the percentage (%) as label.
And they can only be used at the begin of a script command line.

They are used to substitute often used script command line starts.

Example

[Process]
FileCopy,%source_sys%\aclui.dll,%target_sys%
FileCopy,%source_sys%\user32.dll,%target_sys%
...
FileCopy,%source_sys%\kernel.dll,%target_sys%

Can be replaced by:

[variables]
Copy=Run,%ScriptFile%,DoCopy,%source_sys%,%target_sys%

[DoCopy]
FileCopy,#1\#3,#2

[Process]
Copy,aclui.dll
Copy,user32.dll
...
Copy,kernel.dll

This [variables] section can be placed in 3 different files, each one with a different scale of availability.
  • System - variables placed inside WinBuilder.ini are available for all projects and scripts
  • Project - variables inside script.project are available for all scripts
  • Script - placed inside the script that is running (also called as "local variables") are valid until the script is concluded.

Runtime Variables

These are the type of variables that are created while the script is running. This means that you can create your own local variables whenever needed.

To specifically create new variables you can use these script commands:
  • set
  • addvariables

There's a small trick that you can also use to create new runtime variables. Whenever you use any command that uses a variable to store the result a new variable will be added to the list if it didn't existed before.

Applies to:
  • strformat
  • if
  • retrieve
  • iniread
  • regread.

One last detail - the run command also uses runtime variables that we can use to pass parameters to another section. These variables use numbers from #1 to #9. You should always check the values that are being used in each of these variables to ensure that everything works as you expect.

Frequently Asked Questions

Q: I'm still a bit confused, how can I understand this better?
A: Look inside a project folder and open up the script.project file with notepad to view good examples. This also applies to WinBuilder.ini (same folder as WinBuilder.exe) and to your script files.

Q: I'm doing my own script - how can I know if the value of my variables is right?
A: Use commands to output show the variables on the log. Echo,%myVar% is a good example to help in this case.

Q: I know that we don't need to %% on each variable we create - are there any restrictions about what I can and cannot use?
A: You should only be careful to choose titles that aren't confused with other commands or variables, try using distinct titles that identify the variable purpose.

Q: Also heard that variables can replace commands, is this true?
A: Variables can't directly replace commands but can be used to run sections with new specific functions. Look on the script applications page for details about this sort of use.

Bugs

There are a few known issues with variables that you should be aware.

  • Adding too many variables on the list will start decreasing performance of the script processing because of the quantity of text to analyse and translate - recommended to keep variables list on local scripts and projects as minimum as possible.
  • If the value of a variable A depends on the value of variable B and you decide to change the value of variable B - your variable A will not be updated and will still use the original value of variable B. This was a quick method done to improve speed and should be corrected soon. In the meantime you can call system,refreshvars to refresh all variables and use updated values.

Please let us know if this page is not complete or if you still haven't found needed information.


_Calculate

COMMON_API - Function Reference

_Calculate

Syntax

_Calculate,AutoIT Command(expression),ReturnVar

Parameters

1 | AutoIT Command(expression) | AutoIt command to execute
1 | ReturnVar | This is the name of the variable to receive the return value of the AutoIt command. It must be specified without the %

Remarks

This API function is called to execute an AutoIT command that returns a value. It will download sCalculate to the winbuilder tools directory if it does not already exist and use it to execute the AutoIT command.

Tips

Always use simple quote in the command expression ,use [#$c] in place of [,] and use %ReturnVar% (with %) as result in your code . See AutoIT doc.

Example

This will show a simple message box with Abort / Retry / Ignore buttons for 5 seconds

_Calculate,MsgBox(2#$c'Test Calculate'#$c'Choice:'#$c5),Choice

This will display an input box to ask the user to enter a string.

_Calculate,InputBox('Question'#$c 'Where were you born?'#$c 'Planet Earth'#$c ''#$c -1#$c -1#$c -1#$c -1),Answer

Common_Api version 8 - 11-08-2009 - Paraglider


AddAutoRun

AddAutoRun ( Vista / Win7 projects only )

Syntax

AddAutoRun,[Title],[FileName],[Parameters],[StartMode]

Parameters

1 | Title | Title to associate with the program to be automatically run at boot time. This defaults to %ProgramTitle%.
2 | FileName | Filename and optional path of program to be run. This defaults to %PE_Programs%\%ProgramFolder%\%ProgramExe%.
3 | Parameters | Command line parameters for the program being run.
4 | StartMode | Used to specify if the program is run hidden and / or if the autorun program waits for the program to finish running.
 |  | 1 | Wait for the program to finish running but show any window used by the program. This is the default start mode.
 |  | 2 | Don't wait for the program to run but show any window used by the program.
 |  | 3 | Run the program hidden and wait for the program to finish running.
 |  | 4 | Run the program hidden and don't wait for the program to finish running.

Remarks

This is used to configure a program to automatically run when PE boots. This adds an entry to the autorun section in the %PE_CFG% configuration file. This file is processed at boot time by the vpeldr / win7peldr programs. The only difference between this and AddPostConfig is the position in the startup sequence when the entry is run. This runs before the hardware detection is run and device drivers are installed.

Example

This example shows how to automatically start a service at boot time. In this example the lanman service will be started. The loader program will wait for the service to start and hide the console window that otherwise would be shown.

AddAutoRun,"Start lanman service",net.exe,"start lanman",3

Common_Api version 8 - 11-08-2009 - Pedro Le 15


AddAutoRun

AddPostConfig ( Vista / Win7 projects only )

Syntax

AddPostConfig,[Title],[FileName],[Parameters],[StartMode]

Parameters

1 | Title | Title to associate with the program to be automatically run at boot time. This defaults to %ProgramTitle%.
2 | FileName | Filename and optional path of program to be run. This defaults to %PE_Programs%\%ProgramFolder%\%ProgramExe%.
3 | Parameters | Command line parameters for the program being run.
4 | StartMode | Used to specify if the program is run hidden and / or if the autorun program waits for the program to finish running.
 |  | 1 | Wait for the program to finish running but show any window used by the program. This is the default start mode.
 |  | 2 | Don't wait for the program to run but show any window used by the program.
 |  | 3 | Run the program hidden and wait for the program to finish running.
 |  | 4 | Run the program hidden and don't wait for the program to finish running.

Remarks

This is used to configure a program to automatically run when PE boots. This adds an entry to the postconfig section in the %PE_CFG% configuration file. This file is processed at boot time by the vpeldr / win7peldr programs. The only difference between this and AddAutoRun is the position in the startup sequence when the entry is run. This runs after the hardware detection is run and device drivers are installed.

Example

This example shows how to automatically start a service at boot time. In this example the lanman service will be started. The loader program will wait for the service to start and hide the console window that otherwise would be shown.

AddPostConfig,"Start lanman service",net.exe,"start lanman",3


Unpack

AddToPEShell ( Vista / Win7 Projects only )

Syntax

AddToPeShell,Title,Path,Default

Parameters

1 | Title | Title of shell program in PEShell shell program list. This defaults to %ProgramTitle%.
2 | Path | Filename and optional path of program to be run. This defaults to %PE_Programs%\%ProgramFolder%\%ProgramExe%.
3 | Default | Indicates if the shell is the default shell - PEShell will automatically select the default shell after the timeout period.

Remarks

This command is used to add a shell program to PEShell ( e.g. explorer etc ). Currently this is only supported in Vista / Win7 projects.

Example

This adds explorer.exe as the default shell to PEShell.

AddToPEShell,Explorer,explorer.exe,True

Common_Api version 8 - 11-08-2009 - Pedro Le 15


Unpack

Arch

Syntax

Arch,SourceType

Parameters

1 | Source Type | Source Type supported by the script
 |  | x86 | Script only supports the x86 architecture
 |  | x64 | Script only supports the x64 architecture.
 |  | x86|x64 | Script supports either the x86 or x64 architecture.

Remarks

This function should be the first function called by a script in the process section. It is used to specify the source architecture supported by the script.

Tips

If the source type is x86 then the only source architecture that is supported is x86. If the source type is x64 then, depending on if wow64 support is available, then the source architecture may be x86 or x64. If wow64 support is not available when using x64 source then only x64 source architecture will be supported.

For a project to support this command two project variables must be defined:

%SourceArch% - architecture type of the source

%TargetWOW64% - this by default is the same as %SourceArch%. If the project contains support for wow64 then it will be set by the wow64 script to x86.

If a script contains both x64 and x86 executables and / or dlls embedded in the script then its recommended that they be embedded in a folder named x86 or x64 so that a command like the following can be used:

unpack,%SourceArch%,,True,%target_win%,system32,%ProgramEXE%

Example

Script only supports the x86 architecture

Arch,x86

Script supports both x86 and x64 architectures

Arch,x86|x64


Ask_License

Ask_License

Syntax

Ask_License,FullFilename,ID,SectionToRunBeforeExit

Parameters

1 | FullFileName | Path to license file
2 | ID | ID, defined by script developer to identify the license object. It must be unique for the script and should be simple, maybe 'Lic'.
3 | SectionToRunBeforeExit | Section to run in %ScriptFile% (if License not found or not accepted) before exiting

Remarks

What happens:

If the license file does not exist, the script is exited.
If the license file exists, it is shown and the user is asked for agreement.
If the user does not agree, then the script is exited.
If the user agrees, then in %ScriptFile% a marker <ID> is set into the [Licenses] section, and script processing continues.

On the next build, this marker is read and the license agreement window not shown again.

Example

This is how you show the license file:

[process]
// Unpack just the file LicenseAgreement.txt from section Folder to %Target_Prog%\%ProgramFolder%\
Unpack,Folder,,LicenseAgreement.txt
Ask_License,%Target_Prog%\%ProgramFolder%\LicenseAgreement.txt,Lic,Reject_Licence

[Reject_Licence]
// If Licence not accepted delete %Target_Prog%\%ProgramFolder%
DirDelete,%Target_Prog%\%ProgramFolder%

After the script is first run and the license is accepted the following will be appended to the script so that the next time the script is run the license will not be shown. Obviously if you redistribute your script this section must be removed.

[Licenses]

Lic=True

Common_Api version 8 - 11-08-2009 - Pedro Le 15


associate_file

associate_file

Syntax

Associate_File,Extension,[Type],[Filename],[Option],[UseRegAddBoot]

Parameters

1 | Extension | File extension to be associated
2 | Type | Set the type of the association. If not specified defaults to Open.
 |  | Open | = Launch the associated application
 |  | Edit | = Launch the associated editor and opens the document for editing
 |  | Icon | = Associate an icon with the extension
3 | Filename | File to be associated. May be defaulted or may be a file name or full path. If it's not specified then it defaults to: %PE_Programs%\%programFolder%\%programExe% If only the file name is specified then the path is assumed to be: %PE_Programs%\%programFolder%
4 | Option | This is optionally used to specify the DefaultIcon index. If the icon is contained with the program exe then this can be used with Open or Edit. Otherwise the Icon type can be used to specify an external DefaultIcon.
5 | UseRegAddBoot | Defaults to False. If set to True then RegAddBoot is used to create the association.

Remarks

This function is called to associate a file extension with an application.

Tips

This function will mount and unmount the appropriate registry hive each time its called. If many associations are being created then its more efficient to use Add_Asso instead.

Example

This sets notepad.exe as the program to open files with extension ext using icon with index 153 from shell32.dll for the association.

Associate_File,Ext,Open,%SystemRoot%\system32\notepad.exe

Associate_File,Ext,Icon,%SystemRoot%\System32\Shell32.dll,-153

If your scripts defines the variables %ProgramFolder% and %ProgramEXE% then the above example can be replaced with:

[Variables]

%ProgramTitle%=Notepad

%ProgramEXE%=Notepad.exe

%ProgramFolder%=%SystemRoot%\System32

[Process]

Associate_File,Ext

Common_Api version 8 - 11-08-2009 - Pedro Le 15


Add_Asso

Add_Asso

Syntax

Add_Asso,Extension,[Type],[Title],[Filename],[Option],[UseRegAddBoot]

Parameters

1 | Extension | File extension to be associated
2 | Type | Set the type of the association. If not specified defaults to Open.
 |  | Open | = Launch the associated application
 |  | Edit | = Launch the associated editor and opens the document for editing
 |  | Icon | = Associate an icon with the extension
3 | Title | Title to be associated with the extension
4 | Filename | File to be associated. May be defaulted or may be a file name or full path. If it's not specified then it defaults to: %PE_Programs%\%programFolder%\%programExe% If only the file name is specified then the path is assumed to be: %PE_Programs%\%programFolder%
5 | Option | This is optionally used to specify the DefaultIcon index. If the icon is contained with the program exe then this can be used with Open or Edit. Otherwise the Icon type can be used to specify an external DefaultIcon.
6 | UseRegAddBoot | Defaults to False. If set to True then RegAddBoot is used to create the association.

Remarks

This function is called to associate a file extension with an application.

Tips

This function assumes the appropriate registry hive is loaded before the function is called. This is more efficient than Associate_File if many associations are being created.

Example

This sets XnView.exe as the program to open files with extension Xnview.bmp using icon with index 2 from XnView.exe for the association. Title for the association is set to BMP Image.

[Process]

Hive_Load,HKU

Add_Asso,Ext,Open,BMP Image,%PE_Programs%\XnView\XnView.exe,,2

Hive_Unload,HKU

If your scripts defines the variables %ProgramFolder% and %ProgramEXE% then the above example can be replaced with:

[Variables]

%ProgramEXE%=XnView.exe

%ProgramFolder%=XnView

[Process]

Hive_Load,HKU
Add_Asso,XnView.bmp,,BMP Image,,2
Add_Asso,XnView.emf,,EMF Image,,11
Add_Asso,XnView.gif,,GIF Image,,3
Hive_Unload,HKU

This generates this:

[Process]
Hive_Load,HKU
reg_add,0x1,"%reg%\Classes\XnView.bmp","","BMP Image"
reg_add,0x2,"%reg%\Classes\XnView.bmp\DefaultIcon","","%PE_Programs%\%ProgramFolder%\XnView.exe#$c2"
reg_add,0x2,"%reg%\Classes\XnView.bmp\shell\open\command","","#$q%PE_Programs%\%ProgramFolder%\XnView.exe#$q#$s#$q#$p1#$q"
reg_add,0x1,"%reg%\Classes\XnView.emf","","EMF Image"
reg_add,0x2,"%reg%\Classes\XnView.emf\DefaultIcon","","%PE_Programs%\%ProgramFolder%\XnView.exe#$c11"
reg_add,0x2,"%reg%\Classes\XnView.emf\shell\open\command","","#$q%PE_Programs%\%ProgramFolder%\XnView.exe#$q#$s#$q#$p1#$q"
reg_add,0x1,"%reg%\Classes\XnView.gif","","GIF Image"
reg_add,0x2,"%reg%\Classes\XnView.gif\DefaultIcon","","%PE_Programs%\%ProgramFolder%\XnView.exe#$c3"
reg_add,0x2,"%reg%\Classes\XnView.gif\shell\open\command","","#$q%PE_Programs%\%ProgramFolder%\XnView.exe#$q#$s#$q#$p1#$q"
Hive_Unload,HKU

Common_Api version 8 - 11-08-2009 - Pedro Le 15


Add_Shortcut

Add_Shortcut

Syntax

Add_Shortcut,[Type],[StartMenuFolder],[FullFileName],[Title],[Work Folder],[Parameters],[IconFile],[StartMode],[ToolTipText]

Parameters ( * not supported by Vista / Win7 )

1 | Type | Define the type of shortcut
 |  | Desktop | Place an icon on the desktop
 |  | StartMenu | Place an icon in the StartMenu\Programs (default value)
 |  | QuickLaunch | Add an icon to the Quick Launch bar
 |  | SendTo* | Add an icon on the right-click menu "Send To"
 |  | AutoStart or AutoRun | Place an icon in the StartMenu\Programs\AutoStart
 |  | EditWith | Add an icon on the right-click menu "Edit With %ProgramExe%"
 |  | Accessories* | Place an icon in the StartMenu\Programs\Accessories
 |  | AdministrativeTools* | Place an icon in the StartMenu\Programs\Administrative Tools
 |  | SystemTools* | Place an icon in the StartMenu\Programs\Accessories\System Tools
 |  | StartMenuRoot | Place an icon in the StartMenu Root
2 | StartMenuFolder | Fill this value if you want to force the shortcut to be placed on a specific folder (let it empty for use the script foldername)
3 | FullFileName | This switch is used if you want to create a shortcut different of %ProgramExe% (No need to give path if File is in same folder as %ProgramExe%) (default value = %Pe_Programs%\%ProgramFolder%\%ProgramExe%)
4 | Title | Set your own title for this shortcut (default value = %ProgramTitle%)
5 | Work Folder* | Decide in which folder should start the program (default value = same Folder as the program set in parameter 3)
6 | Parameters | If you want to launch the program with command line parameters, write them here
7 | IconFile | Specify which icon to use on the shortcut. (No need to give path if IconFile is in same folder as the program set in parameter 3)
 |  | (Path\) IconFile | for icon type .ico or .exe
 |  | (Path\) IconFile#$cIndex* | for icon type .dll or .exe (simply add #$c between IconFile and Index)
8 | StartMode | Value to set how the window of the launched program should be.
 |  | 1 | = Show
 |  | 2 | = Show_Minimized (program will start minimized)
 |  | 3 | = Show_Maximized (program will start maximized)
9 | ToolTipText* | Text to display when cursor is on the icon of the program

Remarks

Add_Shortcut is a generic command that will create a shortcut. On most projects, by leaving empty parameter 2, it will create this shortcut inside the Start Menu and will place it inside a subfolder that has the same name as the folder where the respective script is placed.

You don't need to worry where the shortcut will be placed because each project will create them in the best possible way.

This seems that it was coded exclusively to work with the explorer shell but it wasn't. If the user prefers (for example) to use xoblite, then the Add_Shortcut will either use the equivalent shortcut or simply ignore the request if it is not possible to execute.

Tips

If you want place an icon in StartMenu\Programs without subfolder use a point (.) as parameter 2

Add_Shortcut,StartMenu,.

Add_Shortcut,StartMenu,..      is same as      Add_Shortcut,StartMenuRoot

Example

For a script called Test.script, located in folder Apps\CD\ProgTest\ like this :

[Variables]

%ProgramTitle%=Test

%ProgramEXE%=Prog.exe

%ProgramFolder%=AppTest

[Process]

To add a shortcut called Test in StartMenu\Programs\CD\ProgTest for Program Files\AppTest\Prog.exe simply use :

Add_Shortcut or Add_Shortcut,StartMenu

use icon Icon.ico from same folder as the %ProgramExe%

Add_Shortcut,StartMenu,,,,,,Icon.ico

use icon from I386\sytem32\shell32.dll with index 27

Add_Shortcut,Desktop,,,,,,#$pSystemRoot#$p\system32\shell32.dll#$c27


CopyProgram

CopyProgram

Syntax

CopyProgram,SourceFolder,[TargetFolder],[Filename],[FileToDelete]

Parameters

1 | SourceFolder | Source folder containing script files to copy. All files in this folder will be copied.
2 | TargetFolder | Optional target folder to which the source folder will be copied. If it does not exist the folder will be created. It defaults to: %Target_Prog%\%ProgramFolder%
3 | FileName | Used to test if filename exist in the source folder. If not a message will appear and the function will be skipped. It defaults to: %ProgramExe%"
4 | FileToDelete | Optional file name to delete in target folder

Remarks

This is used to copy all program files associated with a script. It will usually be used when the script files are contained in a sub folder of the script folder or in the script folder itself. In the latter case you would use the FileToDelete parameter to delete the script file from the target folder.

Example

This will copy all files from a sub directory of the script directory named %ProgramFolder%. It will show an error if pcidevs.txt does not exist in this source directory.

CopyProgram,%ScriptDir%\%ProgramFolder%,,pcidevs.txt


Unpack

GetInterface

Syntax

GetInterface,%VarResult%,Filename,ComponentName,[ComponentType],[Position]

Parameters

1 | %VarResult% | Variable used to receive the value of the inerface element
2 | FileName | Relative path to script file containing interface which is being accessed
3 | ComponentName | Name of interface element being accessed
4 | ComponentType | Optional value defining the type of the element being accessed. Only needed if the interface element has a none standard name from which the type of the element cannot be inferred.
5 | Position | Optional value specifying the position in the element from which the data will be accessed.

Remarks

This command is used to read the value of an interface element from a different script than the currently executing one.

Example

Read the value of the pTextBox1 textbox from the Hijackthis script to a variable named %Result%

GetInterface,%Result%,%ProjectDir%\Apps\HijackThis!.script,pTextBox1

Read the value of the pTest_TextBox1 textbox from the Hijackthis script to a variable named %Result%. In this case as a none standard name was used for the textbox the type of the interface element needs to be specified. The data at position 8 will be read.

GetInterface,%Result%,%ProjectDir%\Apps\HijackThis!.script,pTest_TextBox1,TextBox,8


Hive_Load

Hive_Load

Syntax 1

Hive_Load,Hive

Parameters

1 | Hive | Name of the registry hive to load
 |  | Default | This is the current user hive ( HKCU ). Can also use HKCU or User.
 |  | Software | This is the software hive ( HKLM\Software ). Can also use HKU or Machine.
 |  | System | This is the system hive ( HKLM\System ). Can also use HKLM.

Remarks

This command will load an external registry hive into your local registry system.

Tips

Should always be followed after all registry calls for this hive with a Hive_Unload call.

Should never reference CurrentControlSet. Always use ControlSet001.

Example

This installs the snapman filter driver.

Hive_Load,System
reg_add,0x7,"%reg%\ControlSet001\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}","UpperFilters","PartMgr","snapman"
reg_add,0x7,"%reg%\ControlSet001\Control\Class\{71A27CDD-812A-11D0-BEC7-08002BE2092F}","UpperFilters","snapman"
reg_add,0x4,"%reg%\ControlSet001\Services\snapman","ErrorControl","1"
reg_add,0x1,"%reg%\ControlSet001\Services\snapman","ImagePath","system32\DRIVERS\snapman.sys"
reg_add,0x4,"%reg%\ControlSet001\Services\snapman","Start","0"
reg_add,0x4,"%reg%\ControlSet001\Services\snapman","Type","1"
Hive_Unload,System

Common_Api version 8 - 11-08-2009 - Pedro Le 15


Hive_Unload

Hive_Unload

Syntax 1

Hive_Unload,Hive

Parameters

1 | Hive | Name of the registry hive to unload
 |  | Default | This is the current user hive ( HKCU ). Can also use HKCU or User.
 |  | Software | This is the software hive ( HKLM\Software ). Can also use HKU or Machine.
 |  | System | This is the system hive ( HKLM\System ). Can also use HKLM.

Remarks

This command will unload an external registry hive that was previously loaded into your local registry system with Hive_Load.

Example

This installs the snapman filter driver.

Hive_Load,System
reg_add,0x7,"%reg%\ControlSet001\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}","UpperFilters","PartMgr","snapman"
reg_add,0x7,"%reg%\ControlSet001\Control\Class\{71A27CDD-812A-11D0-BEC7-08002BE2092F}","UpperFilters","snapman"
reg_add,0x4,"%reg%\ControlSet001\Services\snapman","ErrorControl","1"
reg_add,0x1,"%reg%\ControlSet001\Services\snapman","ImagePath","system32\DRIVERS\snapman.sys"
reg_add,0x4,"%reg%\ControlSet001\Services\snapman","Start","0"
reg_add,0x4,"%reg%\ControlSet001\Services\snapman","Type","1"
Hive_Unload,System

Common_Api version 8 - 11-08-2009 - Pedro Le 15


Not_Compatible

Not_Compatible

Syntax

Not_Compatible,OSType

Parameters

1 | OSType | Project target type for which the current script is not compatible
 |  | LiveXP | Script is not compatible with the LiveXP project
 |  | VistaPE | Script is not compatible with the VistaPE project
 |  | Win7PE | Script is not compatible with the Win7PE project

Remarks

Tihs function is used to generate an error message if the script is used in a none compatible project.

Example

This will generate an error message at build time if the script is built in the LiveXP project.

Not_Compatible,LiveXP

Common_Api version 8 - 11-08-2009 - Pedro Le 15


Process_Log

Process_Log

Syntax

Process_Log

Remarks

Used to log version info and current time a script is run into the project.info file

Example

Process_Log

Common_Api version 8 - 11-08-2009 - Pedro Le 15


ReadEnv

ReadENV

Syntax

ReadEnv,[GlobalSetting],[LocalVariable]

Parameters

1 | GlobalSetting | Optionally specifies the name of a setting in project.ini to load.
2 | LocalVariable | Only used if the first parameter is specified and optionally allows the name of the local script variable into which the setting is to be loaded to be specified. By default the local variable name will be the same as the setting name.

Remarks

This function is called to read all settings from project.ini into local script variables of the same name as the setting or optionally a specified setting from project.ini into a local script variable.

Example

The following loads all project settings, loads the Shell setting into a variable named %Shell%, loads the Shell setting into a variable named %ShellName%.

ReadENV

ReadENV,Shell

ReadEnv,ShellName

Common_Api version 8 - 11-08-2009 - Pedro Le 15


Reg_Add

Reg_Add

Syntax

Reg_Add,ValueType,%reg%\KeyName,[ValueName],[Value],[PRESERVE],[NOWARN]

Parameters

1 | ValueType | The type of the registry value
 |  | 0x0 | Registry key with no value
 |  | 0x1 | String Value
 |  | 0x2 | Expanded String - will expand any variable value contained inside %<var>%. (e.g. %temp%)
 |  | 0x3 | Binary value - Each byte is specified by groups of two hex digits separated with commas e.g. 12,0F,25.
 |  | 0x4 | DWORD integer value specified by a decimal digit number i.e. 23567.
 |  | 0x7 | Writes null separated strings terminated with an extra null i.e. "ab","cd","efgh".
2 | KeyName | Name of the registry key. Must be prefixed with %reg%\.
3 | ValueName | Name of the registry value.
4 | Value | Value. Format depends on the ValueType.
5 | PRESERVE | If specified don't overwrite a value that already exists. A warning will be logged. Can be suppressed by specifying NOWARN.
6 | NOWARN | Suppress the warning in the log file. The optional PRESERVE / NOWARN parameters can be specified in any order. One or both can be specified.

Remarks

This function is used to add a value to the registry hive loaded by Hive_Load.

WB 77 RC2 or later: RegWrite gives a warning in the log, if the destination value already exists. The warning can be suppressed by specifying the NOWARN parameter.

Tips

Creating an empty registry key: Write a key using keytype as 0x0 and omit the entries for ValueName and Value - this will create a new registry key at the location you specify.

Example

reg_add,0x1,%reg%\ControlSet001\Services\dc_fsf,ImagePath,system32\drivers\dc_fsf.sys

reg_add,0x3,%reg%\ControlSet001\Services\Themes,FailureActions,\
80,51,01,00,00,00,00,00,00,00,00,00,03,00,00,00,41,00,4d,\
00,01,00,00,00,60,EA,00,00,01,00,00,00,60,EA,00,00,00,00,00,00,00,00,00,00

Reg_Add,0x4,%reg%\ControlSet001\Services\VgaSave\Device0,DefaultSettings.XResolution,1024


Reg_Del

Reg_Del

Syntax

Reg_Del,KeyName,[ValueName]

Parameters

1 | KeyName | Key name to delete. Must be prefixed with %reg%\.
2 | ValueName | Optional value name to delete. If not specified then the key and its contents will be deleted.

Remarks

This function is used to delete a registry key and all contained values / keys or to delete a value from the registry hive loaded by Hive_Load.

Example

Reg_Del,%reg%\ControlSet001\Services\VgaSave\Device0,DefaultSettings.XResolution

Reg_Del,%reg%\ControlSet001\Services\VgaSave\Device0


Reg_Import

Reg_Import

Syntax

Reg_Import,RegFile

Parameters

1

RegFile

Name of reg file to import.

Remarks

This will download the latest version of reg2wbsprg.exe if not already downloaded and use it to convert the reg file to a script file using the -h -e -a parameters. These mean add hive load / unload around the reg_add commands, replace environment variables with variable names and use the common api. It will then execute the Process section in the generated script to apply the registry commands to the appropriate registry hive. As a script file is being generated and executed then abviously the reg file must only contain registry values of the types supported by winbuilder.

Example

Reg_Import,temp.reg

If the reg file contains the following:

Windows Registry
Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\Hybrid]
"AddDeviceSequence"=dword:0000000

[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA
Corporation\Global\Hybrid\Current]
"Mode"=hex:03,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\NvCplApi\Policies]
"ContextUIPolicy"=dword:00000002
"CplGroupUIPolicy"=dword:00000002
"TaskbarUIPolicy"=dword:00000002

[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\NvSvc]
"DrvUpdCtrlCode"=dword:00000081

Then the following will be generated and imported into the software hive:

[main]
Title=temp
Selected=False
Level=10
Author=PSC Program 'reg2WBS'
Version=000
Date=23-Aug-2009

[Process]
IniRead,%API%,Main,Version,%apiVersion%
If,%apiVersion%,SMALLER,14,Halt,"API version 14 or higher needed!"
Hive_Load,Machine
reg_add,0x0,"%reg%\NVIDIA Corporation"
reg_add,0x0,"%reg%\NVIDIA Corporation\Global"
reg_add,0x4,"%reg%\NVIDIA Corporation\Global\Hybrid","AddDeviceSequence","1"
reg_add,0x3,"%reg%\NVIDIA Corporation\Global\Hybrid\Current","Mode","03","00","00","00","00","00","00","00"
reg_add,0x0,"%reg%\NVIDIA Corporation\Global\NvCplApi"
reg_add,0x4,"%reg%\NVIDIA Corporation\Global\NvCplApi\Policies","ContextUIPolicy","2"
reg_add,0x4,"%reg%\NVIDIA Corporation\Global\NvCplApi\Policies","CplGroupUIPolicy","2"
reg_add,0x4,"%reg%\NVIDIA Corporation\Global\NvCplApi\Policies","TaskbarUIPolicy","2"
reg_add,0x4,"%reg%\NVIDIA Corporation\Global\NvSvc","DrvUpdCtrlCode","129"
Hive_Unload,Machine

Common_Api version 8 - 11-08-2009 - Pedro Le 15


RegAddBoot

RegAddBoot

Syntax 1

RegAddBoot,Hive,ValueType,KeyName,ValueName,Value

Parameters

1 | Hive | Hive to be updated at boot time
 |  | HKLM | The HKEY_LOCAL_MACHINE hive.
 |  | HKCU | The HKEY_CURRENT_UER hive.
2 | ValueType | The type of the registry value
 |  | 0x0 | Registry key with no value
 |  | 0x1 | String Value
 |  | 0x2 | Expanded String - will expand any variable value contained inside %<var>%. (e.g. %temp%)
 |  | 0x3 | Binary value - Each byte is specified by groups of two hex digits separated with commas e.g. 12,0F,25.
 |  | 0x4 | DWORD integer value specified by a decimal digit number i.e. 23567.
 |  | 0x7 | Writes null separated strings terminated with an extra null i.e. "ab","cd","efgh".
3 | KeyName | Name of the registry key.
4 | ValueName | Name of the registry value.
5 | Value | Value. Format depends on the ValueType.

Remarks

Some programs don't correctly support expanding of environment variables in registry values. For those cases the registry updates have to be delayed till PE boot time. RegAddBoot allows registry values to be applied at boot time instead of build time.

Example

RegAddboot,HKLM,0x1,"Software\Acronis\CommonComponents", "fcalloc.dll", "%PE_Programs%\TrueImageHome\fcalloc.dll"

RegAddBoot,HKLM,0x2,"System\ControlSet001\Services\AntiVirScheduler","ImagePath","%PE_Programs%\Avira\sched.exe"


Register_File

Register_File ( LiveXP / NativeEx Projects Only )

Syntax

Register_File,FileName,RegType

Parameters

1 | FileName | File to register
1 | RegType | Type of registration to perform
 |  | Install | Register the file using the DllInstall entry point ( /i on regsvr32 )
 |  | Register | Register the file using the DllRegisterServer entry point

Remarks

This uses one of two methods to perform the registration:

  • If %dllregmethod% project variable exists and is equal to Build-Time it will use the RegRedirect program to perform the registration. This program as its name suggests captures the registry updates and redirects them to the current software registry hive loaded by winbuilder.
  • If %dllregmethod% project variable exists and is any other value or if the %dllregmethod% project variable does not exist it will write an entry in the software registry hive to perform a regsvr32 on the file at boot time. It will use an etry in Microsoft\Windows\CurrentVersion\RunOnceEx\550 to perform this registration.

Tips

If the file is to be registered at build then the file name should include path information to locate the file in the source or in the script directories.

If the file is to be registered at boot time then the file name should include run time path information or it should be locatable via the current path environment variable.

Example

Register_File,%SystemRoot%\system32\shell32.dll,Install


Require_File

Require_File

Syntax

Require_File,SourceFile,[SourceFolder],[TargetFolder],[PRESERVE]|[OverWrite],[NOWARN],[MUISource]

Parameters

1 | SourceFile | Name of the file to copy. For XP based projects this should be the final expanded file name not the compressed file name. This may optionally contain a path which will be relative to the SourceFolder / TargetFolder parameters.
2 | SourceFolder | Folder containing the file to copy. This defaults to %Source_Sys%.
3 | TargetFolder | Folder to which the file is to be copied. This defaults to %Target_Sys%.
4 | PRESERVE | By default if the target file exists it will be overwritten - this can be explicitly requested by . This parameter is used to not copy the file if it already exists in the target folder. A warning will be generated in the log file if the target file exists. The optional NOWARN parameter can be used to suppress this warning.
5 | NOWARN | By default a warning will be generated in the log file if the target file exists. This parameter is used to suppress the warning.
6 | MUISource | For XP based projects only this parameter optionally allows the folder containing the language specific files associated with the source file to be specified.

Remarks

This function is used to copy a source file from a source folder to a target folder expanding the file if its compressed. It will in addition copy any language resource files associated with the file.

The expansion of compressed files functionality is specific to XP based projects where many source files are compressed. These compressed files use the cabinet archiving method and usually have an identifiable _ as the last character on their extensions. (e.g. myFile.Tx_ ).

Vista/Win7 source does not use explicitly compressed source files instead the source is contained within a WIM file which is compressed.

Tips

The PRESERVE parameter must be parameter 4. The NOWARN parameter must be parameter 5.

Example

This always copies shlwapi.dll, only copies swenum.sys if it does not exist in the target directory but logs a warning, only copies swenum.sys if it does not exist in the target directory and supresses the warning if it already exists in the target directory.

Require_File,shlwapi.dll

Require_File,shlwapi.dll,,,PRESERVE

Require_File,shlwapi.dll,,,PRESERVE,NOWARN

This always copies swenum.sys from the %Source_Sys%\drivers folder to the %target_sys%\drivers folder

Require_File,drivers\swenum.sys

Common_Api version 8 - 11-08-2009 - Pedro Le 15


RequireSysFile

RequireSysFile (Vista / Win7 Projects only )

Syntax

RequireSysFile,SourceFile,[NOWARN],[PRESERVE]

Parameters

1 | SourceFile | Name of the file to copy. This may optionally contain a path which will be relative to the %SystemFiles% / %TargetDir% folders.
2 | NOWARN | By default a warning will be generated in the log file if the target file exists. This parameter is used to suppress the warning.
3 | PRESERVE | By default if the target file exists it will be overwritten. This parameter is used to not copy the file if it already exists in the target folder. A warning will be generated in the log file if the target file exists. The optional NOWARN parameter can be used to suppress this warning.

Remarks

This function is used to copy a source file from the %SystemFiles% source folder to the %TargetDir% target folder ( the copy will always be from the mounted install.wim ). It will in addition copy any language resource files associated with the file.

Tips

The NOWARN and PRESERVE parameters can be specified in any order.

This functon has been superceded by the Require_File function which works for all common API projects.

Example

This always copies shlwapi.dll, only copies swenum.sys if it does not exist in the target directory but logs a warning, only copies swenum.sys if it does not exist in the target directory and supresses the warning if it already exists in the target directory.

RequireSysFile,windows\system32\shlwapi.dll

RequireSysFile,windows\system32\shlwapi.dll,PRESERVE

RequireSysFile,windows\system32\shlwapi.dll,NOWARN,PRESERVE

This always copies swenum.sys from the %Source_Sys%\drivers folder to the %target_sys%\drivers folder

Require_File,windows\system32\drivers\swenum.sys


RunFromCD

RunFromCD ( LiveXP / NativeEx Projects Only )

Syntax 1

RunFromCD,[BuildType]

Parameters

1 | BuildType | Forces the programs from the current script to run directly from the boot media instead of from the ram drive
 |  | True | Force the current script programs to run from the boot media at %ProgramFilesFolder%\%ProgramFolder%
 |  | FolderName | Force the current script programs to run from the boot media at the specified folder

Remarks

Typically used in a build where the build model is run from ram and you want to force the current script program to run directly from the boot media

Example

RunFromCD,True

Common_Api version 8 - 11-08-2009 - Pedro Le 15


RunFromRam

RunFromRam

Syntax

RunFromRam,[True]

Parameters

1

True

Optional parameter used to override the project build model so that the programs for the current script are run from the boot ram drive. If this parameter is not specified the default project build model is used. In the vista / win7 versions of PE this forces the program to be in the boot.wim.

Remarks

In general there are 2 build models:

  • Boot the windows directory from the boot media
  • Boot the windows directory from a ram drive. This option gives better performance but uses much more ram.

Example (Syntax 1)

RunFromRam,True

Common_Api version 8 - 11-08-2009 - Pedro Le 15


Select_Case

Select_Case

Syntax

Select_Case,Var,ListVar1,[ListVar2],[Separator]

Parameters

1 | Var | Variable to test
2 | ListVar1 | List of possible value that Var set in parameter 1 should be equal , separated by a "|"
3 | ListVar2 | Second list of value separated by a "|" (should have same number of variables than ListVar1 set in parameter 2)
4 | Separator | Set this parameter to 1 if you want use a comma "," as separator rather the default separator "|"

Return Value

Always return the variable %Case% as result

If parameter 3 is empty %Case% return the position of Var in ListVar1 set in parameter 2 (0 if not found)

If parameter 3 is not empty %Case% return one variable of ListVar2, corresponding of the position of Var in ListVar1 set in parameter 2 (" " empty if not found)

Example 1

[Process]

ReadEnv,SourceType

Select_Case,%Source_Type%,"XP|W2003|VistaCD|Win7CD","1|1|2|2"

If,%Case%,Equal,,Message,"This script is no compatible with W2000 source or WAIK source",Information

Else,Run,Section_%Case%

[Section_1]

//Code for LiveXP / NativeEx with XP/W2003 source

Echo,"%Source_Type%"

[Section_2]

//Code for Vista / Win7 with DVD source

Echo,"%Source_Type%"

Example 2

[Process]

ReadEnv,SourceType

Select_Case,%Source_Type%,"XP|W2003|VistaCD|Win7CD"

Run,Section_%Case%

[Section_0]

//Code for LiveXP / NativeEx with W2000 source and Vista / Win7 with WAIK source

Echo,"%Source_Type%"

Message,"This script is no compatible with W2000 source or WAIK source",Information

Exit,"Invalid Source"

[Section_1]

//Code for LiveXP / NativeEx with XP source

Echo,"%Source_Type%"

[Section_2]

//Code for LiveXP / NativeEx with W2003 source

Echo,"%Source_Type%"

[Section_3]

//Code for Vista with DVD source

Echo,"%Source_Type%"

[Section_4]

//Code for Win7 with DVD source

Echo,"%Source_Type%"

Example 3

Select_Case,%Os_Type%,"x86|amd64|ia64","http://www.nirsoft.net/utils/heapmemview.zip|http://www.nirsoft.net/utils/heapmemview-x64.zip|"

If,Not,%Case%,Equal,,Unpack,%Case%,-URL

Case_Select ( Source code )

StrFormat,POS,#2,#1,#9

StrFormat,LEFT,#2,#9,#8

StrFormat,SPLIT,#8,|,0,%Case%

If,NOT,#3,Equal,,StrFormat,SPLIT,#3,|,%Case%,%Case%


Unpack

ShowComponent

Syntax

ShowComponent,ComponentName[,State][,Filename][,RefreshInterface]

Parameters

1 | ComponentName | Name of interface component to show
2 | State | Optional parameter indicating if the interface component should be hidden ( 0) or shown ( 1 ). If the parameter is not specified then 1 ( show ) is assumed.
3 | FileName | File name of the script containing the interface element to hide or show.
4 | RefreshInterface | Optional parameter indicating if the interface should be refreshed. If True then the interface is refreshed. If False or not specified then the interface is not refreshed.

Remarks

This function is used to hide or show a component in the interface of either the current script or a specified script. Expected use is to use a checkbox to show / hide a text box containing license text or further information for the current interface.

Example

Show pTextFile1 in the current script. Call System,REFRESHINTERFACE to refresh the current interface.

ShowComponent,pTextFile1,1,,True

Common_Api version 8 - 11-08-2009 - Pedro Le 15


Unpack

Unpack

Syntax 1

Unpack,[Section],[Archive],[Option],[Target],[ProgramFolder],[Filename]

Parameters

1 | Section | This is the section in %SrciptFile% which contain the encoded files to extract. (default value = Folder)
2 | Archive | Use this if you want extract an archive (only archive supported by 7z.exe, even an achive in exe format)
3 | Option | Parameter 2 is : |
 |  | archive (zip,7z,rar) | Set it to False if you don't want to delete the archive (default value = True)
 |  | SFX archive (exe) | Set it to -y for silent extraction
 |  | empty | If you want extract only one file from section rather all files set its name here
4 | Target | First part to select where to extract files, generaly one of this four value :
 |  | %TargetDir% | Root
 |  | %Target_Prog% | \Program Files (default value = %Target_Prog%)
 |  | %Target_Win% | \I386 or \Windows
 |  | %Target_Sys% | \I386\System32 or \Windows\System32
5 | ProgramFolder | Second part to select where to extract files (subfolder) (default value = %ProgramFolder%)
6 | Filename | This is use for test if exist %ScriptDir%\ProgramFolder\[Filename], if true exit Unpack and copy files from there by CopyProgram command. (default value = %ProgramEXE%)

Syntax 2

Unpack,[Filename],Action,[Param3],[Param4],[Param5]

Parameters

1 | Filename | Depending on Action : FullFilename of Script, Archive or Web Link (default value = %SrciptFile%)
2 | Action | If parameter 2 not match with one of following word syntax 1 is used
 |  | All | Extract All Files from Script set in parameter 1
 |  | -All | Extract All Files but only If they Not Exist from Script set in parameter 1
 |  | One | Extract only One File ( the file set in parameter 4) from Script set in parameter 1
 |  | Archive | Extract an Archive (set in parameter 4) and delete Archive
 |  | -Archive | Extract an Archive (set in parameter 4) but don't delete Archive
 |  | SFX | Extract a SFX Archive (set in parameter 4), execute and delete the SFX Archive
 |  | UnZip | Unzip an Archive file (from filename set in parameter 1) with 7x.exe
 |  | URL | Download and Unzip Archive file (from link set in parameter 1) and delete Archive file
 |  | -URL | Download and Unzip Archive file (from link set in parameter 1) but don't delete Archive file
3 | Param3 | If Action equal : |
 |  | All -All One Archive -Archive SFX | Set here the section in Filename set in parameter 1 which contain the encoded files to extract. (default value = Folder)
 |  | UnZip | Set here the target where you want UnZip Files from Archive set in parameter 1 (default value = %Target_Prog%\%ProgramFolder%)
 |  | URL | Set here the target where you want Download and UnZip Files from Archive set in parameter 1 (default value = %Target_Prog%\%ProgramFolder%)
 |  | -URL | Set here the target where you want UnZip Files (from Downloaded Archive saved in parameter 4) set in parameter 1 (default value = %Target_Prog%\%ProgramFolder%)
4 | Param4 | If Action equal : |
 |  | All -All | Set here the target where you want Extract Files from Script set in parameter 1 (default value = %Target_Prog%\%ProgramFolder%)
 |  | One | Set here the filename you want extract from section set in parameter 3 from Script file set in parameter 1 (no default value , must be set)
 |  | Archive -Archive | Set here the Archive filename you want extract from section set in parameter 3 from Script file set in parameter 1 (no default value , must be set)
 |  | SFX | Set here the SFX Archive filename you want extract from section set in parameter 3 from Script file set in parameter 1 (no default value , must be set)
 |  | UnZip URL | Nothing for this Action
 |  | -URL | Set here the target where you want store the downloaded archive (default value = %ProjectTemp%)
5 | Param5 | If Action equal : |
 |  | One Archive SFX -Archive | Set here the target where you want Extract Files (default value = %Target_Prog%\%ProgramFolder%)

Remarks

Unpack is a command that is used to extract the program files from your script onto a program folder on your boot disk project.

The Unpack command will use the folder called "Folder" as default place to keep all files that you attached using the "Create script" tool

All parameters are optional, so when you wrote :

Unpack

default value for empty parameters are bring up if they are needs, so this command become :

Unpack,Folder,,%Target_Prog%,%ProgramFolder%,%ProgramEXE%

The variable %Target_Prog% (defined in Script.project) is the "Program Files" folder.

The variables %ProgramFolder% and %ProgramEXE% should be defined in section Variables of your script.

Only when an archive(7z,zip,rar - not for SFX archive) is set in parameter 2, the first thing that Unpack do, is look in %ScriptDir%\%ProgramFolder% if the file given in parameter 6 (default value = %ProgramExe%) exist.

If the file exist, all files in this folder are copied by CopyProgram rather extracted from %ScriptDir%.

Tips

If you want Unpack files in %Target_Sys% you can use a point (.) as parameter 5

Unpack,,,,%Target_Sys%,.      is same as      Unpack,,,,%Target_Win%,System32

Example (Syntax 1)

Unpack all files from section Folder to Program Files\%ProgramFolder%

Unpack

Unpack Archive.7z from section Doc to Program Files\%ProgramFolder%\Help (unzip the archive and delete it after)

Unpack,Doc,Archive.7z,,,%ProgramFolder%\Help

Unpack Archive.7z from section Doc to Program Files\%ProgramFolder%\Help (but don't unzip the archive)

Unpack,Doc,,Archive.7z,,%ProgramFolder%\Help

Unpack an Archive SFX (prog.exe) from section Folder to Program Files\%ProgramFolder% ( after [prog.exe] is extracted, it is run with the parameter [-y] and then deleted)

Unpack,,prog.exe,-y

Unpack one file(myfont.ttf) from section Fonts to I386\Fonts or Windows\Fonts

Unpack,Fonts,,myfont.ttf,%Target_Win%,Fonts

Example (Syntax 2)

Unpack all files from %ScriptFile% from section Folder to Program Files\%ProgramFolder%

Unpack,,All

Unpack Archive.7z from %ScriptDir%\other.script from section Doc to Program Files\%ProgramFolder%\Help (unzip the archive and delete it after)

Unpack,%ScriptDir%\other.script,Archive,Doc,Archive.7z,%Target_Prog%\%ProgramFolder%\Help

Unpack Archive.7z from %ScriptFile% from section Doc to Program Files\%ProgramFolder%\Help (but don't unzip the archive)

Unpack,,-Archive,Doc,Archive.7z,%Target_Prog%\%ProgramFolder%\Help

Unpack an Archive SFX (prog.exe) from %ScriptFile% from section Folder to Program Files\%ProgramFolder% ( after [prog.exe] is extracted, it is run with the parameter [-y] and then deleted)

Unpack,,SFX,,prog.exe

Unpack one file(myfont.ttf) from %ScriptFile% from section Fonts to I386\Fonts or Windows\Fonts

Unpack,,One,Fonts,myfont.ttf,%Target_Win%\Fonts

UnZip an Archive from %ScriptDir%\Test.7z to Program Files\%ProgramFolder%

Unpack,%ScriptDir%\Test.7z,UnZip

Download an archive from http://www.mysite.com/test.7z to Program Files\%ProgramFolder% and delete test.7z after UnZip it

Unpack,http://www.mysite.com/test.7z,URL

Download an archive from http://www.mysite.com/test.7z to %GlobalTemplates%\Apps\%ProgramFolder%

but only if not exist test.7z in %GlobalTemplates%\Apps\%ProgramFolder%

and UnZip test.7z from %GlobalTemplates%\Apps\%ProgramFolder% to I386\System32 or Windows\System32 (test.7z is not deleted)

Unpack,http://www.mysite.com/test.7z,-URL,%Target_Sys%,%GlobalTemplates%\Apps\%ProgramFolder%


Unpack

WriteInterface

Syntax

WriteInterface,NewValue,Filename,ComponentName[,Type][,Position]

Parameters

1 | NewValue |
2 | FileName | Relative path to script file containing interface which is being accessed
3 | ComponentName | Name of interface element being accessed
4 | Type | Optional value defining the type of the element being accessed. Only needed if the interface element has a none standard name from which the type of the element cannot be inferred.
5 | Position | Optional value specifying the position in the element to which the data will be written.

Remarks

This function is used to update an element in the interface of a different script than the currently executing script.

Example

Write the value "GetInterface Test" to the pTextBox1 textbox interface element in the Hijackthis script.

WriteInterface,"GetInterface Test",%ProjectDir%\Apps\HijackThis!.script,pTextBox1

Write the value "GetInterface Test" to the pTest_TextBox1 textbox interface element in the Hijackthis script. In this case as a none standard name was used for the textbox the type of the interface element needs to be specified. The data at position 8 will be updated.

WriteInterface,"GetInterface Test",%ProjectDir%\Apps\HijackThis!.script,pTest_TextBox1,TextBox,8


VistaPE — API

VistaPE — Professionals system available to everyone
Updated 11.06.2008

Internal functions of VistaPE

Contents

  1. General information
  2. Examples of typical scripts
  3. Description of commands and options
  4. Global variables
  5. Description of vistape.cfg format
  6. Recommendations for creating scripts

General information

Since the release of 9 engine VistaPE made an enormous amount of change, many function is now work automatically and added a new API scripts programs. With each new version of VistaPE, API becomes more adaptable and powerfull, sometimes changing internal mechanisms work, but always maintain scripts written earlier. Application API ensures portability and operability your scripts in all versions VistaPE. Information in this section is relevant VistaPE v12 beta 2 and newer versions.

VistaPE API is a powerful, advanced and comprehensive tool to facilitate the creation of typical script. In some cases, you may need to use standard commands WinBuilder documentation which can be found here. VistaPE supports placing files with programs in memory (boot.wim), and directly to the media, API supports all features and allows individually selected for each program. There is the possibility of including files directly to the program scripts, and is able to update the program without direct editing scripts, there is also an opportunity to copy already established in the program without special integration scripts, gathering information on the settings directly from the registry system and the large number of other possible opportunities facilitate the establishment of their own scripts and system optimization for specific tasks VistaPE one of the most simple and flexible tool in this regard.

Contents

The examples of typical scripts

As mentioned earlier, scripts can contain embedded programs, copy files from your directory or download programs directly from the Internet, are small examples of such scripts.

This script contains an embedded program, can build up in the shell list, creates labels on the desktop and Start menu and always gets out of memory (using vistape.wim):

[Main]
Title=A43 File Management
Author=NightMan
Level=5
Version=011
Description=
Locked=false
Contact=vistape@vistape.net
Date=02.12.2007
Selected=True
Download_Level=1

[Variables]
%ProgramFolder%=A43
%ProgramEXE%=a43.exe
%ProgramTitle%=A43 File Management

[Process]
Echo,Processing %ProgramTitle%...
RunFromRam,True
Unpack,Files,A43.7z,True
Add_Shortcut,StartMenu
Add_Shortcut,Desktop
#
If,%pCheckBox3%,Equal,True,If,%pCheckBox4%,Equal,True,AddToPEShell,%ProgramTitle%,,True
If,%pCheckBox3%,Equal,True,If,%pCheckBox4%,Equal,False,AddToPEShell,%ProgramTitle%
#

[Interface]
pCheckBox3="Add to PE Shell",1,3,10,60,200,18,True
pCheckBox4="Set as default shell in PE Shell",1,3,10,80,200,18,False

[EncodedFolders]
Files

[EncodedFile-Files-a43.7z]
lines=276

The next script check the program's executable and can download it, if necessary:

[Main]
Title=TotalCommander 7.03
Author=NightMan
Level=3
Version=12
Description=
Locked=false
Contact=vistape@vistape.net
Date=14.05.2008
Selected=True
Download_Level=1

[Variables]
%ProgramFolder%=totalcmd
%ProgramEXE%=totalcmd.exe
%ProgramTitle%=Total Commander

[Process]
If,NotExistFile,"%pFileBox1%\%ProgramEXE%",run,%ScriptFile%,Download
Echo,Processing %ProgramTitle%...
RunFromRam,True
CopyProgram,%pFileBox1%
Add_Shortcut,StartMenu
Add_Shortcut,Desktop
#
If,%pCheckBox3%,Equal,True,If,%pCheckBox4%,Equal,True,AddToPEShell,%ProgramTitle%,,True
If,%pCheckBox3%,Equal,True,If,%pCheckBox4%,Equal,False,AddToPEShell,%ProgramTitle%
If,%pCheckBox5%,Equal,True,Add_Shortcut,StartMenu,QuickLaunch
#

[Download]
Echo,"Downloading TotalCommander"
If,NotExistDir,%pFileBox1%,DirMake,%pFileBox1%
WebGet,"http://fileforum.betanews.com/sendfile/945901171/1/tcmdr703.exe","%pFileBox1%\tcmdr703.exe"
ShellExecute,Hide,#$q%Tools%\7z.exe#$q,"x -y #$q%pFileBox1%\tcmdr703.exe#$q -o#$q%pFileBox1%#$q"
FileDelete,"%pFileBox1%\FILE_ID.DIZ"
FileDelete,"%pFileBox1%\INSTALL.EXE"
FileDelete,"%pFileBox1%\LIESMICH.TXT"
FileDelete,"%pFileBox1%\README.TXT"
FileDelete,"%pFileBox1%\tcmdr703.exe"
ShellExecute,Hide,#$q%Tools%\7z.exe#$q,"x -y #$q%pFileBox1%\INSTALL.CAB#$q -o#$q%pFileBox1%#$q"
FileDelete,"%pFileBox1%\INSTALL.CAB"
DirDelete,"%pFileBox1%\d"
DirDelete,"%pFileBox1%\e"

[Interface]
pCheckBox3="Add to shell list",1,3,10,60,200,18,True
pCheckBox4="Set as default shell",1,3,10,80,200,18,False
pFileBox1=%ScriptDir%\TC,1,13,79,125,207,28,dir
pTextLabel1="Source folder",1,1,10,129,72,18,8,Normal
pTextLabel2="Total Commenter will be downloaded and installed automatically, if executable will not be found in source path.",1,1,10,172,436,40,8,Normal
pCheckBox5="Add QuickLaunch icon",1,3,10,101,200,18,True

The examples of API functions can be found in each standard script.

Contents

Description of commands and options

Most of scripts contain several sections:

  • [Main] - script description, version, author, creation date ...
  • [Variables] - script variable settings
  • [Process] - this section is in the processing script constructor and contains commands to all necessary action
  • [Interface] - the appearance of the script
  • [EncodedFolders] - contains a built-in script program in a special encoding
Description of [Main]:
  • Title - program name
  • Author - program author
  • Level - running level - affects the order of scripts, for the program are always advised to use only 5 level
  • Version - version of the script
  • Description - Description of program / script
  • Locked - off accidentally change the interface script
  • Contact - way communication with the author of the script
  • Date - date when create current version of a script
  • Selected - choice script for processing during project compilation
  • Download_Level - priority for script downloading
    • 0 - Minimum
    • 1 - Recommended
    • 2 - Complete
    • 3 - Beta
Description of [Variables]:
  • %ProgramTitle% - program name
  • %ProgramEXE% - main executable file may contain the path to the directory with the program
  • %ProgramFolder% - name for target folder with program
Description of API commands (section [Process]):
  • ReadENV - read VistaPE and source configuration from file %VistaInfo%, after this we have several variables:
    • %DistLang% - language of source
    • %SDIR% - source folder
    • %SourceType% - source type (Windows Vista DVD or WAIK)
    • %WimTools% - WIM tool (imagex or winutil)
    • %SystemFiles% - folder with mounted system files, depended from source type
    • %IMAGEX% - path to imagex.exe
    • %BuildModel% - build model (normal or vistape.wim)
    • %Shell% - default shell
    • %ScreenResolution% - screen resolution
    • %Locale% - locale setting for VistaPE
    • %SysType% - type of host OS (x86 or x64)
    • %GrubSkin% - skin for Grub4Dos
    • %ForceAllToRam% - forcibly copy all program memory (vistape.wim)
    • %WAIKDir% - folder with installed WAIK (if exist)
  • Not_Compatible - ensures compatibility between different projects WinBuilder, example: "Not_Compatible, LiveXP or Not_Compatible, VistaPE"
  • RunFromRam - start this program from memory (vistape.wim), the example: "RunFromRam True" or "RunFromRam, %pCheckBox1%"
  • Unpack - extract program files from script, example: "Unpack,Folder,AngelWriter.7z,True" - first option (Folder) - directory in script with archives; second parameter (AngelWriter.7z) - archive name; third option (in this case " True ") is used only in self extracting archives (files with exe extension), and used as a parameter start, otherwise ignored. If a directory with the script contain folder with the same name as the output folder (%ProgramFolder%), and it is a file named Programme (% ProgramEXE%), is not extracting archive of the script, and copying files from this folder, it is done for facilitate configuration and maintenance program without making immediate changes in the script.
    Also possible advanced usage of this function with directive to target folder and program executable (need for check extracting process), example:
    "unpack,Files,%ProgramArchive%,,%target_win%,System32".
    Brief description of the parameters:
    "Unpack,[Folder],[Archive zip rar 7z and some exe],[True],[%Target_Prog%],[%ProgramFolder%],[%programExe%]"
    For extracting archive we use "7z.exe", latest version support 7z, zip, rar and other archive formats.
  • CopyProgram - copy all files from source folder to target, example: "CopyProgram,c:\test" or "CopyProgram,%pFileBox1%". Also you can set target folder and executable file for check result, example: "CopyProgram,c:\test,%TargetDir%\Test,test.exe".
  • Require_File - copy files from "windows\system32" folder, example: "Require_File,test.dll", file will be placed in "%TargetDir%\windows\system32\" folder
  • RequireSysFile - copy files from source disk, example: "RequireSysFile,windows\system32\drivers\driver.sys", file will be placed to folder similar source folder, for example "%TargetDir%\windows\system32\drivers\"
  • Add_Shortcut - add shortcut to program, example: "Add_Shortcut,StartMenu,Office", first option - type of shortcut destination (StartMenu, Desktop or AutoStart; QuickLaunch and SendTo is NOT supported), second option - program category, it will be ignored if you try place shortcut to Desktop.
    It is possible to use advanced commands for creating a shortcut to any programs, for example: Add_Shortcut,StartMenu,,#$pSystemRoot#$p\System32\%ProgramEXE%,%ProgramTitle%,#$pSystemRoot#$p\System32\AbiWord.
    Brief description of the parameters:
    Add_Shortcut,[Type],[Folder],[FullFileName],[Title],[Work Folder],[Parameters],[IconFile( .ico .exe)],[StartMode(1, 2, 3, or 4)]
    • Type - type of shortcut destination (StartMenu, Desktop or AutoStart)
    • Folder - program category
    • FullFileName - full path to executable, if you use standard path %ProgramFolder%, you need write "%PE_Programs%\%ProgramFolder%\test.exe", %PE_Programs% will be automatically changed to program folder and you need change test.exe to right executable name.
    • Title - program name
    • Work Folder - program work folder (similar to rules of FullFileName)
    • Parameters - running parameters
    • IconFile - full path to icon file (similar to rules of FullFileName)
    • StartMode - mode of program window
      • 1 - normal window
      • 2 - minimize
      • 3 - maximize
      • 4 - hide (not support at this time)
  • AddAutoRun - adds programs to autostart, example: "AddAutoRun,"Test Program","test.exe","/test",1", description:
    • first parameter - program name
    • second parameter - executable file (will be searched in folder with program)
    • third parameter - running parameters
    • fourth parameter - parameter for starting program:
      • 1 - program will be start in normal window and system will wait when program will be finished
      • 2 - program will be start in normal window and system will not wait when program will be finished
      • 3 - program will be start in hide window and system will wait when program will be finished
      • 4 - program will be start in hide window and system will not wait when program will be finished

      Note: the programs from the autorun will be started during the boot process from "VistaPE Loader" after the default shell is launched and before all the drivers are installed and the network is initialized.

  • AddPostConfig - starts the program after the drivers are installed and the network is initialized. The start will be canceled if the driver setup will be skipped. This function is added in VistaPE v12 beta 2. The command syntax is fully analogous to "AddAutoRun"
  • associate_file - make file associations, example: "associate_file,doc" (registry will be mounted automatically)
  • hive_load - mount all registry files, example: "hive_load,HKU"
  • hive_unload - unmount all registry files, example: "hive_unload,HKU"
  • Add_Asso - make file associations, example: "Add_Asso,doc" (registry will NOT be mounted automatically, it's more faster than associate_file when using many commands
  • reg_add - adds entries in the register (must be mounted first), example: reg_add,0x1,"%reg%\Classes\filetype","test","1"
  • CopyDrv - internal command for easier work with the standard drivers, for example: "CopyDrv,acpi.inf_c947c6d1". Added in VistaPE v12 beta 1
  • RegAddBoot - during the boot process VistaPE can add/modify registry settings, it's requested for correction path to the programs. The command syntax is fully analogous to "RegWrite" command of WinBuilder. For example: "RegAddBoot,"HKLM",0x1,"SOFTWARE\Classes\expandfile\shell\uniextract\command","","%PE_Programs%\Universal Extractor\uniextract.exe %1"
  • AddToPEShell - add the program to the shell's list and select default shell, syntax: "AddToPEShell,Program Name,path_to.exe,True" (if last parameter set to "True", the program will be used as default shell), example: "AddToPEShell,%ProgramTitle%"

Contents

Description of [Interface]

  1. pFileBox1 - path to folder with program (used as a option for CopyProgram command)
  2. pTextLabel1 - label for pFileBox1
  3. pCheckBox1 - destination settings (used as a option for RunFromRam command)
    • True (selected) - program will be copied to the folder "Program Files" and will be placed in RAM if "vistape.wim" is used. All will be work more faster and you can change media during system work, but you need very many system memory with this method.
    • False (not selected) - programs will be copied to the folder "Programs" and will be placed directly to media, it's request less memory but working not so fast and you can not change media when program is running and can not write to program folder.

Contents

Global variables

  • %RegSoftware% (or %HIVE_HKU%) - registry hive with program settings (%VistaTemp%\windows\system32\config\software)
  • %RegSystem% (or %HIVE_HKLM%) - registry hive with system settings (%VistaTemp%\windows\system32\config\system)
  • %RegUser% (or %RegDefault%, or %HIVE_HKCU%) - registry hive with user settings (%VistaTemp%\windows\system32\config\default)
  • %HIVE_BASE% - root for mounting registry hives
  • %reg_temp% - name of folder for mounting registry (wb-hive)
  • %reg%\ - used to simplify work with the registry (always %reg_temp%\)
  • %VistaInfo% - file with setting for VistaPE and source (%ProjectDir%\script.project)
  • %BootSRC% - mount point for vistape.wim (%BaseDir%\BootWimSrc)
  • %InstallSRC% - mount point for install.wim (%BaseDir%\InstallWimSrc)
  • %API% - file with API functions (%ProjectDir%\api.script)
  • %LocaleScript% - file with locale functions (%ProjectDir%\locale.script)
  • %Target_Prog% - target folder for all programs, used with files operation and creating shortcuts (Programs - by default all programs will be placed at media)
  • %PE_Programs% - full path to program folder at target media, used only for shortcuts (!CD\Programs - by default all programs will be placed at media)
  • %AutoStartMode% - default parameters for program window in autorun (1 - program will be start in normal window and system will be wait when program will be finished before start next program)
  • %AutoStartParameters% - default parameters for starting program in autorun (is not recommended set this anything)
  • %VPE_CFG% - file with VistaPE settings (vistape.cfg), can be placed in "windows\system32" folder or in root folder on any disks.

Contents

Description of vistape.cfg format

The file named vistape.cfg is to store the settings of VistaPE, autorun, shortcuts, postconfig etc. This file is processed by "VistaPE Loader" while loading the system. Firstly the settings are being loaded from "x:\windows\system32\vistape.cfg", then the configuration file is being searched on all the available disks. While the system is booted, VistaPE loader is scanning for new removable media, detecting the new vistape.cfg files and rebuilding schortcuts.

Example:

[main]
screen=800x600
defaultshell=BS Explorer

[shortcut]
Archivators|7-zip|%SystemDrive%\Program Files\7-zip\7zfm.exe||
System|BGInfo|%SystemDrive%\Program Files\BGInfo\Bginfo.exe||
Security\WindowsGate|After WindowsGate in Vista|%SystemDrive%\Program Files\WindowsGate\After Wingate in Vista.txt||
Security\WindowsGate|WindowsGate|%SystemDrive%\Program Files\WindowsGate\WindowsGate.exe||
System Information|Unknown Devices|%SystemDrive%\Program Files\UnknownDevices\UnknownDevices.exe||
QuickLaunch|Total Commander|%SystemDrive%\Program Files\totalcmd\totalcmd.exe||
Desktop|Total Commander|%SystemDrive%\Program Files\totalcmd\totalcmd.exe||
|Total Commander|%SystemDrive%\Program Files\totalcmd\totalcmd.exe||
System|Ruslat|%SystemRoot%\System32\ruslat.exe||
QuickLaunch|PENetCfg|%SystemDrive%\Program Files\penetcfg\PENetCfg.exe||
Network|PENetCfg|%SystemDrive%\Program Files\penetcfg\PENetCfg.exe||
Administrative Tools|Disk Management|%SystemRoot%\System32\mmc.exe||/b %SystemRoot%\System32\diskmgmt.msc
Administrative Tools|Computer Management|%SystemRoot%\System32\mmc.exe||/b %SystemRoot%\System32\compmgmt.msc
Network|Map Network Drive|%systemroot%\System32\rundll32.exe|%SystemDrive%\Program Files\Icons\networkhdd.ico|shell32.dll,SHHelpShortcuts_RunDLL Connect
System|Ext3 Installable|X:\Windows\system32\IfsDrives.cpl||
Disk Tools|Disk Partitioner|%SystemDrive%\Program Files\DiskPartitioner\DiskPartitioner.exe||
System|Device Manager|%SystemRoot%\system32\DevMan.exe||

[autorun]
wait|BGInfo|%SystemDrive%\Program Files\BGInfo\runBGinfo.exe
nowait|Ruslat|%SystemRoot%\System32\ruslat.exe
hidewait|IfsDrives|x:\windows\system32\net.exe start "IfsDrives"
hidewait|Ext2fs|x:\windows\system32\net.exe start "Ext2fs"

[registry]
"HKLM",0x1,"SOFTWARE\Classes\Drive\shellex\DragDropHandlers\7-Zip","","{23170F69-40C1-278A-1000-000100020000}"
"HKLM",0x1,"SOFTWARE\Classes\Directory\shellex\DragDropHandlers\7-Zip","","{23170F69-40C1-278A-1000-000100020000}"
"HKLM",0x1,"SOFTWARE\Classes\Directory\shellex\ContextMenuHandlers\7-Zip","","{23170F69-40C1-278A-1000-000100020000}"
"HKLM",0x1,"SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32","ThreadingModel","Apartment"
"HKLM",0x1,"SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32","","%SystemDrive%\Program Files\7-zip\7-zip.dll"
"HKLM",0x1,"SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}","","7-Zip Shell Extension"
"HKLM",0x1,"SOFTWARE\Classes\*\shellex\ContextMenuHandlers\7-ZIP","","{23170F69-40C1-278A-1000-000100020000}"
"HKCR",0x1,"Folder\shell\Explore From Here\command","","explorer.exe ""%1"""
"HKCR",0x1,"AllFilesystemObjects\shellex\ContextMenuHandlers\MoveToMenu","","{C2FBB631-2971-11D1-A18C-00C04FD75D13}"
"HKCR",0x1,"AllFilesystemObjects\shellex\ContextMenuHandlers\CopyToMenu","","{C2FBB630-2971-11D1-A18C-00C04FD75D13}"

[association]
zip,%SystemDrive%\Program Files\7-zip\7zfm.exe
z,%SystemDrive%\Program Files\7-zip\7zfm.exe
wim,%SystemDrive%\Program Files\7-zip\7zfm.exe
tpz,%SystemDrive%\Program Files\7-zip\7zfm.exe
tgz,%SystemDrive%\Program Files\7-zip\7zfm.exe
tbz2,%SystemDrive%\Program Files\7-zip\7zfm.exe
tbz,%SystemDrive%\Program Files\7-zip\7zfm.exe
taz,%SystemDrive%\Program Files\7-zip\7zfm.exe
tar,%SystemDrive%\Program Files\7-zip\7zfm.exe
swm,%SystemDrive%\Program Files\7-zip\7zfm.exe
split,%SystemDrive%\Program Files\7-zip\7zfm.exe
rpm,%SystemDrive%\Program Files\7-zip\7zfm.exe
rar,%SystemDrive%\Program Files\7-zip\7zfm.exe
lzh,%SystemDrive%\Program Files\7-zip\7zfm.exe
lha,%SystemDrive%\Program Files\7-zip\7zfm.exe
iso,%SystemDrive%\Program Files\7-zip\7zfm.exe
gzip,%SystemDrive%\Program Files\7-zip\7zfm.exe
gz,%SystemDrive%\Program Files\7-zip\7zfm.exe
deb,%SystemDrive%\Program Files\7-zip\7zfm.exe
cpio,%SystemDrive%\Program Files\7-zip\7zfm.exe
cab,%SystemDrive%\Program Files\7-zip\7zfm.exe
bzip2,%SystemDrive%\Program Files\7-zip\7zfm.exe
bz2,%SystemDrive%\Program Files\7-zip\7zfm.exe
arj,%SystemDrive%\Program Files\7-zip\7zfm.exe
7z,%SystemDrive%\Program Files\7-zip\7zfm.exe

[shells]
Total Commander|totalcmd\totalcmd.exe
Explorer|%SystemDrive%\Windows\explorer.exe
BS Explorer|BSExplorer\Explorer.exe

[postconfig]
hidewait|Virtual Machine Additions Shared Folder Service|x:\windows\system32\net.exe start "Virtual Machine Additions Shared Folder Service"
hidewait|Virtual Machine Additions Services Application|x:\windows\system32\net.exe start "Virtual Machine Additions Services Application"
hidewait|Human Interface Device Access|x:\windows\system32\net.exe start "hidserv"
hidewait|Computer Browser|x:\windows\system32\net.exe start "Browser"
hidewait|User Profile Service|x:\windows\system32\net.exe start "ProfSvc"
hidewait|Server|x:\windows\system32\net.exe start "LanmanServer"
hidewait|DNS Client|x:\windows\system32\net.exe start "Dnscache"

Description of section [main]:

Here the general settings of VistaPE are stored

  • screen - resolution, for example: "800x600"; if the value is "optimal", the system tries to define the optimal value itself.
  • defaultshell - the name of the shell by default

Description of section [shells]:

Here is the description of every shell's settings. Syntax is "Program name|Path and options of launching", for example: "Explorer|%SystemDrive%\Windows\explorer.exe"

Description of section [shortcut]:

Here is the description of every program's shortcuts settings. Syntax is "Group|Name|Program|Shortcut|Options", for example: "Network|Map Network Drive|%systemroot%\System32\rundll32.exe|%SystemDrive%\Program Files\Icons\networkhdd.ico|shell32.dll,SHHelpShortcuts_RunDLL Connect".

The detailed description of the values:

  1. group - the name of the group for programs' shortcuts in "Start" menu, if the value is "Desktop" ("DS") or "QuickLaunch" ("QL") shortcuts will be placed in Desktop or QuickLaunch.
  2. name - full program name.
  3. program - the full or relative path to the program executable.
  4. shortcut - the path to the shortcut icon (not required).
  5. options - the options of program launching (may be absent).

Description of section [registry]:

Changing of registry settings, the syntax has full analogy to "RegWrite" command in WinBuilder.

Description of section [association]:

The files' association settings. Syntax is Extension,The path to the program", example: "7z,%SystemDrive%\Program Files\7-zip\7zfm.exe".

Description of section [autorun]:

Programs for autorun, starts immediately after the default shell is launched and before the drivers are installed and network initialized. For example: "hidewait|Ext2fs|x:\windows\system32\net.exe start "Ext2fs"".

The option contains three sections:

  1. Start option:
    • wait - the program is launched in the standard window, before continue the job shutdown is waited for
    • nowait - stabdart window, not waiting for the shutdown
    • hidewait - hidden mode, waiting for the shutdown
    • hidenowait - hidden mode, not waiting for the shutdown
  2. Program name
  3. Program path and parameters

Description of section [postconfig]:

Here is the description of programs that will be launched after the configuration of all the drivers is done and the network initialized. The syntax has full analogy to the section "autorun"

Note:

  1. It is not recommended to edit vistape.cfg directly, t here is an appropriate API command for everything.
  2. The number of shells is limited by 14.
  3. The path to any program may be full "x:\widows\system32\notepad.exe", or relative as well "totalcmd\totalcmd.exe", also it can contain the modifiers "%SystemDrive%\Program Files\7-zip\7zfm.exe"
    • When the path is relative, the program is being searched in the root directory of the media, then in "Programs" folder, then "Program files", then "x:\Program Files" and "x:\Programs". If nothing is found the process is finished.
    • Possible modifiers of the path to the program:
      • %CDDrive% - The letter of the disk where the program is
      • %SystemDrive% - always "X:"
      • %SystemRoot% - "X:\Windows"
      • !S32 - "X:\Windows\System32"
      • !PFC - "%CDDrive%\Program Files"
      • !PF - "X:\Program Files"
      • !PDC - "%CDDrive%\Programs
      • !PD - "X:\Programs"
      • !CD - %CDDrive%
      • !WD - %SystemRoot%

Contents

Recommendations for creating scripts

  1. Check program compatibility with VistaPE before creating script.
  2. Always, whenever possible, use the API functions.
  3. Read documentation for WinBuilder.
  4. After creating and testing a script, to share their achievements at the forum VistaPE, thus you make a huge contribution to the project to help others in writing scripts and honor support other users to optimize and improve your script.
Copyright © 2007—2008 NightMan. All rights reserved.
If copying the information, the reference is required.


LiveXP

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • Change log

Overview

LiveXP is a project intended to create a bootable disc with some of the functionality available to a regular OS installation. It is based on nativeEX and includes some customizations to make it a boot disk for everyday use.

Description of the included scripts can be found here: http://updates.boot-land.net

The major advantage of this project is the ability of the explorer shell in a reduced sized ISO image with practical customizations.

You can find support for this project on the respective discussion forum: http://www.boot-land.net/forums/nativeEx-and-LiveXP-f52.html

Also worth trying are other similar wb projects for XP environments
  • nativeEx
  • nativePE

Compatibility

This project can be used under Windows 2000 and above. Under Windows Vista you will need to disable the UAC (User Account Control) to allow the creation of needed registry hives - not tested under Win9x but should also work.

You can include scripts that come from the nativeEx and NativePE projects or were created using API scripting.

To build a bootable disc you will need to use a Microsoft Windows XP Install Disc. The type of XP (home, professional) is not relevant but we recommend always using a retail or corporate version of XP with SP2 included.

As an alternative you can use regular Windows XP, without SP or SP1, or Windows 2003.

If you don't have a satisfatory CD to use as souce then you should download a free trial version of Windows 2003 from the Microsoft site and use this image to build your project (only the first image is needed to download - around 500Mb).

Usage

You only need to tell the project where to find the needed files to copy from the source.

We recommend that you copy all your files from the CD onto a folder on disk and use this folder as source before following the below usage details.

  • Click on Play (big blue triangle)
  • You will be prompted to enter a valid source before continuing - click on the open folder button and select the folder where your source files are placed.

The used source only needs to be inputed once or changed whenever you wish to use another source. To manually change the used source you can always click on the "Paths" tab found on the main window next to the "Script" tab.

Don't forget that most scripts also have options to customize it's defintions. This is usefull is you wish to change the screen display settings or disable features you don't want.

Bugs

When posting for bugs related to this project please include the following details:

  • log.html (click on save log from the "Log" after running the project)
  • Version of WinBuilder (including beta number if available)
  • Type of partition where the project is built (FAT32 or NTFS)
  • Active antivirus or spyware protection
  • Steps to reproduce the bug

If you run a project and it won't work as you expect, then you should click on the log tab for more information. The log will display where an error has occurred.

It is very important that you upload this log.html when reporting a bug on the forums related to the project. This file contains details which help us understand the conditions under which the project was built. This file is usually sized around 1Mb - 2Mb, but it can be compressed by any popular archiver (7zip, winrar, winzip, etc) to a compressed file sized of about 20Kb.

When posting a message or reporting a bug, please try searching the previous posts for similar reported problems. In most cases if a solution has already been found, it will have been posted. This can save everyone a lot of time when looking for answers.

Change log

This project uses nativeEX as base - please look on the respective project page for more informations.

Please let us know if this page is not complete or if you still haven't found needed information.


MobileOS

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • Change log

Overview

MobileOS is a project intended to create a full version of Windows XP that boots and runs from RAM and is suited to be booted from a USB drive.

Discussion and Feedback topic: http://www.boot-land.net/forums/MobileOS-t1218.html

Compatibility

There are no compatibility issues since most of the work is done using a PC emulator (qemu).

Usage

Version 008
You need in following collection files ( look ) :

Microsoft® Windows® XP
- installation CD
Microsoft® Windows® Server 2003 SP1
- ramdisk.sys
- ntldr
Microsoft® Windows® XP Embedded
- minlogon.exe

QEMU on Windows Version 0.9.0 Fabrice Bellard http://www.h7.dion.ne.jp/~qemu-win/
Section "Accelerators"
- qemu.exe
- fmod.dll
- SDL.dll
- qemu-img.exe
- bios.bin
- vgabios.bin
Virtual Disk Driver Ken Kato http://chitchat.at.infoseek.co.jp/vmware/vdk.html
- vdk.exe
- vdk.sys
7-Zip 4.46 beta © Igor Pavlov http://www.7-zip.org
- 7z.exe
- 7z.dll
dd for windows John Newbigin http://www.chrysocome.net/dd
- dd.exe
Standard utility
- mkisofs.exe
- ConvAscii.exe paraglider http://www.paraglidernc.com/utilities/convascii.htm

Optional:
- cfadisk.sys http://www.911cd.net/forums//index.php?showtopic=14181

WinBuilder 071 beta 2

Antivirus, explorer(user) etc. should not interfere in work virtual machine (Qemu)

Web server - http://mobileos.boot-land.net

Please let us know if this page is not complete or if you still haven't found needed information.


NativePE

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • Change log

Overview

NativePE is a project customized by thunn and based on nativeEx.

This project aims at extreme customization adding all sort of scripts and programs to give it an edgier look. Inside the download server resides, avast! Antivirus, Firefox browser, and a few other popular programs. By default a dual-boot image is created with normal and inram boot options.

Compatibility

This project can be used under Windows 2000 and above. Under Windows Vista you will need to disable the UAC (User Account Control) to allow the creation of needed registry hives.

Currently under Windows 2000, the 'Create BcdwPE' script (Bootable CD Wizard) should not be selected.

You can also use scripts that come from the nativeEx and NativePE projects.

To build a bootable disc you will need to use a Microsoft Windows XP Install Disc. The type of XP (home, professional) is not relevant but we recommend always using a retail or corporate version of XP with SP2 included (no hotfixes).

As an alternative you can use regular Windows XP, without SP or SP1, or Windows 2003.

If you don't have a satisfatory CD to use as souce then you should download a free trial version of Windows 2003 from the Microsoft site and use this image to build your project (only the first image is needed to download - around 500Mb). Please note, for this project, Windows Server 2003 is not recommended as a source.

Usage

You only need to tell the project where to find the needed files to copy from the source.

We recommend that you copy all your files from the CD to a folder on disk and use this folder as source before following the below usage details.

  • Click on Play (big blue triangle)
  • You will be prompted to enter a valid source before continuing - click on the open folder button and select the folder where your source files are placed.

The project source only needs to be inputed once or changed whenever you wish to use another source. To manually change the source you can always click on the "Paths" tab found on the main window next to the "Script" tab.

Don't forget that most scripts also have configuration options for the user. This is usefull if you wish to change the screen display settings or disable features you don't want.
You only need to tell the project where to find the needed files to copy from the source.

Bugs

When posting for bugs related to this project please include the following details:

  • log.html (click on save log from the "Log" after running the project)
  • Version of WinBuilder (including beta number if available)
  • Type of partition where the project is built (FAT32 or NTFS)
  • Active antivirus or spyware protection
  • Steps to reproduce the bug

If you run a project and it won't work as you expect, then you should click on the log tab for more information. The log will display where an error has occurred.

It is very important that you upload this log.html when reporting a bug on the forums related to the project. This file contains details which help us understand the conditions under which the project was built. This file is usually sized around 1Mb - 2Mb, but it can be compressed by any popular archiver (7zip, winrar, winzip, etc) to a compressed file sized of about 20Kb.

When posting a message or reporting a bug, please try searching the previous posts for similar reported problems. In most cases if a solution has already been found, it will have been posted. This can save everyone a lot of time when looking for answers.

Change log

Recent changes are detailed at boot-land.net here.

This project uses nativeEX as base, please look at the respective project page for more information.

Please let us know if this page is not complete or if you still haven't found needed information.


nativeEx

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • Change log

Overview

nativeEx is a project that will build your boot disk from a Microsoft Windows XP Install CD.

The boot disk will attempt to use all languages strings available from the XP source, hense the project prefix "native".

This project is used as base for other projects like LiveXP and nativePE, the difference is that it is intended to be a very minimal, barebones only, adding the minimum needed to have an efficient system.

It is ideal for situations where a small sized (31Mb up to 50Mb) disk is required and is also updated very frequentely since it is used as base for testing with new features from wb.

You can find support and newer developments on the respective discussion forum here: http://www.boot-land.net/forums/nativeEx-and-LiveXP-f52.html

Compatibility

This project can be used under Windows 2000 and above. Under Windows Vista you will need to disable the UAC (User Account Control) to allow the creation of needed registry hives.

You can also use scripts that come from the LiveXP and NativePE projects.

To build a bootable disc you will need to use a Microsoft Windows XP Install Disc. The type of XP (home, professional) is not relevant but we recommend always using a retail or corporate version of XP with SP2 included.

As an alternative you can use regular Windows XP, without SP or SP1, or Windows 2003.

If you don't have a satisfatory CD to use as souce then you should download a free trial version of Windows 2003 from the Microsoft site and use this image to build your project (only the first image is needed to download - around 500Mb).

Usage

You only need to tell the project where to find the needed files to copy from the source.

We recommend that you copy all your files from the CD to a folder on disk and use this folder as source before following the below usage details.

  • Click on Play (big blue triangle)
  • You will be prompted to enter a valid source before continuing - click on the open folder button and select the folder where your source files are placed.

The used source only needs to be inputed once or changed whenever you wish to use another source. To manually change the used source you can always click on the "Paths" tab found on the main window next to the "Script" tab.

Don't forget that most scripts also have options to customize it's defintions. This is usefull is you wish to change the screen display settings or disable features you don't want.

Bugs

When posting for bugs related to this project please include the following details:

  • log.html (click on save log from the "Log" after running the project)
  • Version of WinBuilder (including beta number if available)
  • Type of partition where the project is built (FAT32 or NTFS)
  • Active antivirus or Spyware protection
  • Steps to reproduce the bug

If you run a project and it won't work as you expect, then you should click on the log tab for more information. The log will display where an error has occurred.

It is very important that you upload this log.html when reporting a bug on the forums related to the project. This file contains details which help us understand the conditions under which the project was built. This file is usually sized around 1Mb - 2Mb, but it can be compressed by any popular archiver (7zip, winrar, winzip, etc) to a compressed file sized of about 20Kb.

When posting a message or reporting a bug, please try searching the previous posts for similar reported problems. In most cases if a solution has already been found, it will have been posted. This can save everyone a lot of time when looking for answers.

Change log

You may find more information here:

http://www.boot-land.net/forums/nativeEx-and-LiveXP-f52.html

Please let us know if this page is not complete or if you still haven't found needed information.


PicoXP

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • Change log

Overview

The main goal of this project is to achieve the smallest possible boot disk based on the XP Operating System. This goal has been achieved with a project that produces a 13 Mb. XP boot disk with a command line shell.

PicoXP is designed to replace old DOS based boot disks which lack support for SATA harddisks and NTFS partitions. The boot time is extremely reduced since it loads few services and no excessive drivers.
There is no support for GUI applications.

This project was originally developed under the name of nanoXP and is now designated as PicoXP.

Compatibility

No GUI programs are supported, please request help on the forums if you want further information on how to add compatibility for your programs.

This project can be used under Windows 2000 and above. Under Windows Vista you will need to disable the UAC (User Account Control) to allow the creation of needed registry hives.

To build a bootable disc you will need to use a Microsoft Windows XP Install Disc. The type of XP (home, professional) is not relevant but we recommend always using a retail or corporate version of XP with SP2 included.

As an alternative you can use regular Windows XP, without SP or SP1, or Windows 2003.

If you don't have a satisfatory CD to use as souce then you should download a free trial version of Windows 2003 from the Microsoft site and use this image to build your project (only the first image is needed to download - around 500Mb).

Usage

You only need to tell the project where to find the needed files to copy from the source.

We recommend that you copy all your files from the CD to a folder on disk and use this folder as source before following the below usage details.

  • Click on Play (big blue triangle)
  • You will be prompted to enter a valid source before continuing - click on the open folder button and select the folder where your source files are placed.

The project source only needs to be inputed once or changed whenever you wish to use another source. To manually change the source you can always click on the "Paths" tab found on the main window next to the "Script" tab.

Don't forget that most scripts also have configuration options for the user. This is usefull if you wish to change the screen display settings or disable features you don't want.

Bugs

When posting for bugs related to this project please include the following details:

  • log.html (click on save log from the "Log" after running the project)
  • Version of WinBuilder (including beta number if available)
  • Type of partition where the project is built (FAT32 or NTFS)
  • Active antivirus or spyware protection
  • Steps to reproduce the bug

If you run a project and it won't work as you expect, then you should click on the log tab for more information. The log will display where an error has occurred.

It is very important that you upload this log.html when reporting a bug on the forums related to the project. This file contains details which help us understand the conditions under which the project was built. This file is usually sized around 1Mb - 2Mb, but it can be compressed by any popular archiver (7zip, winrar, winzip, etc) to a compressed file sized of about 20Kb.

When posting a message or reporting a bug, please try searching the previous posts for similar reported problems. In most cases if a solution has already been found, it will have been posted. This can save everyone a lot of time when looking for answers.

Please let us know if this page is not complete or if you still haven't found needed information.


ReactOS

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • Change log

Overview

ReactOS® is an advanced free open source operating system providing a ground-up implementation of a Microsoft Windows® XP compatible operating system. ReactOS aims to achieve complete binary compatibility with both applications and device drivers meant for NT and XP operating systems, by using a similar architecture and providing a complete and equivalent public interface.

ReactOS is the most complete working model of a Windows® like operating system available. Consequently, working programmers will learn a great deal by studying ReactOS source code and even participating in ReactOS development.

ReactOS has and will continue to incorporating features from newer versions and sometimes even define the state of the art in operating system technology.

In short, ReactOS is aiming to run your applications and use your hardware, a free operating system for everyone!

Please bear in mind that ReactOS 0.3.1 is still in alpha stage, meaning it is not feature complete and is not recommended for everyday use.

Discussion forum: http://www.boot-land.net/forums/Development-f7.html

Compatibility

You can run this project from Windows 98 and above. This project is not restricted by Windows Vista UAC (User Account Control)

An internet connection will be needed for the first time that this project is executed to allow downloading the needed binaries (around 8Mb)

Usage

Press the Play button (blue triangle)

No other configuration is needed, you can also modify or add your scripts as needed to change settings.

Bugs

At the moment no bugs were reported, there is the limitation that this OS can only acess FAT32 partitions - no support for NTFS was yet added up to this point.

Change log

Please let us know if this page is not complete or in case you still haven't found the needed information.


VistaPE

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • FAQ
  • Change log

Overview

VistaPE is built to be a simple and flexible tool for System Administrators and advanced users. VistaPE can be loaded on a regular or crashed system. It allows the user to get full access to all disks in order to restore data, check for viruses, fix system boot problems, or transfer data over via network and the Internet.

This project is meant to be a universal tool with the flexibility to grow with your needs.

VistaPE is created as a project (set of scripts) for WinBuilder. You are free to customize it in any way you want. All you need for this project is a licenced copy of Microsoft Windows Vista (any edition) or the free download of the Windows Automated Installation Kit (WAIK).

Main Functionality
  1. support for a big number of SATA/RAID/SCSI/NIC drivers
  2. capable to read and write on NTFS/FAT32/FAT partitions
  3. full support for networking
  4. automatic definition of hardware devices
  5. booting from WIM images
  6. booting from CD/HDD/UFD/Network
  7. compatibility with Microsoft Windows Vista
  8. no uptime and starting processes limits

Compatibility

  1. You will need Microsoft Windows Vista DVD or installed Windows Automated Installation Kit (WAIK) to create a working VistaPE. To make things convenient and let WinBuilder run faster we recommend you to copy the content of the DVD disk to the hard drive. You can create only basic builds with WAIK, it does not include Windows explorer.
  2. VistaPE requires at least 256Mb of RAM (though we recommend 512Mb)
  3. About 2Gb of free space on hard disk will be needed during the creating process.
  4. This project only runs from NTFS partitions to allow handling WIM images.

Usage

Important building steps
  1. Open the second tab in WinBuilder marked "Path" and browse to the folder containing the Windows Vista or WAIK files (Source directory).
  2. Click on the "Play" button to start Building "VistaPE".

More detailed information about this project and its internal functions can be found on this page: How it works?.

Note about virtual computers

Running VistaPE on VMWare has some known issues. For better results it is recommended to use VirtualBox, VirtualPC or test VistaPE builds on a real computer.

Bugs

VistaPE needs to mount WIM files with write permission. This is only possible running this winbuilder project from an NTFS partition.

Some users also reported success after using a shorter pathname for their winbuilder folder, such as C:\WinBuilder or C:\VistaPE.
Eliminating spaces from folder paths may also assist in debugging.

FAQ

Q: How to start networking support?
A: "Wpeinit.exe" is used to find the network adapter and start networking support. If a network adapter is found, networking support will start automatically.

Q: How to configure a static IP address?
A: You can configure network settings with the latest PENetCfg

Q: VistaPE doesn't load using VMWare (sometimes).
A: VMWare support for Windows Vista is experimental right now and there are some issues with loading VistaPE using VMWare. For better results it is recommended to use InnoTek VirtualBox, Microsoft VirtualPC or test VistaPE builds on a real computer. It is also not possible to load VistaPE using Qemu at the moment.

Q: VistaPE doesn't load using Qemu.
A: It is not possible to load VistaPE using Qemu at the moment.

Q: Error loading winload.exe
A: This error is most probably induced by mistakes in building process. Check for errors while running WinBuilder in the log.

If you still have any questions, you are welcome to search for answers in our Forum.

Change log

Version 008 update 2 - 20.04.2007

  1. "Copy Files"
  2. "Shell & Config"
  3. "Xchm 1.9"
  4. "FOXIT PDF Reader"

Version 008 update 1 - 10.04.2007

  1. fixed WimUtil problem
  2. fixed VirtualBox script
  3. Infra Recorder updated
  4. new wallpaper

Version 008 - 02.04.2007

  1. fixed network support
  2. network configuration (PENetCFG)
  3. faster booting process
  4. small fix for shortcut
  5. WSH/MDAC/HTA/WMI/XML support
  6. WinBuilder 068 compatibility
  7. other small fixes and updates for program

Version 007 – 23.02.2007

  1. All base scripts were rewritten
  2. You can choose between “wimutil” and “imagex” (request installed WAIK)
  3. Support for x64 hosts (only with “imagex”) for building. You can build only x86 version, x64 planed only when we will be have more program for this platform.
  4. Configuration for FBWF driver (now default free disk space on disk X: is 64Mb)
  5. Automatically creating shortcut for Explorer, LiteStep and BS Explorer
  6. Default shell is LiteStep, BS Explorer is not supported now and will be removed in next version
  7. Some changes in variables:
    • %VistaTemp% - deleted (use %TargetDir%)
    • %BootSRC% - mount point for boot.wim (%BaseDir%\BootWimSrc)
    • %VistaInfo% - mount point for install.wim (%BaseDir%\InstallWimSrc)
    • %ES% - shortcut for program (%TargetDir%\windows\system32\shortcut.inf)
    • %VistaInfo% - VistaPE configuration and settings (%ProjectDir%\script.project)
  8. Add many new programs

Version 006 RC5 – 02.02.2007

  1. Add “winutil.exe” – free replacement for “imagex.exe” – now builder is is fully independent and legal
  2. Explorer and MMC
  3. Support for localized distributions
  4. Support WAIK as source (not for all scripts)
  5. Automatic detect source (WAIK or Windows Vista CD)
  6. Transition from model “deleting of undue” to model “copying of necessary”
  7. Set English as default language
  8. Possibility change source directory for all scripts with programs
  9. All programs can run both from memory (boot.wim) and from disc
  10. Support of multi boot – just rename and place necessary boot file as “%TargetDir%\boosect.bin”
  11. Grub4Dos as boot manager
  12. “programs.wim” was disabled - WIM driver works unstable in VistaPE
  13. Possibility of running “WPEinit” in background mode
  14. Configuration for screen resolution
  15. “standard” and “full” methods of building – first is equivalent to 005 version in entry-level configuration, second copies all content of boom.wim or winpe.wim (depending on source)
  16. Equalization of systems and programs, lots of new scripts and many others

Please let us know if this page is not complete or in case you still haven't found the needed information.


VistaPE-CAPI

VistaPE Common API

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • FAQ
  • Change log

Overview

VistaPE-CAPI is built to be a simple and flexible tool for System Administrators and advanced users. VistaPE can be loaded on a regular or crashed system. It allows the user to get full access to all disks in order to restore data, check for viruses, fix system boot problems, or transfer data over via network and the Internet.

This project is meant to be a universal tool with the flexibility to grow with your needs.

VistaPE-CAPI is created as a project (set of scripts) for WinBuilder. You are free to customize it in any way you want. All you need for this project is a licenced copy of Microsoft Windows Vista (any edition) or the free download of the Windows Automated Installation Kit (WAIK). This version is an updated version of the original Nightman VistaPE updated to work with the common API. It is also actively developed where as the original Nighman version has not been updated since late 2008.

Main Functionality
  1. support for a big number of SATA/RAID/SCSI/NIC drivers
  2. capable to read and write on NTFS/FAT32/FAT partitions
  3. full support for networking
  4. automatic definition of hardware devices
  5. booting from WIM images
  6. booting from CD/HDD/UFD/Network
  7. compatibility with Microsoft Windows Vista
  8. no uptime and starting processes limits

Compatibility

  1. For the build source you will need a Microsoft Windows Vista DVD or installed Windows Automated Installation Kit (WAIK) to create a working VistaPE. To make things convenient and let WinBuilder it's recommended that you to copy the content of the DVD disk to the hard drive. You can create only basic builds with WAIK, it does not include Windows explorer.
  2. An installed copy of the Windows Automated Installation Kit (WAIK) is required to provide the tools for mounting and creating WIM files and to inject additional drivers.
  3. VistaPE requires at least 256Mb of RAM (though we recommend 512Mb)
  4. About 2Gb of free space on hard disk will be needed during the creating process.
  5. This project only runs from NTFS partitions to allow handling WIM images.

Usage

Important building steps
  1. Download the VistaPE-CAPI project. This is done by adding the vistape.winbuilder.net to the available servers on the winbuilder download page.
  2. Open the second tab in WinBuilder marked "Source" and browse to the folder containing the Windows Vista or WAIK files (Source directory).
  3. If the WAIK is not installed to the default location then select the Base \ Preconfig script and update the the path to the installed WAIK. Note even if the WAIK was selected in the previous step this is still necessary if the WAIK is not installed to the default location.
  4. Click on the "Play" button to start Building "VistaPE-CAPI".

More detailed information about this project and its internal functions can be found on this page: How it works?.

Note about virtual computers

For better results it is recommended to use the free VMware Player / VMWare workstation, Sun VirtualBox, Microsoft VirtualPC or test VistaPE builds on a real computer.

Bugs

VistaPE-CAPI needs to mount WIM files with write permission. This is only possible running this winbuilder project from an NTFS partition.

Some users also reported success after using a shorter pathname for their winbuilder folder, such as C:\WinBuilder or C:\VistaPE.
Eliminating spaces from folder paths may also assist in debugging.

FAQ

Q: How to start networking support?
A: "Wpeinit.exe" is used to find the network adapter and start networking support. If a network adapter is found, networking support will start automatically.

Q: How to configure a static IP address?
A: You can configure network settings with the latest PENetCfg

Q: VistaPE doesn't load using Qemu.
A: It is not possible to load VistaPE using Qemu at the moment.

Q: Error loading winload.exe
A: This error is most probably induced by mistakes in building process. Check for errors while running WinBuilder in the log.

If you still have any questions, you are welcome to search for answers in our Forum.

Please let us know if this page is not complete or in case you still haven't found the needed information.


Win7PE

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • FAQ
  • Change log

Overview

Win7PE is built to be a simple and flexible tool for System Administrators and advanced users. Win7PE can be loaded on a regular or crashed system. It allows the user to get full access to all disks in order to restore data, check for viruses, fix system boot problems, or transfer data over via network and the Internet.

This project is meant to be a universal tool with the flexibility to grow with your needs.

Win7PE is created as a project (set of scripts) for WinBuilder. You are free to customize it in any way you want. All you need for this project is a licenced copy of Microsoft Windows 7 (any edition) or the free download of the Windows Automated Installation Kit (WAIK).

Main Functionality
  1. support for a big number of SATA/RAID/SCSI/NIC drivers
  2. capable to read and write on NTFS/FAT32/FAT partitions
  3. full support for networking
  4. automatic definition of hardware devices
  5. booting from WIM images
  6. booting from CD/HDD/UFD/Network
  7. compatibility with Microsoft Windows Vista
  8. no uptime and starting processes limits

Compatibility

  1. Source machine should be Windows XP sp2 or above.
  2. Winbuilder Version 074 or above.
  3. For the build source you will need a Microsoft Windows 7 DVD or installed Windows Automated Installation Kit (WAIK) to create a working Win7PE. To make things convenient it's recommended that you to copy the content of the DVD disk to the hard drive. You can create only basic builds with WAIK, it does not include Windows explorer.
  4. An installed copy of the Windows Automated Installation Kit (WAIK) is required to provide the tools for mounting and creating WIM files and to inject additional drivers.
  5. Win7PE requires minimum RAM of about 768 Mb, recommended 1 Gb or above
  6. Need Minimum Free HDD space 4gb recommended.(for mount boot.wim and install.wim).
  7. This project only runs from NTFS partitions to allow handling WIM images.
  8. USB 512Mb or above for USB Booting users

Usage

Important building steps
  1. Download the Win7PE project. This is done by adding the win7pe.winbuilder.net/Projects to the available servers on the winbuilder download page.
  2. Open the second tab in WinBuilder marked "Source" and browse to the folder containing the Windows 7 or WAIK files (Source directory).
  3. If the WAIK is not installed to the default location then select the Build \ 0 - Preconfig script and update the the path to the installed WAIK. Note even if the WAIK was selected in the previous step this is still necessary if the WAIK is not installed to the default location.
  4. Click on the "Play" button to start Building "Win7PE".

More detailed information about this project and its internal functions can be found on this page: How it works?.

Note about virtual computers

For better results it is recommended to use the free VMware Player / VMWare workstation, Sun VirtualBox, Microsoft VirtualPC or test VistaPE builds on a real computer.

Bugs

Win7PE needs to mount WIM files with write permission. This is only possible running this winbuilder project from an NTFS partition.

Some users also reported success after using a shorter pathname for their winbuilder folder, such as C:\WinBuilder or C:\Win7PE.
Eliminating spaces from folder paths may also assist in debugging.

FAQ

Q: How to start networking support?
A: Scripts for both PENetwork and PeNetCfg are both included in the Net folder. For further details about PENetwork click the link.

Q: How to configure a static IP address?
A: You can configure network settings with the latest PENetCfg or at build time with the PENetwork script options

Q: Win7PE doesn't load using Qemu.
A: It is not possible to load VistaPE using Qemu at the moment.

Q: Error loading winload.exe
A: This error is most probably induced by mistakes in building process. Check for errors while running WinBuilder in the log.

If you still have any questions, you are welcome to search for answers in our Forum.

Please let us know if this page is not complete or in case you still haven't found the needed information.


Win7RescuePE

Contents

  • Overview
  • Compatibility
  • Usage
  • Bugs
  • FAQ
  • Change log

Overview

Win7RescuePE is built to be a simple and flexible tool for System Administrators and advanced users. Win7PE can be loaded on a regular or crashed system. It allows the user to get full access to all disks in order to restore data, check for viruses, fix system boot problems, or transfer data over via network and the Internet.

This project is meant to be a tool focused at providing rescue capabilities with as small amount of ram usage as possible for a win7 envrionment ( 256Mb ). Unlike other Vista / Win7 projects it boots PE directly from the boot media instead of into ram using a wim file.

Win7RescuePE is created as a project (set of scripts) for WinBuilder. You are free to customize it in any way you want. All you need for this project is a licenced copy of Microsoft Windows 7 (any edition) or the free download of the Windows Automated Installation Kit (WAIK).

Main Functionality
  1. support for a big number of SATA/RAID/SCSI/NIC drivers
  2. capable to read and write on NTFS/FAT32/FAT partitions
  3. full support for networking
  4. automatic definition of hardware devices
  5. booting from CD/HDD/UFD/Network
  6. compatibility with Microsoft Windows Vista
  7. no uptime and starting processes limits

Compatibility

  1. Source machine should be Windows XP sp2 or above.
  2. Winbuilder Version 074 or above.
  3. For the build source you will need a Microsoft Windows 7 DVD or installed Windows Automated Installation Kit (WAIK) to create a working Win7RescuePE. To make things convenient it's recommended that you to copy the content of the DVD disk to the hard drive. You can create only basic builds with WAIK, it does not include Windows explorer.
  4. An installed copy of the Windows Automated Installation Kit (WAIK) is required to provide the tools for mounting and creating WIM files and to inject additional drivers.
  5. Win7RescuePE requires minimum RAM of about 256 Mb at run time.
  6. Need Minimum Free HDD space 4gb recommended.(for mount boot.wim and install.wim).
  7. This project only runs from NTFS partitions to allow handling WIM images.
  8. USB 512Mb or above for USB Booting users

Usage

Important building steps
  1. Download the Win7RescuePE project. This is done by adding the joshua.winbuilder.net/Projects to the available servers on the winbuilder download page.
  2. Open the second tab in WinBuilder marked "Source" and browse to the folder containing the Windows 7 or WAIK files (Source directory).
  3. If the WAIK is not installed to the default location then select the Build \ Preconfig script and update the the path to the installed WAIK. Note even if the WAIK was selected in the previous step this is still necessary if the WAIK is not installed to the default location.
  4. Click on the "Play" button to start Building "Win7RescuePE".

More detailed information about this project and its internal functions can be found on this page: How it works?.

Full building instructions for the Win7RescuePE project can be found as this link.

Note about virtual computers

For better results it is recommended to use the free VMware Player / VMWare workstation, Sun VirtualBox, Microsoft VirtualPC or test Win7RescuePE builds on a real computer.

Bugs

Win7PE needs to mount WIM files with write permission. This is only possible running this winbuilder project from an NTFS partition.

Some users also reported success after using a shorter pathname for their winbuilder folder, such as C:\WinBuilder or C:\Win7RescuePE.
Eliminating spaces from folder paths may also assist in debugging.

FAQ

Q: How to start networking support?
A: A Script for PENetwork is included in the Net folder. For further details about PENetwork click the link.

Q: How to configure a static IP address?
A: You can configure network settings at build time with the PENetwork script options

Q: Win7PE doesn't load using Qemu.
A: It is not possible to load Win7RescuePE using Qemu at the moment.

Q: Error loading winload.exe
A: This error is most probably induced by mistakes in building process. Check for errors while running WinBuilder in the log.

If you still have any questions, you are welcome to search for answers in the Forum thread dedicated to this project.

Please let us know if this page is not complete or in case you still haven't found the needed information.


404 Not Found

Not Found

The requested URL /help/projects/index.html was not found on this server.

Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.5.1 mod_jk/1.2.25 mod_python/3.3.1 Python/2.5.2 PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g mod_perl/2.0.3 Perl/v5.8.8 Server at winbuilder.net Port 80


404 Not Found

Not Found

The requested URL /help/projects/template.html was not found on this server.

Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.5.1 mod_jk/1.2.25 mod_python/3.3.1 Python/2.5.2 PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g mod_perl/2.0.3 Perl/v5.8.8 Server at winbuilder.net Port 80


404 Not Found

Not Found

The requested URL /help/scripts/script_api.html was not found on this server.

Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.5.1 mod_jk/1.2.25 mod_python/3.3.1 Python/2.5.2 PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g mod_perl/2.0.3 Perl/v5.8.8 Server at winbuilder.net Port 80