Skip to content

Create a new script

The following is a description of how to create a new script in CapaInstaller OSD.

Step Action
1 Click File menu, click New and then _Create new script_.
2 The following window appears.  
3 Choose the relevant script type and click OK.
4 Right-click and click Edit Script. Enter the script contents.
5 Click OK.

Scripting

During script creation the following registry keys can be read from the registry key: HKEY_LOCAL_MACHINE\SOFTWARE\CapaSystems\CapaInstaller\OSD.   All the values from this registry key will be copied to the deployed client registry before rebooting into MiniSetup   Please note that this occurs just before running any PreBootScript, any changes made in PreBootScript will not be copied over.

Read about> ImageOSType Variables

Values Description
IsLocalReinstallation Reserved for future use
AlternativeConfigPath Use specified file to read startup values, this will force OSD to read values from alternate file instead of using osdloader.ini
OSDUNCPath The path where OSDGUI.exe was found
NewComputerName Contains the value to be used as the name of the client. During the deployment, the client will have a randomly generated name, which is stored in the variable COMPUTERNAME.
ImageName The name of the image be applied.
DiskConfig The disk configuration applied to the client. Refer to the help topic “How to partition the client disc during OS deployment” for a description of the format used.
DiskIndex If a machine contains more than one disc, this value will shift the deployment focus to the discindex selected, OSD will not change this value automatically
IPAddress The IP address currently assigned to the client.
BootServer The server from which OSD is running. If this value is empty, the deployment process is running from a DVD/CD or a bootable USB device.
ModelName The filtered model ID pulled from SMBIOS. This is the value that determines which drivers will be added to the client.
MachineType This value indicates if the client is a laptop or a workstation.
PCType This variable holds the installation type.
SkipGUI Set to true to suppress the user input form
OSDGUIRootDrive The drive letter where OSDGUI was found
DeployToDrive The drive letter where the image is being deployed
ImageOSType The type of OS in the selected image, possible values are:

Legacy OS values>
Windows2000WindowsVistaWindowsVistax64WindowsXP

WindowsXPx64

Windows2003Windows2003x64Windows2008

Windows2008x64


OS values>
Windows7Windows7x64Windows8

Windows8x64

Windows81Windows81x64

Windows2008R2x64

Windows2012x64Windows2012R2x64Windows2016x64

In case the OSType is not detected correctly the values will be set to Undetected or Unknown
IsReinstallation Indicates If OSD is performing a reinstallation
DisableCMSClient-Installation Set this value to True to prevent OSD from deploying a CMS agent automatically
WindowsSystemRoot Windows root of the deployed image
CustomMessage When a script is running OSD will display this value as the state message on the UI

Scripts

Script Description
PreGUIScript This script runs before OSDGUI shows the user input form. To suppress this form use the Registry value SkipGUI.   ImageName, NewComputerName and DiskConfig values must contain valid settings for OSD when the script completes, otherwise OSD will unable to continue
PreDiskPartScript This script runs immediately after the user clicks Install to activate the deployment process. Any further user interaction should be handled using this script. The script runs before any changes are made to the system disc. Note that any data saved to disc should be written to the x: and not to the c: drive. To keep these data for later use during MiniSetup etc. make sure that you use one of the later scripts to transfer these data from x: to c: before reboot.
All data written to x: during the deployment process will be discarded when rebooting.
PreImageScript This scripts runs after the partitioning operation is complete, but before any data is transferred to the new file system. Note that any files written to the disc at this point may be overwritten by any files included in the .wim file.
PreDriverCopyScript This scripts runs before any drivers are copied onto the client.
PrePatchScript This scripts runs before any changes are made to the client registry or sysprep files.
PreBootScript This scripts runs as the final part of the deployment process.
PostInstallScript This script runs as part of the minisetup process
OSDCustomLib This file can contain custom functions to be included into scripts.

Supported script types are .vbs, .wsf and .cis.

Tip! For further information about scripts, Scripts.