Skip to content

Create a new script

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

StepAction
1Click File menu, click New and then _Create new script_.
2The following window appears.  
3Choose the relevant script type and click OK.
4Right-click and click Edit Script. Enter the script contents.
5Click 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

ValuesDescription
IsLocalReinstallationReserved for future use
AlternativeConfigPathUse specified file to read startup values, this will force OSD to read values from alternate file instead of using osdloader.ini
OSDUNCPathThe path where OSDGUI.exe was found
NewComputerNameContains 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.
ImageNameThe name of the image be applied.
DiskConfigThe 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.
DiskIndexIf 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
IPAddressThe IP address currently assigned to the client.
BootServerThe 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.
ModelNameThe filtered model ID pulled from SMBIOS. This is the value that determines which drivers will be added to the client.
MachineTypeThis value indicates if the client is a laptop or a workstation.
PCTypeThis variable holds the installation type.
SkipGUISet to true to suppress the user input form
OSDGUIRootDriveThe drive letter where OSDGUI was found
DeployToDriveThe drive letter where the image is being deployed
ImageOSTypeThe 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
IsReinstallationIndicates If OSD is performing a reinstallation
DisableCMSClient-InstallationSet this value to True to prevent OSD from deploying a CMS agent automatically
WindowsSystemRootWindows root of the deployed image
CustomMessageWhen a script is running OSD will display this value as the state message on the UI

Scripts

ScriptDescription
PreGUIScriptThis 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
PreDiskPartScriptThis 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.
PreImageScriptThis 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.
PreDriverCopyScriptThis scripts runs before any drivers are copied onto the client.
PrePatchScriptThis scripts runs before any changes are made to the client registry or sysprep files.
PreBootScriptThis scripts runs as the final part of the deployment process.
PostInstallScriptThis script runs as part of the minisetup process
OSDCustomLibThis 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.