The following are the standard definitions used in CA DMM scripts:
Source refers to the old system if the user is networking or to the storage file for a stand-alone system.
Destination refers to the new computer.
You can use C-style comments anywhere in a script. Any and all text following a comment on the same line is considered part of the comment. You can include a comment on the same line as a statement after the semicolon. You cannot nest comment. You can also use double forward slash (//) comments.
Examples:
/*Files under SYSTEMPATH*/
StoreFile( SYSTEMPATH + "\\Olepro32.dll" ); /*Store the Olepro32.dll file*/
//This whole line is commented out.
Variables are script-defined reserved words that are declared the first time they are assigned a value. They can be any combination of letters, numbers, and underscores. However, the first character must be a letter. Variables cannot use the names of keywords or constants.
Constants are predefined or dynamically defined variables provided by the script interpreter. Their value depends on the state of the interpreter and its platform. Constants cannot be modified by the script and retain the same value for the duration of the session.
The exceptions are APPLICATIONPATH, which is initialized using the Detect keyword, and LANGUAGE is initialized with the language of the operating system.
The predefined constants are as follows:
The path of the windows directory on the Source computer.
The path of the system directory on the Source computer.
The path of the application directory on the Source computer.
The path of the windows directory on the Destination computer.
The path of the system directory on the Destination computer
The path of the application directory on the Destination computer
Represents the Windows 2000 platform.
Represents the Windows XP 32 bit platform.
Represents the Windows XP 64 bit platform.
Represents the Windows Vista 32 bit platform.
Represents the Windows Vista 64 bit platform.
Represents the Windows 7 32 bit platform.
Represents the Windows 7 64 bit platform.
Represents the Windows 8 32 bit platform.
Represents the Windows 8 64 bit platform.
Always overwrite files.
Never overwrite files.
Only overwrite files if the overwriting file is newer than the existing file.
A print level indicating that a print statement will always be printed.
A print level indicating that a print statement will be printed to a log set to a moderate level.
A print level indicating that a print statement will be printed to a log set to a detailed level.
A print level indicating that a print statement will be printed to a log set to a very detailed level.
Returns the language identifier of the operating system.
Example:
if (LANGUAGE == "enu")
DoSomething();
The following constants are defined in the registry in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders. You can specify these constants instead of retrieving the value from the registry.
The path of the user Application Data on the Source computer, such as C:\Documents and Settings\Default User\Application Data.
The path of the user Desktop folder on the Source computer, such as C:\Documents and Settings\Default User\Desktop.
The path of the user Favorites folder on the Source computer, such as C:\Documents and Settings\Default User\Favorites.
The path of the user Application Data on the Source computer, such as C:\Documents and Settings\Default User\Local Settings\Application Data.
The path of the user My Documents on the Source computer, such as C:\Documents and Settings\Default User\My Documents.
The path of the user Program Files on the Source computer, such as C:\Program Files.
The path of the user Start Menu folder on the Source computer, such as C:\Documents and Settings\Default User\Start Menu.
The path of the user Startup Folder on the Source computer, such as C:\Documents and Settings\Default User\Start Menu\Programs\Startup.
The path of the user Templates folder on the Source computer, such as C:\Documents and Settings\Default User\Templates.
The path of the user Application Data on the Destination computer, such as C:\Documents and Settings\Default User\Application Data.
The path of the user Desktop folder on the Destination computer, such as C:\Documents and Settings\Default User\Desktop.
The path of the user Favorites folder on the Destination computer, such as C:\Documents and Settings\Default User\Favorites.
The path of the user Application Data on the Destination computer, such as C:\Documents and Settings\Default User\Local Settings\Application Data.
The path of the user My Documents on the Destination computer, such as C:\Documents and Settings\Default User\My Documents.
The path of the user Program Files on the Destination computer, such as C:\Program Files.
The path of the user Start Menu folder on the Destination computer, such as C:\Documents and Settings\Default User\Start Menu.
The path of the user Startup Folder on the Destination computer, such as C:\Documents and Settings\Default User\Start Menu\Programs\Startup.
The path of the user Templates folder on the Destination computer, such as C:\Documents and Settings\Default User\Templates.
The following constants are used with these commands to replace the Boolean parameter:
The constants are as follows:
A Boolean constant that returns true or false depending on whether CA DMM is applying or storing.
A Boolean constant that always returns False.
Example:
function MyStoreFunction()
{
var strSourceDesktop = RetrieveValue("HKCU\\Shell Folders", "Desktop", SOURCE);
// do something.
}
function MyApplyFunction()
{
var strSourceDesktop = RetrieveValue("HKCU\\Shell Folders", "Desktop", SOURCE);
var strDestinationDesktop = RetrieveValue("HKCU\\Shell Folders", "Desktop", DESTINATION);
// do something.
These commands are used for the optional second parameter in the following commands: Print, PrintException. The importance level is most severe for GENERAL and least severe for VERY_DETAILED. If Print Levels is not specified, the parameter defaults to GENERAL.
The following print levels are supported:
Usage:
Print(PrintException) <string expression>, [print level];
Examples:
print ("this is important", GENERAL);
PrintException ("this isn’t as important", DETAILED);
A value, or result, that can be either true or false.
|
Copyright © 2013 CA.
All rights reserved.
|
|