Symantec WISESCRIPT EDITOR 7.0 SP2 - FOR NS V1.0 Manual

Hide thumbs Also See for WISESCRIPT EDITOR 7.0 SP2 - FOR NS V1.0:
Table of Contents

Advertisement

WiseScript Editor Reference

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the WISESCRIPT EDITOR 7.0 SP2 - FOR NS V1.0 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Symantec WISESCRIPT EDITOR 7.0 SP2 - FOR NS V1.0

  • Page 1 WiseScript Editor Reference...
  • Page 2 Copyright © 2010 Symantec Corporation. All rights reserved. Symantec, the Symantec Logo, and Altiris are trademarks or registered trademarks of Symantec Corporation or its affiliates in the U.S. and other countries. Other names may be trademarks of their respective owners.
  • Page 3: Technical Support

    Global support purchased on a regional business hours or 24 hours a day, 7 days a week basis Premium service offerings that include Account Management Services For information about Symantec’s support offerings, you can visit our web site at the following URL: www.symantec.com/business/support/ All support services will be delivered in accordance with your support agreement and the then-current enterprise technical support policy.
  • Page 4 Troubleshooting that was performed before contacting Symantec Recent software configuration changes and network changes Licensing and registration If your Symantec product requires registration or a license key, access our technical support Web page at the following URL: www.symantec.com/business/support/ Customer service Customer service information is available at the following URL: www.symantec.com/business/support/...
  • Page 5 Consulting Symantec Consulting Services provide on-site technical Services expertise from Symantec and its trusted partners. Symantec Consulting Services offer a variety of prepackaged and customizable options that include assessment, design, implementation, monitoring, and management capabilities. Each is focused on establishing and maintaining the integrity and availability of your IT resources.
  • Page 6: Table Of Contents

    Contents Technical Support ............3 Chapter 1: Introduction .
  • Page 7 Config ODBC Data Source ........... . 48 Copy Local File(s) .
  • Page 8 Self-Register OCXs/DLLs ........... . . 84 Set Control Attributes .
  • Page 9 Editing Billboard Rectangles and Ellipses ........124 Editing Billboard Polygon Objects .
  • Page 10: Chapter 1: Introduction

    Chapter 1 Introduction This chapter includes the following topics: About WiseScript on page 10 Why Use WiseScript? on page 11 WiseScript Benefits on page 12 Starting the Software on page 12 The Product Interface on page 13 Compiling, Testing, and Running a WiseScript on page 13 Product Documentation on page 14...
  • Page 11: Why Use Wisescript

    Why Use WiseScript? Use WiseScript to automate system administration tasks. Its easy-to-use, structured interface lets you create useful scripts in a fraction of the time it would take to write them in a free-form scripting language such as VBScript. WiseScript excels at retrieving information about a computer, prompting for input (example: passwords) if necessary, and taking action based on that information.
  • Page 12: Wisescript Benefits

    WiseScript product’s installation directory. Your action will be available for use in future scripts. Starting the Software You install WiseScript Editor by delivering the Wise Toolkit software resource that is in the Software Catalog in the Symantec Management Console. Wise Toolkit installs both WiseScript Editor and Wise InstallTailor WiseScript Editor Reference...
  • Page 13: The Product Interface

    WiseScript™ scripting language. About Script Editor on page 15. Script Editor lets you create powerful .EXEs that you can use to automate Symantec Management Platform tasks in a batch mode and manage resources more effectively. Compiling, Testing, and Running a WiseScript To test an installation, use the Compile, Test, and Run buttons at the bottom of the main window.
  • Page 14: Product Documentation

    Share WiseScript projects with others, who can then open and edit your WiseScript with all of its source files. To create a portable project Select File menu > Create Project Package. Complete the Create Project Package dialog box: Project Name Enter a name for the portable project.
  • Page 15: Chapter 2: Using Script Editor

    Chapter 2 Using Script Editor This chapter includes the following topics: About Script Editor on page 15 The Script Editor Window on page 15 Types of Scripts on page 18 Process for Creating a Script on page 19 Adding an Action to a Script on page 19 Editing Scripts on page 20...
  • Page 16 Script list Actions list Tabs for the main script and each include script or VBScript Compile, Test, and Run Actions The actions can be arranged in groups under title bars. If you click the All Items title bar, it displays all the actions you can add to your script. The Custom group is by default empty.
  • Page 17: Customizing The List Of Actions

    Script Tabs A tab for the current installation script appears at the bottom of the installation script area. When you add an Include Script or VB Script action to the current installation script, a tab for that script appears next to the tab for the current installation script. Script Line Numbering To show or hide script line numbers, select View menu >...
  • Page 18: Types Of Scripts

    Types of Scripts In Script Editor, you can edit the following scripts: Event Scripts Event scripts handle events. (Example: The end user cancels the installation.) You can select from the Event drop-down list and edit: Mainline The primary script that’s executed during the normal installation process. It contains placeholders for Cancel and Exit scripts.
  • Page 19: Process For Creating A Script

    See also: The Script Editor Window on page 15 About Script Editor on page 15 Process for Creating a Script Open WiseScript Editor. If a previous WiseScript opens, select File menu > New. If the New Installation File dialog box appears, select Blank Script and click OK. Add script actions.
  • Page 20: Editing Scripts

    Click in the script and double-click the action in the Actions list to place the new action above the line you clicked. Click in the script and start typing the first few letters of the action name. As you type, the current line becomes a drop-down list with all the action names, and the action that most closely matches the letters you typed is the current item in the list.
  • Page 21: Finding And Replacing Text In A Script

    Duplicating or Moving Script Lines Select one or more script lines. Select Edit menu > Duplicate, or Edit menu > Move Up or Move Down. Commenting Out Script Lines You can temporarily comment out certain script lines to help with the debug process. Commented out lines remain in the script, but are skipped when the script is executed.
  • Page 22: About User-Defined Actions

    Editing Scripts on page 20 About User-Defined Actions You can streamline your development process by creating your own script actions for tasks that you perform frequently. Example: You have written a section of script that opens a Web page on your company’s Web site.
  • Page 23 For an example of how to complete these details, see Creating a User-Defined Action: Tutorial on page 24. To create a user-defined action Select File menu > New. In Script Editor, you should see a completely empty script. If your user-defined action includes a dialog box where you can enter options for the action, create the dialog box.
  • Page 24: Creating A User-Defined Action: Tutorial

    Creating a User-Defined Action: Tutorial This tutorial guides you through the process of creating a user-defined action named Wait. The Wait action contains a custom dialog box in which you can specify how many milliseconds to pause the installation. To create a new blank script for the action Select File menu >...
  • Page 25 Mark Default Button. 10. Click the Push Button tool on the toolbar again. The Push Button Control Settings dialog box appears. 11. Enter the following on the dialog box and click OK. In Label, enter Cancel. Mark the Abort Installation action. 12.
  • Page 26: Basic Scripting Concepts

    Save the script. It should already be named Wait.wse and should be in the Actions subdirectory of this product’s installation directory. To test the action Close WiseScript Editor. Open WiseScript Editor and select File menu > New > Empty Project and click OK. An empty project contains a default script in Script Editor.
  • Page 27: Conditions And Loops

    Conditions and Loops Normally, script actions are executed in the order in which they appear in the script. However, the order of execution can be changed by special script actions called conditions and loops. Conditions specify script actions that are executed only when certain conditions are true. Example: In WiseScript, you can test what version of Windows a destination computer is running, then execute different script actions depending on the version of Windows they’re running.
  • Page 28: Variables And Expressions

    Variables and Expressions Variables Variables are named storage locations that hold information about the system, information entered by the end user, or information derived or calculated from either of these sources. You can define up to 400 variables using the Set Variable action. You can then gather data from the end user or read data from files to put into variables.
  • Page 29: Compiler Variables And Run-Time Variables

    See also: Compiler Variables and Run-time Variables on page 29 Basic Scripting Concepts on page 26 Compiler Variables and Run-time Variables When They Are Set WiseScript uses two kinds of variables: compiler and run-time. When you start a compile by clicking the Compile, Test, or Run button, the values of compiler variables are set immediately by prompting you.
  • Page 30: Anatomy Of An Installation Script

    You can also use compiler variables to create a debug version of your script that includes Display Action messages to display run-time variable values and other useful information at various points in the installation. By enclosing your debugging actions in compiler variable conditions, you can easily remove them when the installation has been debugged by changing the value of a compiler variable.
  • Page 31 WiseScript Editor Reference...
  • Page 32: Chapter 3: Wisescript Actions

    Chapter 3 WiseScript Actions This chapter includes the following topics: About WiseScript Actions on page 34 Add Directory to PATH on page 34 Add Text to INSTALL.LOG on page 35 Add to AUTOEXEC.BAT on page 36 Add to CONFIG.SYS on page 36 Add to SYSTEM.INI on page 37 Browse for Directory...
  • Page 33 Else Statement on page 60 ElseIf Statement on page 60 End Statement on page 61 Evaluate Windows Installer Condition on page 61 Execute Program on page 61 Execute VBScript on page 62 Exit Installation on page 66 Find File in Path on page 67 Get Environment Variable on page 67...
  • Page 34: About Wisescript Actions

    Set Control Attributes on page 85 Set Control Text on page 85 Set Current Control on page 86 Set File Attributes on page 86 Set Files/Buffers on page 87 Set Variable on page 87 Set Windows Installer Property on page 88 Start/Stop Service on page 88 While Statement...
  • Page 35: Add Text To Install.log

    Add Text to INSTALL.LOG This action adds commands to the installation log (Install.log). Use the Open/Close Install.log action to create the installation log. Open/Close Install.log on page 76. As the installation runs on the destination computer, each action it performs is logged in the installation log (installation of files, additions or changes to registry, and so on).
  • Page 36: Add To Autoexec.bat

    Add to AUTOEXEC.BAT This action edits Autoexec.bat, which is executed during startup, allowing you to add commands that are executed before Windows loads. Insert commands at a particular line number, or search the file for specific text and insert the new line before, after, or in place of the existing line. The destination computer is restarted after installation to force the new commands to take effect.
  • Page 37: Add To System.ini

    To complete the dialog box Text to Insert Enter the line to add to Config.sys. If the line refers to a file, use a path. Example: %SYS%\Application.dll. %SYS% refers to the active system folder. Line Number Enter the line number at which the new line should be inserted. Enter 0 (zero) to append the command to the end of the file.
  • Page 38: Browse For Directory

    device entry with the same device name but a different driver path, the old entry is commented out and the new entry is added. Browse for Directory This action displays a dialog box asking the end user to select a directory. It is included to provide backward compatibility for older WiseScripts.
  • Page 39 Function Name Enter the name of the function to call. The function should be exported when creating the .DLL. The function’s parameters and return value must exactly match those specified below (case-sensitive). Call a function written specifically for WiseScript When calling functions developed specifically for WiseScript, mark this option and fill in Variables Added, Parameter String, and Action below.
  • Page 40: Dll Parameter Settings

    Get Last Error Variable When you call a Windows API function that uses the GetLastError() function to report errors, select a variable to hold the return value of that function. Doing so ensures that GetLastError() is called immediately following your function to prevent problems that can occur when you debug the WiseScript.
  • Page 41 WiseScript Corresponds to Win32 Corresponds to Description SDK type Visual Basic type short pointer Pointer to SHORT or SHORT* Long 32-bit pointer to a SHORT data type (use for PSHORT or LPSHORT) (see SHORT for the reference to this data type) word pointer Pointer to WORD or WORD* Long...
  • Page 42: Passing Complex Structures To A .Dll: An Example

    Passing Complex Structures to a .DLL: An Example You can use a Call DLL Function to call a .DLL. In addition to passing simple parameters, such as integers and strings, to a .DLL, you can also pass complex structures (sometimes called records in Pascal or Visual Basic). For each parameter, you select a passing type.
  • Page 43: Check Configuration

    Parameter in the C function Parameter type in Passing Type in WiseScript WiseScript title (third element of string buffer Contained within EMPLOYEE structure) structure (buffer length of 50) long Normal deptname (first element of string pointer First element of a DEPARTMENT structure) structure deptnum (second element of...
  • Page 44: Check Disk Space

    Note Checking for “Share Loaded” opens a temporary file and tries to lock a section of it. It detects all versions of DOS SHARE, Windows VSHARE, Windows NT/2000/XP/ 2003/Vista/2008/7, and Windows 95/98. Checking for “VGA or better” graphics ensures that display resolution is at least 640x480. Checking for free memory tests the amount of memory (including virtual memory) available at installation time.
  • Page 45: Check If File/Dir Exists

    If the installation is not true 32-bit, specify both Win16 and Win32 error variables. Then, the Win32 WinSock.dll is used, followed by the Win16 WinSock.dll. Otherwise, only the 32-bit version is used. If the download is successful, the Win32 Error Number Variable or Win16 Error Number Variable is set to 0, which indicates success.
  • Page 46: Check In-Use File

    To check if a .DLL is loaded, enter just the .DLL name, not a path. To check if a .DLL is loaded in a specific directory, include the full path. Example: To determine if any User32.dll is loaded, just specify user32.dll. To determine if c:\Windows\System32\User32.dll is loaded specify the full path.
  • Page 47: Compiler Variable Actions

    To complete the dialog box Variable Select or enter a variable in which to put the status of the service. Possible return results are: Unknown, Running, Stopped, Paused, StartPending, StopPending, ContinuePending, or PausePending. Unknown means the service was not found or the current user does not have privileges to query the service.
  • Page 48: Config Odbc Data Source

    Config ODBC Data Source This action configures an ODBC data source for use with an existing ODBC (Open Database Connectivity) driver. To complete the dialog box Data Source Name This name will be displayed in the ODBC data sources list on the destination computer.
  • Page 49 full directory path. To copy files to the installation directory, start this path with %MAINDIR%. Description Enter text to display in the progress bar during file copy. Local Path A hard-coded path that specifies the location of the files on your computer at compile time.
  • Page 50: Create Directory

    Doesn’t Matter Select this option if only one of the requirements, File Version or File Date/Time, must be fulfilled to replace the existing file. Same or Older For File Version, this replaces the existing file if it has a version resource that is the same as or older than the new file.
  • Page 51: Create Shortcut

    Ignore Error Logs the error and continues. Normal Error Displays a message to the end user, logs the error, and continues. Severe Error Logs the error. If the computer is starting the last known good configuration, startup continues. Otherwise, it restarts with the last known good configuration. Critical Error Logs the error if possible.
  • Page 52: Custom Billboard

    Command Options (Optional) If the shortcut is for an .EXE, enter command-line options. Default Directory Specify the default directory that should be set when running the target file, if different from the target file’s location. In Windows Explorer, this field is referred to as the Start in directory.
  • Page 53: Display Billboard

    To complete the dialog box Pathname Specify the directories or files to delete. For example, %TEMP%\Application.dll or %MAINDIR%\*.htm. You cannot perform wildcard deletions in the Windows, System, or root directories. Click Browse to display and select files in the current WiseScript that are installed into the %MAINDIR%, %SYS32%, %SYS%, OR %FONTS% directories.
  • Page 54: Display Message

    Transparent Mark this to have pure blue (R=0, G=0, B=255) parts of the graphic become transparent. Center Horizontal Place at Right Scale to Screen Mark this for the graphic to cover the same percentage of the screen regardless of screen size. Hide Progress Bar Mark this to hide the progress bar during graphic display.
  • Page 55: Display Progress Message

    End action are executed if the end user clicks Yes. If the user clicks No, execution continues with the first action after the End action. Cancel halts the installation. No Cancel Mark this to suppress the Cancel button. Use this in informational messages to prevent the end user from canceling installation.
  • Page 56: Edit Ini File

    Window Title Enter the title for the dialog box. Description Enter text to explain the dialog box to the end user. Edit INI File This action edits an .INI file on the destination computer. To edit SYSTEM.INI, use the Add to SYSTEM.INI action instead. To complete the dialog box File Enter the .INI file path, or select a path from the list and edit it.
  • Page 57: Registry Key Settings Dialog Box

    To import from a .REG file, select the parent key in Registry Keys, click the New Key button, and select Import. When you add a key, you are not necessarily adding it to the registry on the destination computer. If the key already exists, this action might add a value to it, update it, or delete it and all its associated values.
  • Page 58 Root Select the parent key in which the new key is added. Enter the name of the new key. You can create multiple hierarchical keys at once by separating them with backslashes, as in directory paths. (Example: Entering NewDocument\Protocol\StdFileEditing creates the StdFileEditing key inside the Protocol key, which is created inside the NewDocument key.) Any keys in the path that do not exist are automatically created.
  • Page 59: Edit Registry For Svs Layer

    See also: Edit Registry on page 56 Edit Registry for SVS Layer This action adds, edits, or deletes registry keys or values in an SVS Layer. You can create registry entries manually or import a registry file (.REG). Note Use this action on a deactivated SVS layer only. To complete the dialog box Registry Keys This field shows root registry keys and the keys added by this action.
  • Page 60: Else Statement

    SVS Layer GUID Enter the layer’s GUID (globally unique identifier) or a variable that represents the layer’s GUID. If you enter the layer’s GUID, do not include the { } brackets. See also: Add Directory to PATH on page 34 Else Statement This action marks the beginning of a section of instructions to be executed when the condition specified in the matching If action is false.
  • Page 61: End Statement

    End Statement This action marks the end of an If block or a While loop. It takes no parameters, and selecting it from the Action list inserts it directly into the script with no further dialog boxes or prompts. See also: If Statement on page 72 Evaluate Windows Installer Condition...
  • Page 62: Execute Vbscript

    Command Line Enter any command-line options to apply to the .EXE when it runs, as if you were typing them in the Run dialog box. Default Directory Specify the directory that should be current when the .EXE file is executed. The installation performs the equivalent of a Change Directory command (cd) before running the .EXE.
  • Page 63: Editing A Vbscript

    To complete the dialog box VB Script Path Specify the full path to a .VBS file including the file name. To create a new .VBS file, specify its full path including the file name and click Yes when prompted to create a new file.
  • Page 64: Vbscript Actions

    For details on when called objects appear in this drop-down list, see VBScript Actions on page 64. List Properties/Methods Displays, when possible, a drop-down list of the properties and methods of an object when the cursor is on that object’s property or method. This drop-down list also appears as a pop-up when you enter the object’s name followed by a period.
  • Page 65: Calling A Com Object In A Vbscript

    Calling a COM Object in a VBScript on page 65 Get WiseScript Variable Use this action to create script code that gets a WiseScript variable. You must set the variable in the WiseScript or another VBScript prior to the Execute VBScript action. Set Variable on page 87.
  • Page 66: Exit Installation

    The Browse Typelib Information dialog box appears. It lists TypLib information for all the objects registered on your computer. Do one of the following: For an object that is registered on your computer, select the TypeLib information for the object. For an object that is not registered on your computer, click Browse and locate the file that contains the TypeLib information.
  • Page 67: Find File In Path

    Find File in Path This action searches for a file on the destination computer. If more than one match exists, only the first match is returned. To complete the dialog box File Name Enter just the file name, not a full path. Wildcard characters (*, ?) are not allowed. Variable Name Enter a variable in which to store the path of the file if it is found.
  • Page 68: Get Name/Serial Number

    field. Add the /c command-line option to cause the command-line window to close when your program finishes execution. Get Name/Serial Number This action displays a dialog box that requests the end user’s name, company name, and a product serial number. To complete the dialog box Title Enter the title for the dialog box.
  • Page 69: Get System Information

    Expand Environment Variables If you read a REG_EXPAND_SZ value, mark this to have all environment variables in the registry value replaced with their actual values. The sample script URL.wse uses this action. For details on sample scripts, see ScriptHelp.htm in the Samples subdirectory of this product’s installation directory. Get System Information This action retrieves information about the destination computer and puts it into a variable.
  • Page 70 Win32s Version The version number of the currently running Win32s system in #.# format or blank if Win32s is not installed. Full UNC Pathname The UNC path of the destination computer. Installer EXE Pathname The path, including the file name, of the installation currently executing. File Size (Bytes) The size of the file that is specified in Pathname.
  • Page 71: Get Temporary Filename

    Get Temporary Filename This action generates a unique, temporary file name and stores it in a variable. Use the temporary name when you need to install a file to the Windows Temp directory (%TEMP%). Files that you create using this file name are deleted when the installation finishes.
  • Page 72: If Statement

    You do this by adding a Compiler Variable If/Else/End block. You get the file version of a key runtime file using the file version option of a Compiler If statement. Then, if the file version is not the one the script requires, use the Halt Compilation action to prevent compilation.
  • Page 73: Insert Line Into Text File

    them with colleagues. They typically contain just a few lines of code, such as calling an .EXE or displaying a particular dialog box. Include scripts can be any size with the limitation that the calling script plus include scripts cannot be more than 32,000 lines. Include scripts are displayed in tabs at the bottom of the script window.
  • Page 74: Install File(S)

    Action to insert before the existing line so that subsequent installations find and edit the active command, not the commented line. Insert Action Select the action to be taken when a line is found. Match Criteria Select how the line is matched with the text in Search for Text. Ignore White Space Mark this to ignore spaces and tab characters.
  • Page 75 The password prompt appears only once, for the first password-protected file in an installation, regardless of the number of password-protected files. If no password- protected files are slated for installation, the prompt does not appear. Include Sub-Directories If you specify a directory in Source Pathname, mark this to include all subdirectories and their contents.
  • Page 76: Modify Component Size

    Retain Duplicates in Path By default, version checking removes existing copies of .DLLs that are found in the path list. To suppress this feature, mark this check box. Modify Component Size For files within the installation .EXE, the amount of required disk space is automatically tracked.
  • Page 77: Parse String

    Speciallog.log). If just a file name is entered, the log is written to the same directory as the first installed file. See also: Add Text to INSTALL.LOG on page 35 Parse String This action splits a text string and places the results in two variables. You can split the string at a character or substring that you specify, which discards the character or substring you specified.
  • Page 78: Pause

    Pause This action temporarily stops a script from executing. After the specified number of milliseconds, the script continues. Example: Use this action to display a billboard for several seconds. To complete the dialog box Milliseconds to pause Enter the number of milliseconds to pause the script. A millisecond is 1/1000 of a second.
  • Page 79: Prompt For Filename

    Text to Post The text to post should be one or more lines in the format: field=data where field is the name of the field as it is expected by the CGI program, and data is the data to be sent in that field. If a line does not appear to contain a field name followed by =, it is assumed to be a continuation of the previous line, and the data on the two lines is concatenated and sent with a single field identifier.
  • Page 80: Prompt For Text

    Bitmaps (*.bmp);*.bmp Allow selection of multiple files Mark this to let end users select multiple files with Ctrl or Shift. Prompt if file does not exist Mark this to display a confirmation dialog box if the specified file does not exist. File must exist Mark this to halt the installation until an existing file has been specified.
  • Page 81: Radio Button Dialog

    Radio Button Dialog This action displays a dialog box with up to 10 radio buttons. It provides backward compatibility with older WiseScripts. In new scripts, use custom dialog boxes and dialog box controls to perform the same function. To complete the dialog box Title Enter the title for the dialog box.
  • Page 82: Read/Write Binary File

    be written back to the file. The loop repeats for each line of the file. This action requires an End Statement. To complete the dialog box Pathname Specify the full path to the text file to be edited on the destination computer (example: %WIN%\Sample.txt).
  • Page 83: Register Font

    Transfer Direction Select whether to write to or read from the file. Null Terminated If this check box is marked, a zero byte is written to the binary file after the string. Register Font This action registers a new TrueType font (.TTF file) that has been copied into the Windows font directory.
  • Page 84: Self-Register Ocxs/Dlls

    To complete the dialog box File Name Enter the name of the file to search for. The file name can contain wildcard characters (*, ?). If you select Directory given by File Name field in the Drives to Search field, then include the full path rather than just a file name. Variable Name Enter a variable to store the file path.
  • Page 85: Set Control Attributes

    Register all pending OCXs/DLLs/EXEs Mark this to register all queued .OCX, .DLL, and .EXE files. In the Install File(s) and Copy Local Files(s) actions, there is an option to queue files for self-registration. Install File(s) on page 74 and Copy Local File(s) on page 48.
  • Page 86: Set Current Control

    Control Name This contains all controls in the current dialog box. Select a control. Use the Dialog Editor view (which shows the dialog box) to see or change the name of controls. To name a control, right-click the control, select Control Properties, and, in the dialog box that appears, enter a name in the Control Name field.
  • Page 87: Set Files/Buffers

    Archive Mark this to set the archive attribute, which is used by some backup programs. Set Files/Buffers This action sets the FILES= and BUFFERS= lines in Config.sys. If either is currently lower than the minimum specified in this action, it is increased to the specified value. If either is already greater than the minimum specified in this action, it is not changed.
  • Page 88: Set Windows Installer Property

    Convert to uppercase or lowercase All alphabetical characters are converted to the case you select. Evaluate Expression The expression in New Value is evaluated according to the rules outlined in Variables and Expressions on page 28. Append to Existing Value Mark this to add the variable’s new value to the end of its original value instead of replacing it.
  • Page 89: While Statement

    After you try to stop a service, the script pauses to give the service time to stop. The currently logged-in end user must have the appropriate privileges to start and stop services. To complete the dialog box Service Name Enter the name of the service. This is not necessarily the same name you see in the Services control panel, but is the services internal name.
  • Page 90: Win32 System Directory

    The sample scripts Division.wse and Application kill.wse use this action. For details on sample scripts, see ScriptHelp.htm in the Samples subdirectory of this product’s installation directory. See also: End Statement on page 61 Win32 System Directory This action puts the path to the operating system directory (%WIN%\System32) into a variable.
  • Page 91 WiseScript Editor Reference...
  • Page 92: Chapter 4: Creating Custom Dialog Boxes

    Chapter 4 Creating Custom Dialog Boxes This chapter includes the following topics: About Dialog Boxes on page 92 About the Custom Dialog Editor on page 92 About Dialog Box Controls on page 94 Solutions for Dialog Box Problems on page 115 About Custom Dialog Box Sets on page 116 Creating a Custom Dialog Box Script...
  • Page 93: Adding A Dialog Box To The Installation

    See also: About Dialog Box Controls Adding a Dialog Box to the Installation When you add a dialog box, the dialog box is empty, and nothing is preconfigured. You must design and configure it yourself. To create a new dialog box In Script Editor, double-click the Custom Dialog script action in the Actions list.
  • Page 94: Setting Dialog Box Properties

    Adding a Dialog Box to the Installation on page 93 Setting Dialog Box Properties You can create or change the properties of a dialog box including its title, default font, dimensions, and positions. Open the dialog box in the Custom Dialog Editor. Editing Dialog Boxes on page 93.
  • Page 95 Combo Box A combination edit field and drop-down list control that lets the end user select a predefined value or enter a value. Adding Combo Box Controls on page 97. Edit Text An editable text field that accepts single or multiple lines. You can also use this type of control to display a text file.
  • Page 96: Adding And Editing Dialog Box Controls

    Adding and Editing Dialog Box Controls Open the dialog box in the Custom Dialog Editor. Editing Dialog Boxes on page 93. Select the control by doing one of the following: Click the control in the Control Palette. Right-click, select Add, and select a command. Use the Add menu on the main menu bar.
  • Page 97: Adding Combo Box Controls

    Note If you set the variable to a string containing one or more lowercase letters, the corresponding options are unavailable in the radio button control when it appears on the dialog box. Example: For a radio button with four options and a variable of “ABcd,”...
  • Page 98 select a value from the list. The size of a combo box determines where the drop-down list drops. Note When you place a combo box, you must resize the bounding box so that it is taller than the visible combo box. Otherwise, the drop-down list fails to drop down when the installation runs.
  • Page 99: Adding Edit Text Controls

    Simple. List box from which end users can make a selection. Drop Down. Drop-down list that allows text entry or selection from the list. Drop List. Drop-down list that only allows selection from the list. Control Name Enter the name by which you will refer to this control in the dialog box script. Leave this blank if you will not manipulate this control with a script.
  • Page 100 Control Name Enter the name by which you will refer to this control in the dialog box script. Leave this blank if you will not manipulate this control with a script. Horiz. Scroll Mark this to add a horizontal scroll bar. Vert.
  • Page 101: Adding Graphic Controls

    Confirm If Exists Mark this to prompt for confirmation if the path that the end user enters already exists on the destination computer. Clear this check box to prevent the “This directory already exists” message from appearing. X-Position / Y-Position Specify the exact location of the control on the dialog box.
  • Page 102: Adding Group Box Controls

    Note A dialog unit is based on the size of the dialog font, usually 8-point MS Sans Serif. A horizontal dialog unit is 1/4 the average width of the font and a vertical dialog unit is 1/8 the average height of the font. Width / Height Specify the exact dimensions of the control in dialog units.
  • Page 103: Adding Hot Text Controls

    See also: About Dialog Box Controls on page 94 About Dialog Boxes on page 92 Adding Hot Text Controls Use the Hot Text control to link an action to specific text. (Example: Add hot text with a link to a Web page or to a different dialog box.) Hot text changes color and might also become underlined as the mouse pointer passes over it.
  • Page 104: Adding List Box Controls

    Specifying Execute Program Settings on page 112. Execute Named Event Passes a named event to the dialog box script. The DLG_EVENT_TYPE variable is set to the entered text. Creating a Custom Dialog Box Script on page 118. Set Font Normally, all controls use the default font, which you set on the Dialog Box Properties dialog box.
  • Page 105 Select Add menu > List Box. The List Box Control Settings dialog box appears. Complete the dialog box: List Box Text Each line of this text is displayed as a separate item in the list box. Press Enter between selections so there is only one item per line. Variable Specify the name of the script variable that stores the return value of this dialog box control.
  • Page 106: Adding Play Avi Controls

    Confirm If Exists Mark this to prompt for confirmation if the path that the end user enters already exists on the destination computer. Clear this check box to prevent the “This directory already exists” message from appearing. Components To create named components, populate the Components field above and mark this check box.
  • Page 107: Adding Push Button Controls

    X-Position / Y-Position Specify the exact location of the control on the dialog box. You can also use the alignment commands to precisely arrange controls on the dialog box. Aligning and Spacing Dialog Box Controls on page 113. Note A dialog unit is based on the size of the dialog font, usually 8-point MS Sans Serif.
  • Page 108 Action Select an action for the control: Return to Previous Dialog Displays the previously-displayed dialog box in the dialog box set. (Exception: The Back buttons on wizard dialog boxes do not use this option. They are controlled by the Wizard Loop script action.) If this is the first dialog box in the set, it returns to the installation script.
  • Page 109: Adding Radio Button Controls

    The sample script Event Handler.wse uses scripting to handle push button controls. For details on sample scripts, see ScriptHelp.htm in the Samples subdirectory of this product’s installation directory. See also: About Dialog Box Controls on page 94 About Dialog Boxes on page 92 Adding Radio Button Controls A group of radio buttons is considered a single control.
  • Page 110: Adding Rectangle Controls

    Note A dialog unit is based on the size of the dialog font, usually 8-point MS Sans Serif. A horizontal dialog unit is 1/4 the average width of the font and a vertical dialog unit is 1/8 the average height of the font. Width / Height Specify the exact dimensions of the control in dialog units.
  • Page 111: Adding Text Controls

    Note A dialog unit is based on the size of the dialog font, usually 8-point MS Sans Serif. A horizontal dialog unit is 1/4 the average width of the font and a vertical dialog unit is 1/8 the average height of the font. Width / Height Specify the exact dimensions of the control in dialog units.
  • Page 112: Specifying Execute Program Settings

    Set Font Normally, all controls use the default font, which you set on the Dialog Box Properties dialog box. Click this to override the default font for this control. If the font you select is not available on this computer, the system font is used. Default Font Click this to use the font specified on the Dialog Box Properties dialog box.
  • Page 113: Aligning And Spacing Dialog Box Controls

    Mark the Execute Program option and click Edit. The Execute Program Settings dialog box appears. Complete the dialog box: EXE Path Specify the path to the application to be executed, including the application executable. Use variable substitution (example: %MAINDIR% to refer to the application directory) to ensure a valid path regardless the installation location.
  • Page 114: Setting Tab Order Of Dialog Box Controls

    Align Controls Right Aligns the right edge of the selected controls with the right edge of the rightmost control. Align Controls Top Aligns the top edge of the selected controls with the top edge of the topmost control. Align Controls Bottom Aligns the bottom edge of the selected controls with the bottom edge of the bottommost control.
  • Page 115: Solutions For Dialog Box Problems

    See also: Adding and Editing Dialog Box Controls on page 96 About Dialog Box Controls on page 94 Aligning and Spacing Dialog Box Controls on page 113 Setting Dialog Box Properties on page 94 Solutions for Dialog Box Problems Typically, dialog boxes are not used in WiseScripts that run silently, or in WiseScripts that automate Altiris tasks.
  • Page 116: Keeping Disabled Controls From Reactivating

    See also: Solutions for Dialog Box Problems on page 115 Keeping Disabled Controls From Reactivating This problem affects radio buttons and check boxes. Example: A dialog box in a wizard loop has a radio button with four options. You disable several options by setting the variable associated with the radio button to “ABcd.”...
  • Page 117: Configuring Dialog Box Set Properties

    The master dialog box is the first dialog box that is displayed when the associated Custom Dialog script action is executed. In the Custom Dialog Editor, select File menu > New Dialog. The Dialog Box Properties dialog box appears. Complete the dialog box and click OK. Setting Dialog Box Properties on page 94.
  • Page 118: Creating A Custom Dialog Box Script

    Called Dialogs Float If you are displaying a dialog box outside a wizard loop, mark this check box to have called dialog boxes appear in front of the calling dialog box. (Example: Suppose you display a Select Destination Directory dialog box that contains a Browse button.
  • Page 119: Dialog Box Script Actions

    See also: Dialog Box Script Actions on page 119 Dialog Box Script Examples on page 119 Dialog Box Script Actions The script actions available in the Dialog Script Editor are a subset of the actions in Script Editor, with the addition of these script actions that manipulate controls on the dialog box programmatically: Set Control Attributes, Set Control Text, and Set Current Control.
  • Page 120 value returned from the previous dialog box, then use one or more Set Control Attributes script actions to enable buttons. Have the INIT event disable certain buttons if they are not valid based on previously chosen options. Have the INIT event store the current amount of free memory in a static text control, then set the dialog box to display the current amount of free memory in the lower-left corner.
  • Page 121: Chapter 5: Creating Custom Billboards

    Chapter 5 Creating Custom Billboards This chapter includes the following topics: About Billboards on page 121 Accessing the Custom Billboard Editor on page 121 About the Custom Billboard Editor on page 121 Opening and Saving Custom Billboards on page 122 Adding Objects to a Billboard on page 122 About Billboards...
  • Page 122: Opening And Saving Custom Billboards

    programs, you can still use the Custom Billboard Editor to place other objects (example: editable text) over them. The Custom Billboard Editor includes a blue work area with black lines marking the boundaries of a monitor set for 640 x 480 resolution. The blue work area indicates that the background is transparent, so any objects you place here appear over whatever background is displayed by the installation.
  • Page 123: Editing Billboard Text Objects

    Drag in the work area to create the object. (The polygon tool requires that you click at each point of the polygon, then double-click at the last point.) A settings dialog box appears. Complete the dialog box: For text objects, see Editing Billboard Text Objects.
  • Page 124: Editing Billboard Line Objects

    Text Color Click Pick to choose a color for the text. Placement Specify the size and location of the object in pixels. The upper-left corner is 0,0. The black rectangle on the billboard editor defines an area of 640 x 480 pixels. Click OK.
  • Page 125: Editing Billboard Polygon Objects

    Access the Custom Billboard Editor. Accessing the Custom Billboard Editor on page 121. Select Add menu > Rectangle or Rounded Rectangle or Ellipse and drag the dimensions of the object in the billboard editor. The Object Settings dialog box opens. Complete the dialog box: Line Style Choose the texture for the line that outlines the shape.
  • Page 126: Editing Billboard Bitmap Objects

    Fill Style Select a pattern to fill the object. Line Width The width of the object’s outline in pixels. Polygon Points The list of points that define the polygon’s vertices. Click Delete to delete a selected point, or use the X and Y fields to move the selected point to new coordinates.
  • Page 127: Resizing, Moving, And Aligning Billboard Objects

    Click OK. See also: Adding Objects to a Billboard on page 122 Resizing, Moving, and Aligning Billboard Objects Resize an object in the Custom Billboard Editor by clicking it and dragging one of the eight handles that appear around the object. Move objects in the Custom Billboard Editor by clicking and dragging them.
  • Page 128 Open the billboard in the Custom Billboard Editor by double-clicking its custom action in Script Editor. Select Edit menu > Graphic Properties. The Billboard Settings dialog box appears. The options on this dialog box are a subset of the settings for the Display Billboard script action. Complete the dialog box: X Position, Y Position Indicate the location on a 640 x 480 screen to place images.
  • Page 129: Chapter 6: Troubleshooting Wisescripts

    Chapter 6 Troubleshooting WiseScripts This chapter includes the following topics: About Troubleshooting a WiseScript on page 129 Using the Installation Log on page 129 File Replacement Problems in System32 on page 129 About Troubleshooting a WiseScript Use the following to troubleshoot a WiseScript: Installation log Lets you determine what happens during the installation, including what fails.
  • Page 130 also checks such things as operating system (OS) type and language, and it won’t replace files if the OS or language does not match, regardless of version. To check if a file is replaced based on version, double-click its Install File(s) script line. In the Install File Settings dialog box that appears, if Check File is selected from the Replace Existing File drop-down list, then version checking occurs for the file.
  • Page 131: Chapter 7: Quick Reference

    Chapter 7 Quick Reference This chapter includes the following topics: Automatic Compiler Variables on page 131 Automatic Run-time Variables on page 132 Run-time Variables on page 134 Expression Operators on page 137 Command-Line Options on page 138 Automatic Compiler Variables Compiler variables are set before the installation is built and cannot be changed by an installation script.
  • Page 132: Automatic Run-Time Variables

    Variable Description _VFPOPTIONS_ Visual FoxPro options _WIN_ Windows directory on the build computer _WISE_ The directory containing WiseScript Editor See also: Automatic Run-time Variables on page 132 Run-time Variables on page 134 Automatic Run-time Variables These variables are set on the destination computer just before the script executes. Variable Description BACKUPDIR...
  • Page 133 Variable Description INSTALL_RESULT Holds the result of the last action performed for Install (read-only) File(s), Copy Local File(s), Edit INI, and Execute Program actions. (This variable is similar to PROCEXITCODE.) Install File(s) and Copy Local File(s) return: V = Version. Replacement option was set to check version, and the version being installed was not newer.
  • Page 134: Run-Time Variables

    Variable Description Windows System directory path. We recommend that you do not change this variable. SYS32 Path to the system directory for Win32 files. We recommend that you do not change this variable. TEMP Windows temporary directory path. We recommend that you do not change this variable.
  • Page 135 Variable Description DISPLAY Holds the name of the current wizard dialog box (read- only). DOBACKUP Holds the end user’s choice as to whether to back up replaced files. DOBRAND If this is set to 1, this is the first time the installation has been branded and user information is written to CUSTDATA.INI.
  • Page 136 Automatic Compiler Variables on page 131 Automatic Run-time Variables on page 132 Per User Variables Per user variables are static properties of a layer. Variable Description Example Value ADMINTOOLS C:\Documents and Settings\User\Start Menu\Programs\Administrative Tools APPDATA C:\Documents and Settings\User\Application Data CACHE C:\Documents and Settings\User\Local Settings\Temporary Internet Files CDBURNING...
  • Page 137: Expression Operators

    Variable Description Example Value TEMPLATES C:\Documents and Settings\user\Templates. TEMP Folder where temporary C:\DOCUME~1\User\LOCALS~1\Temp files can be created. USERPROFILE Location of the current C:\Documents and Settings\User user’s profile. Expression Operators In conditionals, loops, and Set Variable commands, you can use the following operators: symbols, functions, or logical operators.
  • Page 138: Command-Line Options

    Instr(str1,str2) Determines if a substring (str2) is present within an original string (str1). Do not include the $ character because this operator does not return a string. Before$(str1,str2) Returns the portion of a string (str1) before the indicated substring (str2). Example: Before$(“windows”,“d”) returns “win.”...
  • Page 139: Wisescript Command-Line Options

    See also: WiseScript Command-Line Options on page 139 WiseScript Installations Command-Line Options on page 140 Uninstall Command-Line Options on page 140 WiseScript Command-Line Options You can apply the following command-line options to the WiseScript Editor executable file, Wise32.exe. Command-line options let you compile as well as set properties. /c file.wse Compiles the installation script.
  • Page 140: Wisescript Installations Command-Line Options

    Command-Line Options on page 138 WiseScript Installations Command-Line Options You can apply the following command-line options to .EXE files that you compile from WiseScript Editor projects. Installs in Test mode. /X path Extracts files to the specified path. /Z path Extracts files to the specified path, then restarts.
  • Page 141 Silent mode. The uninstall proceeds silently with no splash screen, no dialog boxes, and no end user choices. Rollback mode. Removes the Select Uninstall Method dialog box, which means the end user does not see options for a custom, automatic, or repair uninstall.
  • Page 142: Index

    Index Symbols append data to registry key 58 writing to 82 application bitmap % sign with compiler variable 29 executing 61 adding to billboard 126 _ALIASNAME_ 131 exit code 66 displaying in background 53, 121 _ALIASPATH_ 131 APPTITLE 134 Bitmap Settings dialog box 126 _ALIASTYPE_ 131 ASP 78 blank line in script 83...
  • Page 143 comment out lines 21 rectangle 110 getting file name 79 spacing 113 getting text input 80 comments in scripts 83 static 101, 111 listing Program groups 105 COMMON 134 tab order 114 message 54 company name, getting 69 text 111 movie 106 compile properties 94...
  • Page 144 dword 40 four-digit modified date 70 HELPFILE 132 FTP from Web 48 dword pointer 41 hot text control in use 46 adding to dialog box 103 renaming 83 link to Web 103 replacing in System32 129 HTTP Edit INI File 56 replacing on destination checking connection 44 Edit Registry 56...
  • Page 145 check 44 OSD 52 registry key appending to 58 owner name, getting 69 getting value 68 removing from destination LANG 133 computer 57 launch paging 43 removing from installation 57, WiseScript for NS 12 parameters, pass to function 42 57, 59, 59 Lcase$ 138 Parse String 77 settings 57...
  • Page 146 line color 16 passing structure example 42 blank script for 24 window 15 passing to DLL 41 changing parameter 22 creating 22 Search for File 83 substitution 28 dialog box for 24 self-register files 49, 75 syntax, check in VBScript 64 in actions list 23 Self-Register OCXs/DLLs 84 SYS 134...
  • Page 147 checking 46 controlling behavior 50 creating 50 starting, stopping 88 WinSock 44 Wise scripting language 12 WISE_ERROR_RTN 66, 135 Wise32.exe, run from command 139 WiseScript about 12 actions 34 portable project 13 troubleshooting 129 why use? 11 WiseScript for NS starting 12 wizard dialog box changing image 115...
  • Page 148 WiseScript Editor Reference...

Table of Contents