background image

WiseScript Editor Reference

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
disabling check box 116
disabling radio button 116

Wizard Loop

action 90
adding dialog box 52

word 40
word pointer 41

Summary of Contents for ALTIRIS INVENTORY 7.0 SP2 - FOR NETWORK DEVICES V1.0

Page 1: ...WiseScript Editor Reference ...

Page 2: ...TIES INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE OR NON INFRINGEMENT ARE DISCLAIMED EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID SYMANTEC CORPORATION SHALL NOT BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING PERFORMANCE OR USE OF THIS DOCUMENTATION THE INFORMATION CONTAINED IN THIS DOCUMENTATION...

Page 3: ... regional business hours or 24 hours a day 7 days a week basis z 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 poli...

Page 4: ...formation about product updates and upgrades z Information about upgrade assurance and maintenance contracts z Information about the Symantec Buying Programs z Advice about Symantec s technical support options z Nontechnical presales questions z Issues that are related to CD ROMs or manuals Support agreement resources If you want to contact Symantec regarding an existing support agreement please c...

Page 5: ...ats Consulting Services Symantec Consulting Services provide on site technical 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 Ed...

Page 6: ...ext in a Script 21 About User Defined Actions 22 Creating a User Defined Action 22 Creating a User Defined Action Tutorial 24 Basic Scripting Concepts 26 Conditions and Loops 27 Variables and Expressions 28 Compiler Variables and Run time Variables 29 Anatomy of an Installation Script 30 Chapter 3 WiseScript Actions 32 About WiseScript Actions 34 Add Directory to PATH 34 Add Text to INSTALL LOG 35...

Page 7: ...diting a VBScript 63 VBScript Actions 64 Calling a COM Object in a VBScript 65 Exit Installation 66 Find File in Path 67 Get Environment Variable 67 Get Name Serial Number 68 Get Registry Key Value 68 Get System Information 69 Get Temporary Filename 71 Get Windows Installer Property 71 Halt Compilation 71 If Statement 72 Include Script 72 Insert Line Into Text File 73 Install File s 74 Modify Comp...

Page 8: ...3 Adding List Box Controls 104 Adding Play AVI Controls 106 Adding Push Button Controls 107 Adding Radio Button Controls 109 Adding Rectangle Controls 110 Adding Text Controls 111 Specifying Execute Program Settings 112 Aligning and Spacing Dialog Box Controls 113 Setting Tab Order of Dialog Box Controls 114 Solutions for Dialog Box Problems 115 Changing the Default Graphic on Wizard Dialog Boxes ...

Page 9: ...6 Troubleshooting WiseScripts 129 About Troubleshooting a WiseScript 129 Using the Installation Log 129 File Replacement Problems in System32 129 Chapter 7 Quick Reference 131 Automatic Compiler Variables 131 Automatic Run time Variables 132 Run time Variables 134 Expression Operators 137 Command Line Options 138 WiseScript Command Line Options 139 WiseScript Installations Command Line Options 140...

Page 10: ...Product Interface on page 13 z Compiling Testing and Running a WiseScript on page 13 z Product Documentation on page 14 About WiseScript WiseScript Editor is a WiseScript authoring environment that lets system administrators create EXEs that automate Altiris tasks in a batch mode and manage resources more effectively WiseScript Editor is part of the Wise Toolkit that is available to users of Altir...

Page 11: ...e You can create a simple WiseScript that reads the default browser from the registry verifies that the default browser is installed and either edits the registry key installs the default browser or both z You need to update a platform dependent DLL file on a collection of computers that are running different operating systems Instead of creating a different Software Delivery task for each version...

Page 12: ... and removes spyware might temporarily install Kill exe on the destination computer while the script is running z Built in rollback WiseScripts can be rolled back after they are executed on the destination computer z User interface WiseScripts can incorporate any type of dialog box to either inform the end user or prompt for input z WiseScript is powerful In addition to the dozens of predefined ac...

Page 13: ... installation This is the installation EXE that you distribute to end users If any files are absent or not readable error messages appear when compiling z Test Click Test to compile and run the installation in test mode In test mode the installation performs all script actions without actually installing or modifying files However if any script lines are dependent on files being installed by previ...

Page 14: ...uded in the WiseScript then you should include them in the project Password protect the project package To add password protection to the project mark this option and then enter and confirm the password 3 Click OK The Save As dialog box appears 4 Specify the file name and location for the portable WiseScript project and click Save Product Documentation This documentation assumes that you are profi...

Page 15: ...olidates numerous lines of code into predefined script actions You don t need to memorize commands because Script Editor supports a point and click method of scripting The script you create is displayed in clear English like statements You compile the script along with files and other resources into an EXE When the EXE is run the script runs executing the actions that are specified in the script S...

Page 16: ...contains the script that is executed when an end user runs the EXE For information on working with scripts see Adding an Action to a Script on page 19 and Editing Scripts on page 20 Script lines are color coded based on the type of the script line The color code is as follows z Compiler Variable Items gray z Include Script Items black z Install Copy File Items black z Logic items blue z New Variab...

Page 17: ...roup The All Items group contains all actions and you cannot remove this group or any of its actions You can remove any of the other groups and edit the actions that appear in the groups To add an action group 1 Right click anywhere in the Actions list and select Add Group The Group Name dialog box appears 2 Enter the name of the new group and click OK The Select Items for Group dialog box appears...

Page 18: ...ude Script on page 72 Scripts can be included either in the main installation script or in other include scripts At run time include scripts are run when the Include Script action that references them is encountered For each Include Script action in a script a new tab appears at the bottom of the Installation Script pane Include scripts can help save time in developing installations because you ca...

Page 19: ... the WiseScript To test the WiseScript without actually making changes to your computer click Test at the lower right of the main window This is most useful for testing any user interface elements of the WiseScript To run the WiseScript on your computer click Run at the lower right of the main window This will make changes to your computer 7 If you are using WiseScript within the Altiris Notificat...

Page 20: ...ipt in Script Editor use the commands on the Edit menu the commands on the right click menu or the tools on the toolbar You can edit only one script line at a time but you can cut copy or paste several lines at one time To edit an include script select it by clicking its tab Changes that you make to an include script are saved when you save the project To edit a VBScript see Editing a VBScript on ...

Page 21: ...Save Script Text to File 2 Specify the location and name of the file See also Adding an Action to a Script on page 19 The Script Editor Window on page 15 Finding and Replacing Text in a Script on page 21 Finding and Replacing Text in a Script Not available in VBScripts 1 In Script Editor do one of the following To find text press Ctrl F to find text To find and replace text press Ctrl H 2 Enter th...

Page 22: ...he script Action Name The file name of the script Dialog Box Include a dialog box only if your action has parameters that you must change each time you use the action This dialog box appears when your action is double clicked Example For an action that opens a URL in the in the destination computer s browser you might include a dialog box that asks for the URL Then if the URL changes frequently yo...

Page 23: ...at perform an advanced function 5 In Title enter a combination of text and variables to define the format of the script line Example Your user defined action displays an HTML file on the Web In your action a dialog box asks for the URL to the file and the URL is put in the variable URL_PATH In Title you might enter Display HTML File URL_PATH When you add your user defined action to an installation...

Page 24: ...write a script action that interacts with the developer who uses it you must add a Custom Dialog script line which you must store in the Exit script A user defined action requires a dialog box only if it has parameters that you need to change when you use the action 2 In the Actions list double click the Custom Dialog action The Dialog Box Properties dialog box appears 3 In Dialog Title enter Ente...

Page 25: ...o learn more about calling Windows system DLLs see the Microsoft Developer Network msdn microsoft com 1 From Event select Mainline to return to the main part of your script The script should be blank 2 In the Actions list double click Call DLL Function The Call DLL Function dialog box appears 3 Complete the dialog box DLL Pathname Enter SYS32 Kernel32 dll Function Name Enter Sleep Call a function ...

Page 26: ...here should be a nine second delay before the Welcome dialog box appears If the action does not work check the options you entered for the Call DLL statement If it still doesn t work open the Pause wse file located in the Actions directory and view its parameters The Pause action is identical to the Wait action you just created You can place the Wait action anywhere in the script to pause the scri...

Page 27: ... Editor indents everything inside a condition or loop so you can see which actions are affected Else and ElseIf Actions Conditions can use the Else and ElseIf actions which mark the beginning of actions to be executed when the condition described by the If action or other condition statement is not true The Else action is used between the If and End actions Actions after the If but before the Else...

Page 28: ...Examples WIN refers to the contents of the WIN variable which is the path to the Windows system directory and WIN Fonts refers to the path to the Windows font directory The character is not part of the variable name but rather a marker that tells WiseScript to replace the variable s name with its value before executing the command To include an actual character in the script use You can use substi...

Page 29: ...h signs but when you enter a compiler variable in an expression you must surround the compiler variable with signs With a condition based on run time variables all the script actions required by the condition are included in the installation EXE WiseScript Editor doesn t know which part of the condition will be executed until the installation EXE is run because it depends on variables whose values...

Page 30: ...rated by Installation Expert or writing your own script an understanding of these sections can help insure that your script works correctly Initialization In this section default values for an installation are set including the default directory standard components and Start menu Information that is needed later in the installation is read from INI files or the registry Files that are displayed to...

Page 31: ...WiseScript Editor Reference 31 ...

Page 32: ...44 z Check HTTP Connection on page 44 z Check If File Dir Exists on page 45 z Check In use File on page 46 z Check Service on page 46 z Compiler Variable Actions on page 47 z Config ODBC Data Source on page 48 z Copy Local File s on page 48 z Create Directory on page 50 z Create Service on page 50 z Create Shortcut on page 51 z Custom Billboard on page 52 z Custom Dialog on page 52 z Delete File s...

Page 33: ...roperty on page 71 z Halt Compilation on page 71 z If Statement on page 72 z Include Script on page 72 z Insert Line Into Text File on page 73 z Install File s on page 74 z Modify Component Size on page 76 z Open Close Install log on page 76 z Parse String on page 77 z Pause on page 78 z Play Multimedia File on page 78 z Post to HTTP Server on page 78 z Prompt for Filename on page 79 z Prompt for ...

Page 34: ...Script based editor without errors However a WiseScript will run only in an environment that supports all the actions in the script Example The Get Windows Installer Property action will not work in a script that runs outside a Windows Installer installation See also About Script Editor on page 15 Add Directory to PATH on page 34 Add Directory to PATH This action adds a directory to the PATH envir...

Page 35: ...o Install log script line directly before the Install File s script lines that install files to one of these directories Type the following as the Log Text exactly as shown because it is case sensitive Non System File You can add a line to the Install log that pauses the uninstall executes an application until it finishes then resumes the uninstall To do this type the following as Log Text substit...

Page 36: ...scans Autoexec bat looking for a line that begins with ends with or contains the text depending on what you set in Match Criteria The line is inserted at the first found match z Comment Text Enter text to insert at the beginning of the line that is found Insert REM with the trailing space but without the quotation marks to comment out the line which lets you replace an existing command with a new ...

Page 37: ...mmand in place but inactive If this is the case set Insert Action to insert before the existing line so that a subsequent installation finds and edits the active command not the commented line z Insert Action Select where to insert the new line in relation to the found line z Match Criteria Select how the found line matches the Search for Text z Ignore White Space Mark this to ignore spaces and ta...

Page 38: ... to prevent the default directory Default Value field from being appended to the chosen directory z Confirm If Exists Mark this to warn the end user if the chosen directory already exists Call DLL Function This action calls a DLL function from a DLL on the destination computer They can be be DLLs you have written DLLs developed for WiseScript or Windows DLLs You can branch the script based on the ...

Page 39: ...rns a boolean value zero equals false non zero equals true Ignore return value The script continues regardless of any value returned Exit if function returns true The installation exits if the DLL function returns non zero Start block if function returns true If the DLL function returns non zero all actions between this action and its matching End action are executed Otherwise these actions are sk...

Page 40: ...ll wse CheckDiskSpace wse Color wse and Prompt wse use this action For details on sample scripts see ScriptHelp htm in the Samples subdirectory of this product s installation directory See also Passing Complex Structures to a DLL An Example on page 42 DLL Parameter Settings The DLL Parameter Settings dialog box appears when you add a new parameter to a Call DLL Function action Add parameters in th...

Page 41: ...window z Variable Name If Value Source is set to Variable select or enter a variable z Constant Value If Value Source is set to Constant enter a constant here You can enter a variable here example NUMUSERS See also Call DLL Function on page 38 short pointer Pointer to SHORT or SHORT use for PSHORT or LPSHORT Long 32 bit pointer to a SHORT data type see SHORT for the reference to this data type wor...

Page 42: ... simple integer indicating success or failure The function accepts three parameters a structure that contains three elements an integer and another structure that contains two elements The calling statement for the DLL is int NewEmployee EMPLOYEE int DEPARTMENT where EMPLOYEE is a pointer to a structure int is a simple integer and DEPARTMENT is a pointer to a structure In this example the layout o...

Page 43: ...ndows XP or later is running z Action Occurs when the statement above is true All options below display the message described in Title and Message Text below unless Message Text is blank Display Message Only Abort Installation Start Block Begins a conditional block All actions between this action and the next Else or End action are executed z Title Enter the title for the dialog box z Message Text...

Page 44: ...us Variable Select or enter the variable to store the result of the disk space check If there is not enough disk space an error message is displayed and the end user can halt installation ignore the error or retry the disk space check Status Variable is set to R if the end user chooses to retry which lets you define what retrying means Example Let the end user select a different directory or diffe...

Page 45: ...her internal Web page no error is detected by this action To complete the dialog box z URL to Check Include http in the URL z Win32 Error Text Variable Select or enter a variable to store the error text returned by the 32 bit winsock dll z Win32 Error Number Variable Select or enter a variable to store the error code returned by the 32 bit winsock dll z Win16 Error Text Variable Select or enter a ...

Page 46: ... as the condition is true z Perform loop at least once If you chose Start While Loop mark this to force the loop to execute once before the test is performed If the check box is cleared the loop is executed if the condition is true but is not executed if the condition is false The sample script Newdisk wse uses this action For details on sample scripts see ScriptHelp htm in the Samples subdirector...

Page 47: ...G action within the Compiler Variable If block is added to the final script The debug information you requested then appears in the installation log To create a compiler variable If block 1 Add a Compiler Variable If action and complete the dialog box If Variable Build an If statement by selecting a compiler variable and a comparison The Value Enter the value to be used in the comparison This is c...

Page 48: ...estination computer Copy Local File s This action copies uncompressed files from a floppy disk CD the destination computer or a network drive To complete the dialog box z Source Specify the path of the file or files to be copied at installation time Specify the path using a variable such as INST for the directory where the installation EXE is running The value of the field should evaluate to a val...

Page 49: ...e is a DLL or VBX Windows tracks the file to prevent its removal if an application is still using it z No Progress Bar Mark this to hide the progress bar while this file is being copied z Self Register OCX DLL EXE TLB All OCXs and TLBs and some DLLs and EXEs support self registration Mark this so the file registers itself in the Windows registry before it is used This action does not register the ...

Page 50: ...t are found in the path list To suppress this feature mark this check box The sample script FTPCopy wse uses this action For details on sample scripts see ScriptHelp htm in the Samples subdirectory of this product s installation directory Create Directory Directories are created when files are installed to them Use this action only to create an empty directory on the destination computer To comple...

Page 51: ...p names to distinguish them from service names Services and service groups share the same name space Example If you enter this string ftpsvr httpsvr drc sample you create dependencies on the ftpsvr httpsvr and drc services and the sample group z Service Type Select a service type z Start Service Select the default setting for starting the service z Service Interacts With Desktop Mark this to let t...

Page 52: ...log box in Windows Explorer See Windows help z Support OSD software update checking Open Software Description OSD is a Microsoft technology for describing and distributing software Mark this for the shortcut to work with OSD Custom Billboard This action opens the Custom Billboard Editor which lets you create scalable graphics to display to end users during installation See About Billboards on page...

Page 53: ...to the path For example MAINDIR Help deletes the Help directory if it is empty MAINDIR Help deletes the Help directory if it is empty and also deletes all other empty subdirectories of MAINDIR Display Billboard Not applicable in this product This action displays a bitmap or GRF file during installation if you have set the background to display a gradient on the Screen page Create GRF files scalabl...

Page 54: ...ally you specify graphic files on your computer which are then compiled into the installation Mark this to specify a file from the destination computer With this option you can use variables in the Pathname field above Example INST to indicate the directory from which the installation EXE is running Use this to change graphics without rebuilding the EXE Display Message This action displays a messa...

Page 55: ...ancelled Also use this action to remove a previous progress dialog box To complete the dialog box z Remove previous progress message s Mark this to remove the previous progress dialog box from the screen Marking this disables the rest of this dialog box To display another progress message add another Display Progress Message action z Display a new progress message Message Title Enter the title for...

Page 56: ...r Blue To delete a section and its contents type a section name with no lines after it Example SECTIONNAME To delete a name value pair type the name with an equals sign followed by nothing Example Color Comments lines starting with are not supported Edit Registry This action adds edits or deletes registry keys or values You can create registry entries manually or import a registry file REG To comp...

Page 57: ... when creating the value See Registry Key Settings Dialog Box on page 57 The sample script RunOnce wse uses this action For details on sample scripts see ScriptHelp htm in the Samples subdirectory of this product s installation directory Registry Key Settings Dialog Box This dialog box appears when you double click the Edit Registry action and create or edit a registry key on the Edit Registry Set...

Page 58: ... expanded to its actual value This allows Windows system variables to be embedded Unexpanded String REG_EXPAND_SZ prefix Identifies a value entry as an unexpanded data string To embed a variable name such as WIN you must enclose it with double percents WIN If you only enclose it in single percents then the variable name is expanded to its actual value This allows Windows system variables to be emb...

Page 59: ...t 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 z Delete Key Removes the selected key from the current installation This does not remove it from the destinatio...

Page 60: ...lseIf is true You can use one If Statement with multiple ElseIf Statements to check for multiple conditions To complete the dialog box z If Variable Select a variable from the first drop down list and a comparison method from the second drop down list Expression True means the expression in the Value field below is evaluated according to the conventions for WiseScript expressions See Variables and...

Page 61: ...e the result of the Windows Installer condition The variable is set to 1 if the condition is true or 0 if false z Condition Enter a condition to evaluate This can be any condition that can be evaluated in Windows Installer You can either enter the literal condition or use WiseScript variables enclosed in percent signs See also Get Windows Installer Property on page 71 Set Windows Installer Propert...

Page 62: ...ption sms Note This action uses the Windows ShellExecute call which means that you can open documents as well as applications When the script opens a document the associated application starts The sample scripts FTPCopy wse and Newdisk wse use this action For details on sample scripts see ScriptHelp htm in the Samples subdirectory of this product s installation directory Execute VBScript This acti...

Page 63: ...hen you use the Execute VBScript action in a WiseScript a new tab appears at the bottom of the Installation Script pane When you click this tab the VBScript window appears In this window you can create and edit the VBScript The window is similar to a WiseScript window but has functionality that is appropriate only for a VBScript To edit a VBScript in Script Editor use the following z Actions in th...

Page 64: ...e VB script Add an action to a VBScript in the same ways that you add an action to a WiseScript See Adding an Action to a Script on page 19 Call COM Object Use this action to create a script to call a COM object in the VBScript You can manually enter the script to call a COM object but the Call COM Object action facilitates this process by providing information about the COM objects If the object ...

Page 65: ... action This action uses the VBScript SetVariable function The sample script SetGetVariable wse uses the Set WiseScript Variable action in its VBScript and then uses this variable in the WiseScript For details on sample scripts see ScriptHelp htm in the Samples subdirectory of this product s installation directory Calling a COM Object in a VBScript When you use the Execute VBScript action in a Wis...

Page 66: ...llowed by a period and the type or class of the object If an object is not registered you must enter its ProgID in Creatable Object ProgID 7 In Variable name enter a name for this object You use this name in the VBScript to access it methods and properties 8 Click OK The script to call the selected object appears in the VBScript See also VBScript Actions Exit Installation This action exits the ins...

Page 67: ...example CD ROM z Search Directories Enter a semicolon delimited list of directories to search You can use variables If this field is blank only directories in the PATH environment variable are searched z Remove File Name Mark this to remove the file name from the end of a returned path leaving only the directory name This operation is not performed on the Default Value Get Environment Variable Thi...

Page 68: ...ptional Enter text to be displayed in a separate dialog box to confirm registration If this is blank no confirmation dialog box appears Get Registry Key Value This action puts the value of a registry key into a variable Multi line MULTI_SZ registry values are read into a list format To complete the dialog box z Variable Name Select or enter a variable to store the value z Default Value Optional En...

Page 69: ...ical Memory The amount of physical RAM File Date Time Modified The time and date on which the file that is specified in Pathname was modified File Version Number The version of the file that is specified in Pathname Example 2 5 4 0 If the file does not have a version resource the response is blank Registered Owner Name The user name entered when Windows was installed This is used to pre fill the B...

Page 70: ...er a drive C or a path MAINDIR Readme txt If you enter a path it returns the free space on the drive that the path refers to You can enter a UNC path such as Server_Name Apps Cat exe Current Date Time Regional settings The date and time specified by the destination computer s regional settings UTC File Date Time Modified Same as File Date Time Modified above except in Coordinated Universal Time UT...

Page 71: ...Windows Installer installation Note This action works only if you have Windows Installer Editor installed To complete the dialog box z Dest Variable Select or enter a variable to store the value of a Windows Installer property z Property Name Enter the name of the Windows Installer property in the currently running Windows Installer installation See also Set Windows Installer Property on page 88 E...

Page 72: ...nter the value to be used in the comparison or an expression if the comparison is set to Expression True If you enter variable names do not surround them with percent signs If you enter compiler variables then you must surround them with percent signs 2 Below the If Statement add one or more actions to perform if the variable has the specified value 3 Optional Add an Else or several ElseIf actions...

Page 73: ...LES winword exe Insert Line Into Text File This action edits a text file on the destination computer Use it to edit configuration files that cannot be edited by Edit INI File Add Device to System ini Add Command to Config sys or Add Command to Autoexec bat You can insert a new line at a particular line number or you can search for text and insert a new line before after or in place of the line whe...

Page 74: ... the Install File s script action you might also want to make sure that the destination computer has enough disk space available for these files Do this using the Check Disk Space script action See Check Disk Space on page 44 The results from an Install File s action are put into a variable INSTALL_RESULT See its description in Automatic Run time Variables on page 132 To complete the dialog box z ...

Page 75: ...e See Self Register OCXs DLLs on page 84 z Replace Existing File Select when to replace existing files on the destination computer Always The new file always replaces the old file Never The file never overwrites an existing file Select this for files that should be installed if they are not present but which might be customized by the end user and should therefore not be replaced on re installatio...

Page 76: ...e amount of additional disk space to reserve z Dest Path Enter the directory where the files will be installed example MAINDIR Pictures Open Close Install log Use this action to create an installation log Normally every file that is installed is recorded in the install log The uninstall works by reading Install log from bottom to top and reversing each recorded action The Open Close Install log ac...

Page 77: ...stination variable 2 To complete the dialog box z Source Value Enter the text to be parsed You enter text and variables examples MAINDIR or MAINDIR PICTDIR To include a literal percent symbol use z Pattern Position Enter the character pattern or the character position at which to split Character patterns are case sensitive unless you mark Ignore Case To split at a pattern enter any number of chara...

Page 78: ...athname Specify the path to the WAV or AVI file Start this field with a variable example MAINDIR Movie avi If the multimedia file is used only during installation you can use the Get Temporary Filename action to obtain a random file name then install the file to TEMP TEMPFILENAME z X Position Y Position Indicate the location on a 640 x 480 screen at which an AVI file should be played back Coordina...

Page 79: ... error Prompt for Filename This action prompts the end user to select a file using a standard Open or Save dialog box The complete path of the file or directory is returned in a variable Example Use the returned directory to set the installation directory for a subset of files No file is actually opened or saved by this action This action is included to provide backward compatibility for older Wis...

Page 80: ...Prompt for Text This action displays a dialog box that lets an end user enter a line of text Optionally you can treat the entered text as a path and do verification on it It is included to provide backward compatibility for older WiseScripts In new scripts use custom dialog boxes or dialog box controls to perform the same function To complete the dialog box z Window Name Enter the title for the di...

Page 81: ...tion reads an entry from an existing INI file into a variable Example Obtain a path to a file To complete the dialog box z INI Pathname Specify a complete path to the INI file example WIN Sample ini z INI Section INI files have sections that are delineated by bracketed section names example DIRECTORIES Enter the name of the section that contains the entry to be read without brackets example DIRECT...

Page 82: ... 002 and so on The sample script TextFile wse uses 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 Read Write Binary File This action reads from a binary file to a variable or writes from a variable to a binary file If you write to the file the existing information in the file is not...

Page 83: ...ere appears in Font menus on the destination computer It is added to the Fonts section of the WIN INI file and to the registry Remark This action adds comments or blank lines to the script Remarks are green by default z Comment Enter the comment To add a blank line leave this field blank Rename File Directory This action renames a file or directory on the destination computer This can be an existi...

Page 84: ...earch Depth Enter how deep into subdirectories the search should look A depth of 1 searches only the root directory a depth of 2 searches the root directory and any subdirectories in it and so on A depth of 0 searches the entire drive Use this field cautiously when searching large network volumes A search depth over 3 or 4 can result in a long wait Alternatively prompt the end user to manually loc...

Page 85: ...uble click Set Control Attributes 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 Operation Select how to manipulate the control Th...

Page 86: ...mes cannot be manipulated with this action To access this action 1 Double click a Custom Dialog line in the script The dialog box appears in the Custom Dialog Editor 2 Select View Dialog Script Editor A smaller list of actions appears in the Actions list including this action 3 Double click Set Current Control Control Name This contains all controls in the current dialog box Select a control to se...

Page 87: ...riable Specify a variable A variable name must begin with a letter must contain only numbers letters and underscore characters and must be 28 characters or less It should not be enclosed in signs z New Value Enter the new value of the variable If you enter a variable enclose it in signs The value of a variable can be up to 32 K in size The new value is also affected by the option set in Operation ...

Page 88: ...this action For details on sample scripts see ScriptHelp htm in the Samples subdirectory of this product s installation directory Set Windows Installer Property This action sets the value of a property in the currently running Windows Installer installation You can either hard code a value or set the property to the value of a variable Use this action only in WiseScripts that are called from a Win...

Page 89: ...n the While loop is exited and the next script line is executed To create a While loop 1 Add a While Statement and complete the dialog box While Variable Select a variable from the first drop down list and a comparison method from the second drop down list Expression True means the expression in the Value field below is evaluated according to the rules outlined in Variables and Expressions on page...

Page 90: ...oop To complete the dialog box z Dialog Boxes Displays a list of the Custom Dialog actions inside the wizard loop structure Select a dialog box to edit its setting in the bottom part of the Wizard Loop Settings dialog box z Skip Dialog This lets you set a condition under which a dialog box is skipped You can set different Skip settings for each dialog box Example If one dialog box asks whether to ...

Page 91: ...WiseScript Editor Reference 91 ...

Page 92: ... box text to other languages Typically dialog boxes are not used in WiseScripts that run silently or in WiseScripts that automate Altiris tasks The information in this section is provided in case you open or edit WiseScripts that contain dialog boxes About the Custom Dialog Editor The Custom Dialog Editor is a built in utility Use it to do the following Access the Custom Dialog Editor from Create ...

Page 93: ...se this dialog box in other installation scripts select File menu Save As and save the dialog box as a DLG file in the Dialogs Template subdirectory of this product s installation directory This does not affect the current installation You can add a saved dialog box to another installation by selecting File menu Open in the Custom Dialog Editor See also Editing Dialog Boxes on page 93 Editing Dial...

Page 94: ...ox size in points All dialog boxes in a wizard loop must have the same size as the first dialog box or screen refresh problems occur Note You can also resize the dialog box by clicking its edges and dragging Use the Width and Height fields for more precise sizing Horiz Position Vert Position Select where on the screen to display the dialog box If you select Default the dialog box is centered on th...

Page 95: ...Controls on page 102 Hot Text Text that you can link to actions or a Web page See Adding Hot Text Controls on page 103 List Box A single column of values The end user can select one or more values from the list See Adding List Box Controls on page 104 Play AVI An animation This does not include controls to play stop rewind or fast forward the movie See Adding Play AVI Controls on page 106 Push But...

Page 96: ... Setting Dialog Box Properties on page 94 Adding Check Box Controls Like radio buttons a group of check boxes is considered a single control However unlike radio buttons the end user can select multiple check boxes Alignment and spacing between the individual check boxes is maintained by the Custom Dialog Editor Check boxes are often used to control the installation of components or sub components...

Page 97: ...ialog unit is 1 8 the average height of the font Width Height Specify the exact dimensions of the control in dialog units You can also resize controls by dragging their handles though this is not as precise Components If this is marked the sizes of the components that correspond to the variable specified are displayed to the right of the check boxes Normally you mark this check box only if you are...

Page 98: ...k this to scroll the text entry field horizontally if more text is entered than fits ProgMan Groups Mark this to have the items in the Programs group of the Windows Start menu appear in the combo box Drive List Mark this to display the end user s available drives in the combo box The value returned is a letter and a colon example C Directory Mark this to remove trailing backslashes from the text b...

Page 99: ...eight Specify the exact dimensions of the control in dialog units You can also resize controls by dragging their handles though this is not as precise Note A combo box field should be at least as wide as the longest option in the list See also About Dialog Box Controls on page 94 About Dialog Boxes on page 92 Adding Edit Text Controls An edit text control lets the end user enter and edit text info...

Page 100: ...ter key This option must be used with the Multi line option Border Mark this to include a border around the edit field Uppercase Lowercase Mark one of these check boxes to convert all entered characters to a different case Read Only Mark this to prevent end users from entering data into the field Tab Stop Mark this to let end users use the Tab key to give focus to this field Make sure this is mark...

Page 101: ... to be displayed on a dialog box Graphic controls are static controls which means that the end user cannot make changes to them 1 Open the dialog box in the Custom Dialog Editor See Editing Dialog Boxes on page 93 2 Select Add menu Graphic in the Custom Dialog Editor The Graphic Control Settings dialog box appears 3 Complete the dialog box Graphic Pathname Specify the path for the bitmap graphic t...

Page 102: ...s 3 Complete the dialog box Group Box Text Enter a name to appear at the top of the group box Example On the Group Box Control Settings dialog box Placement is the group box text 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 Transparent Background Mark this to make the background f...

Page 103: ...ontrol 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 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 Wiza...

Page 104: ...fy 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 See 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 A horizontal dialog unit is 1 4 the average width of the font and a vertical dialog unit is 1 8 the average hei...

Page 105: ...ree and disk drive list List Box with Checkboxes A list containing a check box for each item allowing multiple items to be selected simultaneously Components If this list box control is being used to specify the components to be installed and if the components have sub components enter the names of sub component variables separated by commas Sort Mark this to sort the list box items in ascending o...

Page 106: ...sually 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 You can also resize controls by dragging their handles though this is not as precise 4 Click OK See also About Dialog Box Controls on page 94 About Dialog Boxes on page 92...

Page 107: ...perform an action such as saving the dialog box data closing the dialog box or advancing to the next dialog box Each dialog box must have at least one button that allows the end user to exit the dialog box 1 Open the dialog box in the Custom Dialog Editor See Editing Dialog Boxes on page 93 2 Select Add menu Push Button The Push Button Control Settings dialog box appears 3 Complete the dialog box ...

Page 108: ...rted See 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 See Creating a Custom Dialog Box Script on page 118 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 ...

Page 109: ... variable so that some of its options are disabled those options become enabled if the end user proceeds to the next dialog box and uses the Back button Mark this check box to cause any lowercase letters in the variable to stay in the variable which makes disabled options retain their disabled state even when the end user navigates between dialog boxes If this check box is cleared the variable tak...

Page 110: ...s which means that the end user cannot make changes to them 1 Open the dialog box in the Custom Dialog Editor See Editing Dialog Boxes on page 93 2 Select Add menu Rectangle The Frame Rectangle Control Settings dialog box appears 3 Complete the dialog box Type Select Frame or Rectangle Operating systems used to treat rectangles and frames differently but now there is no longer any difference Bevel...

Page 111: ...Complete the dialog box Text Enter the text up to a maximum of 511 characters To start a new line press Ctrl Enter Enter variable names surrounded by percent signs to display the application s name or other information See Variables and Expressions on page 28 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 thi...

Page 112: ...omponent set Disk This variable represents the Disk Space Remaining on the installation drive Select the MAINDIR variable as it keeps track of free space in the installation directory 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 See Aligning and Spacing Dialog Box Controls o...

Page 113: ...he file must exist in this directory You can also use variable substitution Variables Added Any script variables that were added by the executable program using a DDE link are displayed Note This field is retained for backward compatibility only Window Size You can force the application to run in a maximized or minimized window or allow it to run in its default normal window Wait for Program to Ex...

Page 114: ...og Box Controls on page 94 Setting Tab Order of Dialog Box Controls on page 114 Setting Dialog Box Properties on page 94 Setting Tab Order of Dialog Box Controls Tab order refers to the sequence in which controls are selected when the end user presses the Tab key By default the tab order is the order in which the dialog box controls were created 1 Open the dialog box in the Custom Dialog Editor Se...

Page 115: ...oxes contain a graphic that is not part of the individual dialog boxes It is specified on the Wizard Loop Settings dialog box where you configure the Wizard Loop script action You can change this graphic and turn it off for selected dialog boxes To change the bitmap that applies to all wizard dialog boxes 1 In Script Editor double click the Wizard Loop script line There are two Wizard Loop script ...

Page 116: ... the user selected the first option If Retain Disabled is not marked the radio button s variable is set to A That is why all four radio buttons are enabled when the end user backs up because the variable does not contain a b c or d See also Solutions for Dialog Box Problems on page 115 About Custom Dialog Box Sets A single Custom Dialog script action can display a set of related dialog boxes You d...

Page 117: ...e dialog boxes in the set are saved simultaneously See also Configuring Dialog Box Set Properties on page 117 About Custom Dialog Box Sets on page 116 Configuring Dialog Box Set Properties On the Dialog Set Properties dialog box you name the dialog box set and specify the variable on which to base the display of this set 1 Open a dialog box from the set in the Custom Dialog Editor See Editing Dial...

Page 118: ...dialog box INIT updating of information displayed on the dialog box UPDATE and verification of the validity of the contents of the dialog box VERIFY Additional events whose names you define can be generated by marking the Execute Named Event option on the settings dialog box of push button or hot text controls To handle the generated events you create a conditional structure in the dialog box scri...

Page 119: ...e 72 Parse String on page 77 Prompt for Filename on page 79 Read INI Value on page 81 Remark on page 83 Set Control Attributes on page 85 Set Control Text on page 85 Set Current Control on page 86 Set Variable on page 87 While Statement on page 89 See also Creating a Custom Dialog Box Script on page 118 Dialog Box Script Examples on page 119 Dialog Box Script Examples To see an example of a dialog...

Page 120: ...y field or control is changed and the variable associated with each field or control contains its current value suitable for testing in a script z Have the VERIFY event check the contents of one or more fields on the dialog box and reject the end user s entry if it is not valid VERIFY is called when the end user tries to exit the dialog box Set the DLG_EVENT_TYPE variable to an empty string within...

Page 121: ...tools you need to work in the Custom Billboard Editor are accessible from its menu bar or the icons on the toolbar See also 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 the Custom Billboard Editor The Custom Billboard Editor provides a basic set of drawing tools for creating billboards You can create ...

Page 122: ...xporting and importing billboards from the File menu in the Custom Billboard Editor There is no New command on the File menu because a new blank billboard screen appears when you open the Custom Billboard Editor The commands on the File menu are z Open Opens a billboard from a GRF file importing it to the current installation z Save As Saves a billboard to a GRF file so you can share the file with...

Page 123: ...ut the Custom Billboard Editor on page 121 Opening and Saving Custom Billboards on page 122 Editing Billboard Text Objects Text you place on a billboard using the Text tool is editable Each text object can use only one font size and style 1 Access the Custom Billboard Editor See Accessing the Custom Billboard Editor on page 121 2 Select Add menu Text and drag the dimensions of the object in the bi...

Page 124: ... the object in the billboard editor The Line Settings dialog box opens 3 Complete the dialog box Line Style Choose the texture for the line Line Arrows Determines which ends of the line will have arrowheads Line Direction Determines whether the line should connect the lower left corner of the bounding rectangle to the upper right corner or the upper left to the lower right Line Width The width of ...

Page 125: ...e and fill 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 4 Click OK See also Adding Objects to a Billboard on page 122 Editing Billboard Polygon Objects The polygon object consists of a series of points that are connected by lines 1 Access the Custom Billboard Editor See A...

Page 126: ...rtant that they all be created using the same graphics editor so the files share a common color palette Otherwise the colors can shift when the bitmaps display on screen Note Imported bitmap objects can appear distorted when the billboard is run with the Scale to Screen option enabled on the Billboard Settings dialog box This is not true of objects created in the Custom Billboard Editor 1 Access t...

Page 127: ...Script Editor 2 Use Shift click to select multiple objects 3 Select one of the following commands from the Layout menu Align Left Align Right Align Top Align Bottom Space Evenly Down Distributes the selected objects vertically between the topmost and bottommost objects Their horizontal position is not changed Use Align Left or Align Right to move them into a column Space Evenly Across Distributes ...

Page 128: ... to 0 The oldest image is removed first Build Effect Specify a transition effect Center Horizontal Place at Right Scale to Screen Mark this for the image to cover the same percentage of the screen regardless of screen size Hide Progress Bar Mark this to hide the progress bar during image display Center Vertical Place at Bottom Tile Background Mark this check box to repeat the graphic edge to edge ...

Page 129: ...the accuracy of the installation It also helps technical support because end users who have problems installing can email the installation log Use the Add Text to Install log script action to add your own commands to the log You can use it to comment the install log or to customize your uninstall See Add Text to INSTALL LOG on page 35 See also About Troubleshooting a WiseScript on page 129 File Re...

Page 130: ...ferent location than the existing system file consider installing it to the existing location and changing your application to look for it in the existing location z You can turn off version checking for the file not recommended Do this by selecting an option from the Replace Existing File drop down list other than Check File z Bypass the default version checking code By default WiseScript calls a...

Page 131: ...E directory for 16 bit systems _BDEWIN32DIR_ BDE directory for 32 bit systems _BDEWIN32INST_ BDE custom directory for use on systems that previously did not have BDE installed _BDEWIN32LANG_ BDE language code _BDEWIN32OPT_ BDE options _LOGFILE_PATH_ Path to the Install log file _ODB16_ ODBC directory for 16 bit systems _ODBC32_ ODBC directory for 32 bit systems _SYS_ The Windows system directory o...

Page 132: ...ng that updates to the BDE get installed into the correct directory We recommend that you do not change this variable CMDLINE The command line options passed to the installation EXE CRLF Holds a carriage return linefeed character for use in making lists and separating items in lists DISK_NUMBER read only The number of the disk currently being used by the installation We recommend that you do not c...

Page 133: ...tten or null if the edit was successful Execute Program returns the numeric exit code return code from the called application LANG The language the end user selects in a multi language installation We recommend that you do not change this variable PASSWORD Set this to the password to be used for password protected files Setting this variable disables the password prompt Set this for distributions ...

Page 134: ...e title of the installation BACKUP Path to the end user s selected backup directory on the destination computer BRANDING If this is set to 1 user information is written to CUSTDATA INI in the directory containing the installation EXE CDESKTOPDIR Common desktop directory for adding shortcuts to desktop CGROUPDIR Path to the directory where shortcuts for all end users are stored on Windows operating...

Page 135: ...DE is not blank the return code from the installation is set to the contents of PROCEXITCODE This lets you write conditional code based on the results of an external program Be sure to mark the Wait for Program to Exit check box on the Execute Program Settings dialog box for the Execute Program action PROGRAM_FILES Windows Program Files directory STARTMENUDIR Directory of the Start menu for adding...

Page 136: ... Local Settings History LOCALAPPDATA C Documents and Settings User Local Settings Application Data LOCALSETTINGS C Documents and Settings User Local Settings MYMUSIC C Documents and Settings User My Documents My Music MYPICTURES C Documents and Settings User My Documents My Pictures MYVIDEO C Documents and Settings User My Documents My Videos NETHOOD C Documents and Settings User NetHood PERSONAL ...

Page 137: ...elp htm in the Samples subdirectory of this product s installation directory Symbols Functions TEMPLATES C Documents and Settings user Templates TEMP Folder where temporary files can be created C DOCUME 1 User LOCALS 1 Temp USERPROFILE Location of the current user s profile C Documents and Settings User Addition Subtraction Multiplication Division Left str position Returns the left portion of a st...

Page 138: ...fore windows d returns win After str1 str2 Returns the portion of a string str1 after the indicated substring str2 Example After windows d returns ows Len str Returns the length of a given string Do not include the character because this operator does not return a string Lcase str Converts all characters in a string to lowercase Ucase str Converts all characters in a string to uppercase Ltrim str ...

Page 139: ...uild process 1 Enter the following command line statement into a batch file or program that has the ability to run command line statements product_installation_directory Wise32 exe c s C Development Application wse 2 Use Scheduled Tasks in Control Panel to schedule the running of the batch file Note To test the options without the scheduling program select Windows Start menu Run type cmd click OK ...

Page 140: ... restarts M Runs the installation in manual mode prompting for system directories examples Windows System M file name Specifies a values file for installation For information on reading variables see Set Variable on page 87 M1 Displays the name of each self registering OCX or DLL as it is registered M2 Reserved for internal use by WiseScript Editor during debugging sessions M5 dir_name During inst...

Page 141: ...le at the end of the command line after all other options In the example above the title would be Application Uninstall See also Command Line Options on page 138 S Silent mode The uninstall proceeds silently with no splash screen no dialog boxes and no end user choices R Rollback mode U Removes the Select Uninstall Method dialog box which means the end user does not see options for a custom automa...

Page 142: ...script 53 arranging object 127 bitmap adding 126 editing text 123 ellipse adding 124 exporting 122 importing 122 line adding 124 location 127 moving object 127 number to display 128 object adding 122 opening 122 overlapping object 127 polygon adding 125 properties 127 rectangle adding 124 resizing object 127 saving 122 scaling to screen 128 settings 127 slowing down 128 timing the display 128 tran...

Page 143: ...tom dialog box set See dialog box set Custom Dialog Editor about 92 accessing 92 D data source ODBC 48 date time file modified getting 69 getting four digit year 70 date time current getting 69 getting four digit year 70 debugging commenting out script lines 21 Delete File s 52 dependency service 51 DESKTOPDIR 134 development process streamlining 22 device 37 dialog box Also see dialog box set ani...

Page 144: ...th 67 First element of structure 42 font 83 FONTS variable 132 four digit year 70 free disk space getting 70 FTP copying files through 48 function DLL function 38 sending parameters 40 function VBScript 64 G Get Environment Variable 67 Get Name Serial Number 68 Get Registry Key Value 68 Get System Information 69 Get Temporary Filename 71 Get Windows Installer Property 71 Get WiseScript Variable 65...

Page 145: ...pt for file name 79 for text 80 properties getting 71 setting 88 push button control 107 R radio button control adding to dialog box 109 problem with disabling 116 Radio Button Dialog 81 Read INI Value 81 Read Update Text File 81 Read Write Binary File 82 reboot at script completion 133 rectangle control on dialog box 110 rectangle in billboard 124 REG file importing 56 importing to virtual layer ...

Page 146: ...and line 140 text adding to billboards 123 finding in script 21 manipulating 77 prompting for 80 reading from file 81 updating in file 81 text control 111 text file displaying in dialog box 55 editing 73 TLB self registering 49 75 troubleshooting dialog box 115 installations 129 TrueType font 83 TTF file 83 U Ucase 138 UNC path getting 70 underscore in compiler variable 29 UNINSTALL_LANG 134 UNINS...

Page 147: ...nguage 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 disabling check box 116 disabling radio button 116 Wizard Loop action 90 adding dialog box 52 word 40 word pointer 41 ...

Page 148: ...WiseScript Editor Reference 148 ...

Reviews: