other countries. Other names may be trademarks of t heir respective owners.
The product described in this document is distributed under licenses restricting its use, copying, distribution, and decompilation/reverse
engineering. No part of this document may be reproduced in any form by any means without prior written authorization of Symantec
Corporation and its licensors, if any.
THE DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE
DISCLAIMED, EXCEPT TO THE E XTENT THAT SUCH DISCLAIMERS ARE HELD T O BE LEGALLY INV ALID . SYMANTE C 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 IS SUBJECT TO CHANGE WITHOUT NOTICE.
The Licensed Software and Documentation are deemed to be commercial computer software as defined in FAR 12.212 and subject to
restricted rights as defined in FAR Section 52.227-19 “Commercial Computer Software - Restricted Rights” and DFARS 227.7202, “Rights in
Commercial Computer Software or Commercial Computer Software Documentation”, as applicable, and any successor regulations. Any use,
modification, reproduction release, performance, display or disclosure of the Licensed Software and Documentation by the U.S. Government
shall be solely in accordance with the terms of this Agreement.
Symantec Corporation
350 Ellis Street
Mountain View, CA 94043
http://www.symantec.com
WiseScript Editor Reference2
Page 3
Technical Support
Symantec Technical Support maintains support centers globally. Technical Support’s
primary role is to respond to specific queries about product features and functionality.
The Technical Support group also creates content for our online Knowledge Base. The
Technical Support group works collaboratively with the other functional areas within
Symantec to answer your questions in a timely fashion. For example, the Technical
Support group works with Product Engineering and Symantec Security Response to
provide alerting services and virus definition updates.
Symantec’s maintenance offerings include the following:
zA range of support options that give you the flexibility to select the right amount of
service for any size organization
zTelephone and/or web-based support that provides rapid response and up-to-the-
minute information
zUpgrade assurance that delivers software upgrades
zGlobal support purchased on a regional business hours or 24 hours a day, 7 days a
week basis
zPremium 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.
Contacting Technical Support
Customers with a current maintenance agreement may access Technical Support
information at the following URL:
www.symantec.com/business/support/
Before contacting Technical Support, make sure you have satisfied the system
requirements that are listed in your product documentation. Also, you should be at the
computer on which the problem occurred, in case it is necessary to replicate the
problem.
When you contact Technical Support, please have the following information available:
zProduct release level
zHardware information
zAvailable memory, disk space, and NIC information
zOperating system
zVersion and patch level
zNetwork topology
zRouter, gateway, and IP address information
zProblem description:
Error messages and log files
WiseScript Editor Reference3
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/
Customer Service is available to assist with non-technical questions, such as the
following types of issues:
zQuestions regarding product licensing or serialization
zProduct registration updates, such as address or name changes
zGeneral product information (features, language availability, local dealers)
zLatest information about product updates and upgrades
zInformation about upgrade assurance and maintenance contracts
zInformation about the Symantec Buying Programs
zAdvice about Symantec’s technical support options
zNontechnical presales questions
zIssues that are related to CD-ROMs or manuals
Support agreement resources
If you want to contact Symantec regarding an existing support agreement, please
contact the support agreement administration team for your region as follows:
Asia-Pacific and Japancustomercare_apac@symantec.com
Europe, Middle-East, and Africasemea@symantec.com
North America and Latin Americasupportsolutions@symantec.com
Additional enterprise services
Symantec offers a comprehensive set of services that allow you to maximize your
investment in Symantec products and to develop your knowledge, expertise, and global
insight, which enable you to manage your business risks proactively.
Enterprise services that are available include the following:
WiseScript Editor Reference4
Page 5
Managed ServicesManaged services remove the burden of managing and
monitoring security devices and events, ensuring rapid response
to real threats.
Consulting
Services
Educational
Services
To access more information about Enterprise services, please visit our Web site at the
following URL:
www.symantec.com/business/services/
Select your country or language from the site index.
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.
Educational Services provide a full array of technical training,
security education, security certification, and awareness
communication programs.
zAbout WiseScript on page 10
zWhy Use WiseScript? on page 11
zWiseScript Benefits on page 12
zStarting the Software on page 12
zThe Product Interface on page 13
zCompiling, Testing, and Running a WiseScript on page 13
zProduct 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 Altiris® Client Management Suite™ software.
WiseScript Editor Reference10
Page 11
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. This is
different from using Altiris® Inventory Solution® software, for example, which can
collect snapshot information about a computer’s state but cannot take immediate action.
In addition, the computer’s state might change between the time you take the snapshot
and when you can analyze the data and schedule a task to take action. A WiseScript
collects and analyzes the data and takes action in real time.
When you have a task that you cannot easily perform with your other tools, reach for
WiseScript. You can write a WiseScript to quickly solve an urgent problem, and you can
create a library of WiseScripts to resolve common proble ms and perform routine
maintenance. Use Altiris® Software Delivery Solution™ software to deploy your
WiseScripts on an as-needed or regularly scheduled basis.
Scenarios for Using WiseScript
zAn end user reports that their default browser does not open when they click on an
HTML file. 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.
zYou 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 of the file, y ou can create one Softw a re Deliv ery t ask
that runs a WiseScript. The WiseScript finds the version of Windows that is running
on each computer and installs the correct .DLL file for that version.
zYou want all company computers to display a corporate desktop theme. You can
write a WiseScript to:
Check the Windows version on the computer.
Create a theme directory.
Register the path to the theme directory in the registry, using the WiseScript
conditional logic to create the registry key in a different location depending on
the Windows version.
Install the theme file in its directory.
Additional WiseScript Examples
Following are just a few of the tasks you can accomplish w ith WiseScript. F or samples of
some of these scripts, see the article Performing System Administration Tasks With
WiseScripts in the Altiris Knowledgebase (Article #27374).
zMove files and directories.
zModify a machine resource (example: registry key or .INI file).
zLocate and delete a file and its directory (example: to remove a spyware program).
zFree disk space by clearing the Temp directory, the Recycle Bin, or the Internet
cache.
zFind the current Windows version.
WiseScript Editor Reference11
Page 12
zFind and report system information and take action depending on the results.
zMap a network drive.
zAssign license numbers from a text file.
WiseScript Benefits
WiseScript is a high-level scripting language that consolidates dozens or hundreds of
lines of code into predefined script actions.
What Makes WiseScript Unique
zEasy to learn
WiseScript supports a point-and-click method of scripting. The script author is
prompted for the parameters needed by each script action, so a script can be
created and tested very quickly. The script is displayed in clear, English-like
statements. For those who need additional flexibility and control, WiseScript
provides advanced features (examples: IF blocks, WHILE loops, UI dialog boxes).
zNo runtime needed
WiseScripts are compiled into self-contained .EXEs that do not require an agent or
runtime files on the destination computer.
zCompact size
A WiseScript .EXE is small in size (about 100 KB). If a script uses any files that may
not be on the destination computer, it can compress those files into the .EXE.
(Example: A script that detects and removes spyware might temporarily install
Kill.exe on the destination computer while the script is running.)
zBuilt-in rollback
WiseScripts can be rolled back after they are executed on the destination computer.
zUser interface
WiseScripts can incorporate any type of dialog box to either inform the end user or
prompt for input.
zWiseScript is powerful
In addition to the dozens of predefined actions, WiseScripts can call VBScripts and
DLL functions, making it possible to use any Windows system call.
zWiseScript is fast
Because the WiseScript engine is written in C++, when you build a WiseScript, you
are building a C++ program. A WiseScript executes faster than a VBScript that
performs the same operation.
zWiseScript is extensible
You can streamline your scripting process by creating your own script actions for
tasks that you perform frequently. To create a user-defined action, create a
WiseScript .WSE (project file) and save it in the Actions subdirectory of the
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 Reference12
Page 13
1. Select Start menu > Programs > Altiris > WiseScript for NS.
By default, WiseScript Editor opens the most recently used script. To open a blank
script, select File menu > New.
See also:
About Script Editor on page 15
The Product Interface
WiseScript Editor has the following view:
zScript Editor
Script Editor provides a powerful and easy-to-use scripting environment based on
the WiseScript™ scripting language.
See 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
T o test an installation, use the Compile, Test, and Run buttons at the bottom of the main
window.
zCompile
Click Compile to build a single executable file that contains the ins tallation script as
well as all the files needed for the 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.
zTest
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 previous script
lines, then test mode might fail. Example: If an Install File(s) line copies a ReadMe
to the Temp directory and a second script line tries to open ReadMe, the second
script line fails because the ReadMe is not in the Temp directory.
zRun
Click Run to execute the installation just as it would execute on the destination
computer. Files are installed on your computer and your system is modified.
Creating a Portable Project
You can create a portable WiseScript project that contains all of the fil es in a WiseScript
including its source files. A portable project is a self-extracting .EXE. Use it to:
zEasily move WiseScript projects from one computer to another without having to
copy source files.
WiseScript Editor Reference13
Page 14
zShare WiseScript projects with others, who can then open and edit your WiseScript
with all of its source files.
To create a portable project
1. Select File menu > Create Project Package.
2. Complete the Create Project Package dialog box:
Project Name
Enter a name for the portable project. When the portable project .EXE is run, it
extracts the project’s files and puts them in a directory with this name.
Add default scripts that are included in this WiseScript
Mark this to add any default WiseScripts or VBScripts that are included in the
WiseScript. These default scripts are in the WiseScript Editor\Actions or
WiseScript Editor\Include directories. If you have modified these scripts and
they are included 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 proficient in the use of the Windows operating
system. If you need help using the operating system, consult its user documentation.
Use the following sources of information to learn about this product.
Online Help
The online help contains detailed technical information and step-by-step instructions for
performing common tasks.
Access help in the following ways:
zTo display context-sensitive help for the active window or dialog box, press F1.
zTo select a help topic from a table of contents, index, or search, select Help menu >
Help Topics.
WiseScript Editor Reference14
Page 15
Chapter 2
Using Script Editor
This chapter includes the following topics:
zAbout Script Editor on page 15
zThe Script Editor Window on page 15
zTypes of Scripts on page 18
zProcess for Creating a Script on page 19
zAdding an Action to a Script on page 19
zEditing Scripts on page 20
zAbout User-Defined Actions on page 22
zBasic Scripting Concepts on page 26
About Script Editor
All WiseScript products contain the Script Editor scripting en vironment. The Script Editor
scripting environment consolidates numerous lines of code into predefined script
actions. You don’t need to memorize commands because Script Editor supports a pointand-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.
See also:
The Script Editor Window on page 15
Types of Scripts on page 18
Adding an Action to a Script on page 19
Editing Scripts on page 20
The Script Editor Window
The Script Editor window contains all the tools necessary to develop and edit
WiseScripts. To access Script Editor, click Script Editor at the lower left of the main
window.
WiseScript Editor Reference15
Page 16
Actions list
Script 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. You can also create your own action groups.
See Customizing the List of Actions on page 17.
Script List
This list 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:
zCompiler Variable Items - gray
zInclude Script Items - black
zInstall/Copy File Items - black
zLogic items - blue
zNew Variable Values - red
zRemarks - gre en
WiseScript Editor Reference16
Page 17
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
zTo show or hide script line numbers, select View menu > Line Numbers.
zConnection lines connect the beginning and end of an If block or a loop. To show or
hide connection lines, select View menu > Connection Lines.
See also:
About Script Editor on page 15
Customizing the List of Actions
Script Editor contains two default action groups: All Items and Custom. You can add
up to 10 additional groups and add any actions that appear in the All Items group to
any other group. 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.
3. Select the actions to include in the group and click OK.
The new action group appears with the actions you selected.
To edit an action group
1. Click the title bar of the action group.
You cannot edit or remove the All Items group.
2. Right-click below the action group title bar and select Add/Remove Items.
The Select Items for Group dialog box appears.
3. Add, delete, or move group items and click OK.
You can customize the Actions list further by creating user-defined actions.
See About User-Defined Actions on page 22.
See also:
The Script Editor Window on page 15
About Script Editor on page 15
WiseScript Editor Reference17
Page 18
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:
zMainline
The primary script that’s executed during the normal installation process. It
contains placeholders for Cancel and Exit scripts. When you open a script, that script
is considered the “main installation script,” and is on the first tab below the
installation script.
zExit
The script that’s executed when the installation is complete, or when an Exit
Installation script command is executed. If you create a user-defined action, you
store its custom dialog box here.
See Creating a User-Defined Action on page 22.
zCancel
The script that’s executed when the end user cancels the installation. Because some
files might already be installed when the end user cancels, the Cancel script
contains the include script, rollback.wse, which returns the destination computer to
its pre-installation state.
Include Scripts
Include scripts are added to an installation with an Include Script action.
See Include 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 installati ons, because you can develop a
library of WiseScripts that perform very specific functions. You can re-use these
specialized scripts in future installations and easily share them with colleagues.
VBScripts
VBScripts are added to an installation with an Execute VBScript action.
See Execute VBScript on page 62.
VBScripts can be included either in the main installation script or in include scripts. At
run time, VBScripts are run when the Execute VBScript action that re ferences them is
encountered. For each Execute VBScr ipt action in a WiseScript, a new tab appears at the
bottom of the Installation Script pane. When you click this tab, a VBScript window
appears.
See Editing a VBScript on page 63.
By adding VBScripts, you can greatly expand the functionality of WiseScripts because
you can use all the scripting capabilities of VBScrip t (example: arr ays and subfunctions).
Adding VBScripts can also save you time because you can use scripts that others have
created.
WiseScript Editor Reference18
Page 19
See also:
The Script Editor Window on page 15
About Script Editor on page 15
Process for Creating a Script
1. Open WiseScript Editor.
2. If a previous WiseScript opens, select File menu > New.
If the New Installation File dialog box appears, select Blank Script and click OK.
3. Add script actions.
See Adding an Action to a Script on page 19.
Each action opens a dialog box that lets you enter parameters.
Note
Context-sensitive help is available for every script action dialog box; press F1
when the dialog box appears.
You can drag actions to rearrange them in the script.
You can comment scripts for easier modification later.
4. Save the WiseScript. The project file format is .WSE.
5. Compile the WiseScript by clicking Compile at the lower right of the main window.
This creates an .EXE.
6. Test 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 th e lower ri ght of th e main
window. This will make changes to your computer.
7. If you are using WiseScript within the Altiris® Notification Server™ software, you
can use the Altiris Console to:
a. Create a Software Delivery package that runs the WiseScript program.
b. Configure a Software Delivery task to run the package on a specific collection of
computers.
c.Schedule the task as needed.
See the appropriate Altiris documentation at www.altiris.com/Support/
Documentation.aspx.
Adding an Action to a Script
in Script Editor, do any of the following:
zFrom the Actions list in the left pane, drag an action onto a line in the Installation
Script list in the right pa ne. The new action appears above the line that is
highlighted when you drop the action.
WiseScript Editor Reference19
Page 20
zClick in the script and double-click the action in the Actions list to place the new
zClick in the script and start typing the first few letters of the action name. As you
When you add an action, a dialog box appears that lets you set the parameters for the
action unless it does not require parameters. When you add a Custom Dialog or Custom
Billboard action, the appropriate editing environment opens.
Some actions come in pairs. (Example: When you add an If action, you must also add an
End action at the end of the condition block.) Script Editor indents actions inside these
pairs.
Use the same methods to add an action to a VBScript.
See VBScript Actions on page 64.
See also:
The Script Editor Window on page 15
Editing Scripts on page 20
Editing Scripts
action above the line you clicked.
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.
When the action you want is the current item in the list, press Enter.
To edit a WiseScript 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 63.
Editing Script Action Parameters
Double-click the action in the script. For most script actions, a dialog box appears so you
can configure its parameters. When you double-click a Custom Billboard or Custom
Dialog action, the appropriate editing environment opens.
Copying and Pasting Script Lines
1. Select one or more script lines.
2. Select Edit menu > Cut or Copy.
3. If you’re copying the lines to another installation, open that installation script in
Script Editor.
You cannot open multiple scripts in the same instance of WiseScript Editor unless it
is an include script or VBScript. However, you can open multiple instances of
WiseScript Editor, and open different scripts in each.
See Customizing the List of Actions on page 17.
4. Select a line in the script above which to place the lines you copied, then select Edit
menu > Paste.
The lines appear above the line you selected.
WiseScript Editor Reference20
Page 21
Duplicating or Moving Script Lines
1. Select one or more script lines.
2. 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 execute d.
1. Select one or more lines.
2. Select Edit menu > Comment.
The commented out lines appear in green and begin with “/*”. To reactivate
commented out lines, select the lines and select Edit menu > Comment.
Saving a Script to a Text File
This text file is for viewing and printing only. You cannot make changes in the text file
and import it back into Script Editor.
1. Select File menu > 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 the text to find.
This function searches the visible text in the script lines as well as the parameters
that are associated with the script lines.
3. (Replace function only) Enter the replacement text.
You can replace a command’s parameters and editable text, but not the command
itself.
4. To search for the text across all WiseScripts, mark Search Across Include Scripts.
For information on include scripts, see Customizing the List of Actions on page 17.
5. Click Find Next, Replace, or Replace All.
See also:
The Script Editor Window on page 15
WiseScript Editor Reference21
Page 22
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 hav e written a section of script that opens a W eb page on your company’ s
Web site. Some of the script lines search the registry to determine the default browser
on the destination computer, and other lines open the browser to the specified URL. To
avoid having to copy and paste this section of script into new WiseScripts that you
create, you can make it a user-defined action that will be available in all new WiseScripts
that you develop.
User-defined actions appear in the Actions list in Script Editor along with the predefined
script actions.
You create a user-defined action by creating a separate WiseScript and saving it in the
Actions subdirectory of this product’s installation directory.
See Creating a User-Defined Action on page 22.
When you create a user-defined action, specify the following in the 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, you can specify the new URL each time you use the action.
Script Lines
The script lines that perform the action are the functional part of the action. Example:
For an action that opens a URL in the destination computer’s browser, the script lines
determine the default browser and opens the Web page.
Format of the Script Line
The format of the script line refers to how the script line looks after you add the action t o
your script. You enter a combination of text and variables to define the format.
See also:
Creating a User-Defined Action: Tutorial on page 24
Adding an Action to a Script on page 19
Creating a User-Defined Action
This procedure describes the general steps for creating a user defined action. It does not
contain details on what kind of action to create, or what to enter for the parts of the
user-defined action.
WiseScript Editor Reference22
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
1. Select File menu > New.
In Script Editor, you should see a completely empty script.
2. If your user-defined action includes a dialog box where you can enter options for the
action, create the dialog box.
a. From the Event drop-down list in Script Editor, select Exit.
b. Add a Custom Dialog action to the Exit script, and create your dialog box in the
Custom Dialog Editor.
See About the Custom Dialog Editor on page 92.
Note
To add a drop-down list on your custom dialog box that contains all the
WiseScript variables currently defined in this script, set the list to display the
compiler variable %_VAR_LIST_%. It contains all the non-compiler variables.
3. From Event, select Mainline.
The main script reappears.
4. Add script lines that perform the function of your user-defined script action.
This might be something as simple as a single line that calls a .DLL, or it could be a
complex set of script lines that perform an advanced function.
5. In Title, enter a combination of text and variables to define the format of the scri pt
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 script, the dialog box appears and
you enter www.sample.com/support.htm for the URL. The script line for your userdefined action appears in the format you specified, except that it shows the
variable’s value instead of the variable name. It displays: Display HTML File
www.sample.com/support.htm.
6. Save the script file in the Actions subdirectory of this product’ s installation direct ory.
Your new action does not appear in the appears in the Actions list in Script Editor
until you close and re-open WiseScript Editor.
7. Test the new user-defined action:
a. Close WiseScript Editor.
b. Open WiseScript Editor and select File menu > New > Empty Project.
c.In Script Editor, double-click your user-defined action in the Actions list. If it
includes a dialog box, the dialog box opens. Complete the dialog box and click
OK.
d. Save the project and click Test to test your script.
WiseScript Editor Reference23
Page 24
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
1. Select File menu > New.
In Script Editor, you should see a completely empty script.
2. Select File menu > Save.
The Save As dialog box appears.
3. Save the script file in the Actions subdirectory of this product’ s installation directory.
Name the file Wait.
Your new action appears in the Actions list in Script Editor after you close and reopen WiseScript Editor.
To create a dialog box for the action
1. From Event, select Exit.
To 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 “Enter Time to Wait” and click OK.
The Custom Dialog Editor opens.
4. Click on the toolbar.
The Text Control Settings dialog box appears.
5. In Text, enter “Milliseconds to Wait” and click OK.
6. Click on the toolbar.
The Edit Text Control Settings dialog box appears.
7. Enter the following on the dialog box and click OK.
In Default, enter %WAIT_TIME%.
In Variable, enter WAIT_TIME.
8. Click on the toolbar.
The Push Button Control Settings dialog box appears.
9. Enter the following on the dialog box and click OK.
In Label, enter OK
Mark the Return to Previous Dialog action.
WiseScript Editor Reference24
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. Rearrange the dialog box so that it looks something like this:
13. When you finish editing the dialog box, select File menu > Save Changes and exit.
To create a script for the action
For the Wait action, you write a very simple script. The script calls kernel32.dll, a
Windows system .DLL that contains a function that stops execution of the current
application for the specified number of milliseconds. To 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 with variable parameter list
Mark this option and click Add.
Complete the DLL Parameter Settings dialog box that appears and click OK:
From Parameter Type, select dword.
From Value Source, select Constant.
In Constant Value, enter %WAIT_TIME%.
4. Click OK on the DLL Parameter Settings dialog box.
5. Click OK on the Call DLL Function dialog box.
6. In Title (located above the Actions list), enter “Wait %WAIT_TIME% Milliseconds.”
This determines how the script line looks in the script.
WiseScript Editor Reference25
Page 26
7. Save the scrip t.
It should already be named Wait.wse and should be in the Actions subdirectory of
this product’s installation directory.
To test the action
1. Close WiseScript Editor.
2. Open WiseScript Editor and select File menu > New > Empty Project and click OK.
An empty project contains a default script in Script Editor.
3. In the Installation Script list, click the top line in the script.
4. In the Actions list, double-click the Wait action.
The dialog box you created for your user-defined action appears.
5. Enter 9000 and click OK.
A new script line appears in your script that looks like this:
Wait 9000 Milliseconds
9000 milliseconds equals nine seconds.
6. Save the scrip t.
7. Click Test to test your script.
After the blue screen appears, there 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 script execution.
Example: To display a detailed billboard for several seconds, you could place a Wait
action immediately after the Display Billboard script line.
See also:
About User-Defined Actions on page 22
Basic Scripting Concepts
If you do not have a basic understanding of scripting concepts, you should become
familiar with them before trying to write a WiseScript.
See:
About Script Editor on page 15
Conditions and Loops on page 27
Variables and Expressions on page 28
Compiler Variables and Run-time Variables on page 29
Anatomy of an Installation Script on page 30
WiseScript Editor Reference26
Page 27
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.
Loops specify script actions that are repeated until a certain condition is met. Example:
You might prompt the end user to enter specific information during installation. To make
sure the information the end user enters meets certain criteria, use a loop to repeat the
prompt until the data entered is appropriate.
If, While, and End Actions
Because a condition or loop can apply to more than one script action, they are defined
using at least two statements: one to mark the beginning of the block of script and the
other to mark its end. The standard action for beginning a condition is the If action, and
the standard action for beginning a loop is the While action. The end of both conditions
and loops is marked using the End action. Script 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 be ginning of actions to be
executed when the condition descri bed 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 are executed if the condition is true. Actions after the Else are executed
if the condition is false. Loops cannot have Else statements.
Nesting
In WiseScript, one condition or loop can contain another condition or loop. This is called
nesting. You define a nested condition or loop by adding a second If or While action (or
other start-of-condition or start-of-loop marker) before the End action of the first
condition or loop. The second block of script must be fully contained within the first.
When you add an End action, it always applies to the most recently begun If or While
action that does not already have an End action. You can nest conditions and loops to
many levels, but in most circumstances it won’t be necessary to nest more than three or
four levels deep. The indentation, which increases for each nested structure, helps you
interpret deep nestings.
Connection Lines
Connection lines connect the beginning and end of conditions or loops. To add
connection lines, select View menu > Connections Lines.
See also:
Basic Scripting Concepts on page 26
WiseScript Editor Reference27
Page 28
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 v ariables using the Set Variable action. You can
then gather data from the end user or read data from files to put into variables.
Variables hold ASCII text, not binary data. They can be up to 32 KB in length.
Variable Naming Conventions
zMust begin with a letter.
zMust be 28 characters or less.
zCannot begin with an underscore character; only compiler variables can start with
an underscore character.
zCannot contain % characters, except when using substitution as described below.
Variables and Substitution
By using variables, the installation .EXE can adapt to each destination computer. Once
information is stored in a variable, it can be used in most script actions through a
process called substitution. Any parameter for a script action can get part or all of its
value from a variable.
To use substitution, specify the variable name preceded and followed by %. (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 substitution to:
zBuild messages to display to the end user.
zSet locations for copying or installing files.
zInitialize new variables to the value of one or more other variables.
Expressions
zIf you are using a variable name as part of an expression, do not surround the
variable name with % characters. (Example: When you use an If, ElseIf, While, Set
Variable, or a Wizard Loop action to evaluate an expression, do not surround the
variables you reference in the expression with %.)
zDo surround compiler variables with % characters no matter where you enter them.
Some actions (If , Whi le, Set Variable, and some others) can use a more flexible scheme
that lets you use arithmetic expressions and other options.
See Expression Operators on page 137.
To read about sample scripts that use expressions, see ScriptHelp.htm in the Samples
subdirectory of this product’s installation directory and find scripts that manipulate
strings and perform calculations.
WiseScript Editor Reference28
Page 29
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. Script Editor then searches the entire script and replaces
any instance of the compiler variable with the value. These v ariables cannot be changed
by end users who run the installation .EXE.
Run-time variables are set by selections the end user makes on the installation’s dialog
boxes, by characteristics of their c ompu ter, or by the conten ts of files on their hard disk
(example: a settings file, an .INI file, or the registry).
The difference between compiler variables and run-time variables is similar to the
difference in C programming between preprocessor variables and C language variables.
Preprocessor <#ifdef> statements determine which code is compiled. C language If
statements determine which code is executed at run time.
In Conditions and Expressions
You can use both types of variables in variable substitution. However, they have
distinctly different behaviors when used in conditions and expressions. When you enter
a regular variable into an expression, you do not need to surround it with % 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 are not known until run time. The values of compiler variables,
on the other hand, are known when the installation .EXE is built. Therefore, WiseScript
Editor does not include the script actions inside a compiler variable condition when
building the installation .EXE.
Naming Compiler Variables
By convention, the names of compiler variables begin and end with an underscore.
WiseScript does not enforce this convention, but it might help you keep track of which
variables are known at compile time and which are known only at run time.
Using Compiler Variables
If an Install File(s) action is included inside a Compiler V ariable If block, the file it installs
is not added to the installation .EXE if the condition is false.
Example: You can create a script that compiles an inst allation .EXE for ei ther a 16-bit or
32-bit version of your application based on the value of a compiler variable and includes
only the files needed by each version of the application. Because the Install File(s)
actions that install the other version of the application are not compiled, those files are
not in the installation .EXE, making it smaller than a universal installation for both 16-bit
and 32-bit systems.
WiseScript Editor Reference29
Page 30
You can also use compi ler 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. The debugging actions are not
compiled into the final build.
When to Use
zVariable substitution can use either type of variable.
zWhen a script action places a value into a variable, use a run-time variable.
Compiler variables can’t be changed by scripts, but only by the person who builds
the installation .EXE.
zIn most other instances, the type of variable to use is implicit (example: the
Compiler If script action requires a compiler variable) or is noted explicitly.
See also:
Variables and Expressions on page 28
Basic Scripting Concepts on page 26
Anatomy of an Installation Script
An installation script has four basic sections. Whether you are modifying the default
script that is generated 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 l ater in the
installation is read from .INI files or the registry . Files that are displayed to the end user
(ReadMe.txt, License.txt, etc.) are installed. A search can also be performed for a
previous version of an application to use its location as the default installation directory.
User Input
This section contains a series of dialog boxes that ask the end user what optional
components to install, what directory to install the files in, and so on. This section
generally uses a Wizard Loop action. It displays any ReadM e or License files that are
installed in the Initialization section.
File Copy
This is the longest section of the installation script. Files are copied from the installation
.EXE to the destination computer.
System Configuration
After files are installed, the destination computer’s configuration fil es (.INI files, registry,
Start menu, etc.) are updated so that the new application works correctly . The end user
might then be prompted to restart their computer.
See also:
Basic Scripting Concepts on page 26
WiseScript Editor Reference30
Page 31
WiseScript Editor Reference31
Page 32
Chapter 3
WiseScript Actions
This chapter includes the following topics:
zAbout WiseScript Actions on page 34
zAdd Directory to PATH on page 34
zAdd Text to INSTALL.LOG on page 35
zAdd to AUTOEXEC.BAT on page 36
zAdd to CONFIG.SYS on page 36
zAdd to SYSTEM.INI on page 37
zBrowse for Directory on page 38
zCall DLL Function on page 38
zCheck Configuration on page 43
zCheck Disk Space on page 44
zCheck HTTP Connection on page 44
zCheck If File/Dir Exists on page 45
zCheck In-use File on page 46
zCheck Service on page 46
zCompiler Variable Actions on page 47
zConfig ODBC Data Source on page 48
zCopy Local File(s) on page 48
zCreate Directory on page 50
zCreate Service on page 50
zCreate Shortcut on page 51
zCustom Billboard on page 52
zCustom Dialog on page 52
zDelete File(s) on page 52
zDisplay Billboard on page 53
zDisplay Message on page 54
zDisplay Progress Message on page 55
zDisplay Text File on page 55
zEdit INI File on page 56
zEdit Registry on page 56
zEdit Registry for SVS Layer on page 59
WiseScript Editor Reference32
Page 33
zElse Statement on page 60
zElseIf Statement on page 60
zEnd Statement on page 61
zEvaluate Windows Installer Condition on page 61
zExecute Program on page 61
zExecute VBScript on page 62
zExit Installation on page 66
zFind File in Path on page 67
zGet Environment Variable on page 67
zGet Name/Serial Number on page 68
zGet Registry Key Value on page 68
zGet System Information on page 69
zGet Temporary Filename on page 71
zGet Windows Installer Property on page 71
zHalt Compilation on page 71
zIf Statement on page 72
zInclude Script on page 72
zInsert Line Into Text File on page 73
zInstall File(s) on page 74
zModify Component Size on page 76
zOpen/Close Install.log on page 76
zParse String on page 77
zPause on page 78
zPlay Multimedia File on page 78
zPost to HTTP Server on page 78
zPrompt for Filename on page 79
zPrompt for Text on page 80
zRadio Button Dialog on page 81
zRead INI Value on page 81
zRead/Update Text File on page 81
zRead/Write Binary File on page 82
zRegister Font on page 83
zRemark on page 83
zRename File/Directory on page 83
zSearch for File on page 83
zSelf-Register OCXs/DLLs on page 84
WiseScript Editor Reference33
Page 34
zSet Control Attributes on page 85
zSet Control Text on page 85
zSet Current Control on page 86
zSet File Attributes on page 86
zSet Files/Buffers on page 87
zSet Variable on page 87
zSet Windows Installer Property on page 88
zStart/Stop Service on page 88
zWhile Statement on page 89
zWin32 System Directory on page 90
zWizard Loop on page 90
About WiseScript Actions
The WiseScript™ scripting language contains script actions that let you perform various
installation-related tasks. The script actions are fully coded; all you do is enter
parameters for the action. This section describes the function and usage of each action.
All possible WiseScript actions are available in all WiseScript -based editors. This lets you
open any WiseScript in any WiseScript-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 environment variable, as set in Autoexec.bat.
The directory is appended to every occurrence of the SET PATH statement that does not
already contain it. A SET PATH statement is added if none exists. The system restarts at
the end of installation so that the new PATH takes effect.
To complete the dialog box
zDirectory to Add to PATH
Enter the directory to be added to PATH (example: enter %MAINDIR%).
zLocation of New Directory
Select to add to the beginning or end of the PATH.
zPath Selection
Some destination computers have several PATH variables. Use this list to add the
directory to all PATH variables.
WiseScript Editor Reference34
Page 35
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.
See 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).
Failures are listed also, with the reason for failure. The uninstall reverses each action
recorded in the Install.log, starting at the bottom of the log and going up. Typically, you
add commands to the Install.log to customize the uninstall process for an application.
Because the log is written continuously during installation, the location of the text in the
log depends on where in the script you place the Add Text to In stall.log script line.
To complete the dialog box
zLog Text
Enter the text to be added to the log file. You can enter variables surrounded by %.
To see the format of lines, open existing log files.
Examples
By default, uninstall does not remove files that were installed to Windows,
Windows\System, or Windows\System32. To remove these files, place an Add Text to
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,
substituting your own path to the .EXE (case-sensitive):
Execute path: %MAINDIR%\Remove.exe
If you want the uninstall to remove not only files that were installed, but also files that
were added later, you can remove all the files and sub-directories within a specified
directory. Use this option with caution because end users might have stored their own
files in the directory . You can use Windows standard wildcard notation (example: *.* for
all files). Type the following as Log Text, substituting your own directory path (casesensitive):
File Tree: %MAINDIR%\Data\Temp\*.*
If you want the uninstall to remove not only the registry keys that were installed, but
also keys that were added later, you can remove an entire registry key, including all its
sub-keys and values. Type the following as Log Text, substituting your own registry
tree (case-sensitive):
RegDB TREE: SOFTWARE\Wise
RegDB Root: 2
where RegDB Root is one of the following:
0 - HKEY_CLASSES_ROOT
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.
To complete the dialog box
zText to Insert
Enter the line to add to Autoexec.bat. If the line refers to an application file, use a
path (example: %MAINDIR%\Application\Application.exe). The PATH v ariable might
not be set when the command is executed, so always use a path.
zLine 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. Th e Search for Exi sting Text area in this
dialog box overrides the line number specified here. The line number applies only
when the text is not found or when you do not specify any text.
zSearch for Text
Enter the text to search for here. The installation 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.
zComment 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 command while leaving the existing
command 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.
zInsert Action
Select where to insert the new line in relation to the found line.
zMatch Criteria
Select how the found line matches the Search for Text.
zIgnore White Space
Mark this to ignore spaces and tab characters.
zCase Sensitive
Mark this to match case.
zMake Backup File
Mark this to make a copy of Autoexec.bat before editing it.
Add to CONFIG.SYS
This action edits the Config.sys file to add new commands. 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 de stination computer is restarted automatically
to force the new commands to take effect.
WiseScript Editor Reference36
Page 37
To complete the dialog box
zText 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.
zLine 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. Th e Search for Exi sting Text area in this
dialog box overrides the line number specified here. The line number applies only
when the text is not found or when you do not specify any text.
zSearch for Text
Enter the text to search for here. The installation scans Config.sys looking for a line
that begins with, ends with, or contains the text, depending on the setting of the
Match Criteria field. The line is inserted at the first found match.
zComment 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 command while leaving the existing
command 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.
zInsert Action
Select where to insert the new line in relation to the found line.
zMatch Criteria
Select how the found line matches the Search for Text.
zIgnore White Space
Mark this to ignore spaces and tab characters.
zCase Sensitive
Mark this to match case.
zMake Backup File
Mark this to make a copy of Config.sys before editing it.
Add to SYSTEM.INI
(Windows 3.1x or Windows 9x only) This action adds a device entry to the 386Enh
section of the System.ini file. The destination computer is restarted automatically to
force the new device driver to be loaded.
Do not use this action to modify the display driver (display=xxx) or any other nondevice entry. Instead, use the Edit INI action.
See Edit INI File on page 56.
To complete the dialog box
zDevice Name
Enter the full command line for the device (example: device=vshare.386). The
referenced files need a path unless they are in the System directory.
If you precede the command line with a semicolon (example: ;device=*vcp), the device
entry is commented out if it exists in the 386Enh section of System.ini. If you add a
WiseScript Editor Reference37
Page 38
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. In new scripts, use custom
dialog boxes instead.
To complete the dialog box
zWindow Name
Enter the title for the dialog box.
zDescription
Enter text to explain the dialog box to the end user.
zPrompt Name
Enter explanatory text to be displayed above the directory field.
zDefault Value
Enter the default location of the new directory. This appears as a default in the
directory field.
zVariable Name
Enter a variable to store the chosen directory. The standard script uses the variable
MAINDIR for this purpose.
zDon’t Append
Mark this to prevent the default directory (Default V alue field) from being appended
to the chosen directory.
zConfirm 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 returned results of a .DLL by setting the Action to Start
Block if Return Value True or Start While Loop.
To complete the dialog box
zDLL Pathname
Specify the path of the .DLL file (example: %MAINDIR%\Jso32.dll).
For non-system .DLLs, the installation script must install the .DLL before the script
calls it or it will not be found. If the .DLL is only needed temporarily during
installation, copy it to the Temp directory, represented by %TEMP%.
Note
You cannot test an installation that installs and immediately calls a .DLL unless you
install the .DLL to the Temp directory. Testing installs files, then immediately
deletes them, unless they are installed to the Temp directory.
WiseScript Editor Reference38
Page 39
zFunction 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).
zCall 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.
Each .DLL function takes a single parameter (lpDllPar ams) that points to a structure
containing information that can be passed back and forth between the .DLL function
and the running installation script.
zVariables Added
Because WiseScript-specific .DLL functions have access to the variable list of the
running installation, you can add new variables. List the names of the variables to
add, separated by commas. Do not use variables enclosed in %.
zParameter String
Use this to pass information to the .DLL function. Text you enter here is passed to
the .DLL in the IpszParam variable. This can include variables surrounded with %
signs.
zAction
Select the installation’s action when it returns from the .DLL call. The .DLL returns 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 skipped.
Loop while function returns true
The actions between this action and the matching End action (including the .DLL
call) are executed repeatedly until the .DLL function returns zero.
zPerform while loop at least once.
If you select Loop while function returns true, 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.
zCall a function with variable parameter list
(Enables the options below.) Mark this to call .DLLs not specifically written for
WiseScript. These .DLLs cannot access any of the installation’s internal variables,
but you can pass this information to them. Below, specify the required parameters
and Return Value Type.
zReturn Value Type
Select the data type of the return value, which are described in DLL Parameter
Settings.
zReturned Variable
Select or enter a variable to store the returned value.
WiseScript Editor Reference39
Page 40
zGet 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.
zKeep DLL loaded in memory after returning from function
By default, the Call DLL Function action loads a .DLL, calls a function in that .DLL,
and then unloads the .DLL. If you call many functions from a certain .DLL, then the
unload is unnecessary and can cause problems with certain .DLLs. To leave this .DLL
loaded, check this check box.
zHide progress bar before calling function
If the .DLL has UI, you can us this to hide the progress bar.
If you write a .DLL, use CALLBACK or WINAPI in the declaration of the .DLL.
Calling Visual Basic ActiveX controls is not supported.
The sample scripts Application kill.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 the order in which they appear in the .DLL’s
function prototype.
To complete the dialog box
zParameter Type
Check the table below for alternate names for data types.
WiseScript Corresponds to Win32
SDK type
shortSHORT Integer16-bit, signed integer data type
wordWORD Integer16-bit, unsigned integer data type
longLONG, LRESUL T, BOOLLong, Boolean32-bit, signed integer data type
dwordDWORD (Use this for any
parameter type that begins
with an “H” or ends with the
word “HANDLE,” such as
HWND, HANDLE, HPEN,
HFONT, and LPHANDLE.)
string pointerUse for any parameter that
ends in STR such as LPSTR
and LPTSTR.
Corresponds to
Visual Basic
type
Long32-bit, unsigned integer data type
Long32-bit pointer to an ANSI character
Description
type null terminated string
WiseScript Editor Reference40
Page 41
WiseScript Corresponds to Win32
SDK type
short pointerPointer to SHORT or SHORT*
(use for PSHORT or LPSHORT)
word pointerPointer to WORD or WORD*
(use for PWORD or LPWORD)
long pointerPointer to LONG or LONG*
(use for PLONG or LPLONG)
dword pointerPointer to DWORD or
DWORD* (use for LPDWORD
or PDWORD)
string bufferchar [size]StringUse to place a character buffer of the
Note
If you are using the Win16 SDK, use word instead of dword for parameters that
start with H or end with HANDLE.
zBuffer Length
If you set Parameter Type to string buffer, then this field is enabled. Enter the
number of string buffer characters. The limit is 446.
Corresponds to
Visual Basic
type
Long32-bit pointer to a SHORT data type
Long32-bit pointer to a WORD data type
Long32-bit pointer to a LONG data type
Long32-bit pointer to a DWORD data type
Description
(see SHORT for the reference to this
data type)
(see WORD for the reference to this
data type)
(see LONG for the reference to this
data type)
(see DWORD for the reference to this
data type)
given size (number of characters)
into a structure. Use only with
structures.
zPassing type
Leave this set to Normal unless you are passing a complex structure to the .DLL. In
that case, select First element of structure for the first element in the structure,
and select Contained within structure for all subsequent elements of the
structure. You do not pass the structure name, just the elements in side it.
See Passing Complex Structures to a .DLL: An Example on page 42
zValue Source
Select the type of value to be passed: Variable (pass by reference), constant (pass
by value), constant with null v alue, or constan t with window handl e (pointing to the
installation window).
zVariable Name
If Value Source is set to Variable, select or enter a variab le.
zConstant 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
WiseScript Editor Reference41
Page 42
Passing Complex Structures to a .DLL: An Example
You can use a Call DLL Function to cal l a .DLL. In addition to passing simple paramet ers,
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. For non-structure parameters, select Normal from Passing Type in the
DLL Parameter Settings dialog box. However, for structure elements (also referred to as
members), select First element of structure for the first item in the structure, or
Contained within structure for subsequent items. A structure ends if there are no
more parameters, or if the next parameter is set to Normal or First element of a
structure.
Note
The following code samples are in the C programming language.
Suppose that you have a function in a .DLL that processes information for a new
employee. The return value of the function is a 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 of the EMPLOYEE structure is as follows:
typedef structure EMPLOYEE {
LPSTR name;
LONG salary;
CHAR title[50];
}
The layout of the DEPARTMENT structure is as follows:
typedef structure DEPARTMENT {
LPSTR deptname;
LPSTR deptnum;
}
To call the function NewEmployee from an installation script, you add six parameters in
the Call DLL Function dialog box: the three elements of the first structure, the integer,
and the two elements of the second structure.
To add parameters, see DLL Parameter Settings on page 40.
Parameter in the C functionParameter type in
WiseScript
name (first element of
EMPLOYEE structure)
salary (second element of
EMPLOYEE structure)
string pointerFirst element of a
longContained within
Passing Type in
WiseScript
structure
structure
WiseScript Editor Reference42
Page 43
Parameter in the C functionParameter type in
title (third element of
EMPLOYEE structure)
intlongNormal
deptname (first element of
DEPARTMENT structure)
deptnum (second element of
DEPARTMENT structure)
See also:
Call DLL Function on page 38
DLL Parameter Settings on page 40
Check Configuration
This action tests the hardware configur ation, operating syst em, and other characteristics
of the destination computer. As a result of this check, the action can display a message,
halt the installation after displaying a message, or start a conditional block.
To complete the dialog box
zIf System
Use the drop-down lists to build a statement of what to check for.
Passing Type in
WiseScript
string buffer
(buffer length of 50)
string pointerFirst element of a
string pointerContained within
WiseScript
Contained within
structure
structure
structure
Note
When you check for an operating system, this action looks for the minimum
operating system of the type for which you’re checking. Example: If you check for
Windows XP, this action returns TRUE if Windows XP or later is running.
zAction
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.
zTitle
Enter the title for the dialog box.
zMessage Text
Appears in the body of the message dialog box. Leave this blank to prevent a
message from appearing.
WiseScript Editor Reference43
Page 44
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.
The sample script CheckVGA.wse uses this action. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product’s installation directory.
Check Disk Space
This action determines if enough disk space is available for the installation, based on
files that are always installed. You would use this action only if the WiseScript contains
Install File(s) actions that install files permanently on the destination computer.
You can leave all fields blank and the action checks disk space for all files. This action
takes the cluster size of the disk into account.
To complete the dialog box
zComponent Variable(s)
If the installation includes components, specify the variable that contains the list of
components the end user selects (named COMPONENTS in the default script). This
variable is set by the Select Components action.
zStatus Variable
Select or enter the variable to store the result of the disk space check. If ther e 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 different components.) If
no status variable is selected, clicking Retry simply executes the test again.
zReserve Space
You can specify required disk space for up to three additional disks. (Example: Use
this option if your application requires temporary disk space to operate, or if you
plan to run a separate installer .EXE to install another application with its own space
requirements.) Select or enter a Disk Variable, which contains a directory name to
test. Enter the amount of space to check for in Extra Space.
See Modify Component Size on page 76.
zDo not cancel during silent installation
Mark this to continue installing if the disk space check fails during a silent
installation. If you script includes an installation log, a message is written to
Install.log. Otherwise, if the disk space check fails, the installation is halted with no
message to the end user.
For information on how to create an installation log, see Open/Close Install.log on
page 76.
Check HTTP Connection
This action determines whether a given URL is valid by using WinSock.dll to try to
download the HTML page.
WiseScript Editor Reference44
Page 45
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. If an error occurs, the number
variable is set to another error code, and the text variable is set to a string that
describes the error return codes. The retu rn codes and error strings c ome from the API s
that try the download. A sample of the return string is:
This indicates that no proxy server was used and that WinSock returned the error code
11001.
Note
If the Web server redirects URLs that are not valid to another internal Web page, no
error is detected by this action.
To complete the dialog box
zURL to Check
Include “http://” in the URL.
zWin32 Error Text Variable
Select or enter a variable to store the error text returned by the 32-bit winsock.dll.
zWin32 Error Number Variable
Select or enter a variable to store the error code returned by the 32-bit winsock.dll.
zWin16 Error Text Variable
Select or enter a variable to store the error text returned by the 16-bit winsock.dll.
zWin16 Error Number Variable
Select or enter a variable to store the error code returned by the 16-bit winsock.dll.
Check If File/Dir Exists
This action determines if a file or directory exists, whether a directory is writable, or if a
.DLL is loaded into memory. It can perform different actions based on the result of the
check.
To complete the dialog box
zIf
Select the condition to check. To check if a .DLL is loaded, select Module loaded in
memory.
zPathname
To check a file or directory, enter its path. Wildcard characters, such as *, are
not valid. Use variables (example: %WIN%) rather than ha rdcoding a path.
WiseScript Editor Reference45
Page 46
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.
zTitle
Enter the title for the dialog box.
zMessage Text
Appears in the body of the message dialog box. Leave this blank to prevent the
message from appearing.
zAction
Occurs when the If statement above is true. The message described in the Title
and Message Text fields appears unless Message Text is blank. In addition, select
from these options.
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.
Start While Loop
Begins a loop block. All actions between this action and the next End action are
executed repeatedly as long as the condition is true.
zPerform 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 subdirectory of this product’s installation directory.
Check In-use File
This action determines whether a particular file is “in use”, indicating a file is being
accessed by a process. Typically, in-use files cannot be moved, deleted, or opened by
other processes.
To complete the dialog box
zVariable
Select or enter a variable to store the result of this test. After this action runs, the
variable contains one of the following values: In-Use, Not In-Use, Non-Existent
(which means the file could not be found), or Access Denied. The value Access
Denied is returned if the user does not have write access to the file.
zPathname
Enter the path of the file to check. You can use variables to build the path.
Check Service
This action checks if a particular service is running.
WiseScript Editor Reference46
Page 47
To complete the dialog box
zVariable
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. If the status ends
with the word Pending, the service has received a request, but is still processing the
request.
zService Name
Enter the name of the service. This is not necessarily the same name you see in the
Services control panel. If you are unsure of the service name, consult its
documentation or manufacturer.
Compiler Variable Actions
Compiler Variable If, Else, and End actions are used in an If block to let you compile
different versions of an installation. You set the value of a compiler variable at compile
time, and the actions inside a compiler variable If block are added to the script
according to the value of the compiler variable
The Add T ext to INSTALL.LOG 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 case-sensitive. Do not
enter variables in this field, because it checks your computer in real time, not
run time.
If you selected File Exists above, the If statement checks to see if the file that
you enter in The Value exists. If you selected File Version Equal or Greater,
enter the file in The Value.
2. Below the Compiler Variable If action, add one or more actions to perform if the
compiler variable has the specified value.
3. (Optional) Add a Compiler Variable Else action, followed by one or more actions to
perform if the compiler variable does not have the specified value.
4. Add a Compiler Variable End action.
The sample script Compvar.wse uses this action. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product’s installation directory.
See also:
Compiler Variables and Run-time Variables on page 29
WiseScript Editor Reference47
Page 48
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
zData Source Name
This name will be displayed in the ODBC data sources list on the destination
computer. The Import button adds an ODBC data source from your computer and
populates the fields.
zDriver Name
Enter the name of the ODBC driver used by this data source. The driver, along with
its support files, must already have been installed on the destination computer.
zInstall Data Source for
Select Win16 or Win32 APIs.
zData Source Attributes
Either enter attributes, or use the Imp ort button to import them from an ODBC data
source installed on your computer.
zDisplay Configuration Dialogs
Mark this to display standard data source configuration dialog boxes to the end
user. Otherwise, the data source is configured with default settings.
zSystem DSN
Mark this check box to make the data source available to all user accounts on the
destination 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
zSource
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 valid directory, file, or files.
To copy more than one file, do one of the following:
If you want the progress bar to update correctly, specify a directory in Source
without wildcards (example: %INST%\Pictures\), a directory in Destination,
and a directory ending with a wildcard in Local Path (example: C:\My
Pictures\*.jpg). The Source field will pick up the wildcard specified in Local Path. Specifying a wildcard in both the Source field and the Local Path field
results in a compile error.
If you don’t need the progress bar to update correctly, use wildcards in Source
(example: %INST%\Pictures\*.jpg), specify a directory in Destination, and
leave Local Path blank.
zDestination
Specify the location on the destination computer. If a single file is being copied, this
should contain a full file path. If multiple files are being copied, this should contain a
WiseScript Editor Reference48
Page 49
full directory path. To copy files to the installation directory, start this path with
%MAINDIR%.
zDescription
Enter text to display in the progress bar during file copy.
zLocal Path
A hard-coded path that specifies the location of the files on your computer at
compile time. Specify this for the installation progress bar to update correctly based
on file size. See the description of the Source field above.
zRequire Password
(Not applicable in this product)
If you entered a password on the Password page, and you mark this, the end user is
prompted for the password before this file is installed.
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 passwordprotected files are slated for installation, the prompt does not appear.
zInclude Sub-Directories
If you specify a directory in Source, mark this to include all subdirectories and their
contents.
zShared DLL Counter
If this is marked, and the file is a .DLL or .VBX, Windows tracks the file to prevent
its removal if an application is still using it.
zNo Progress Bar
Mark this to hide the progress bar while this file is being copied.
zSelf-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 file, but specifies that it should be registered later. Include a SelfRegister OCX/DLL action to register the file.
See Self-Register OCXs/DLLs on page 84.
zDon’t Convert to Floppy
(Not applicable in this product)
If you marked Convert CD-ROM to Floppy on the Build Settings page, mark this
to override that option for this file.
zReplace 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 that might be customized by the end user
and should therefore not be replaced on re-installation (example: configuration
files).
Check File
The existing file is replaced only if the requirements you set in File Version and
File Date/Time are true.
WiseScript Editor Reference49
Page 50
zRetain 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.
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
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. If the existing file lacks a
version resource, it is not replaced.
For File Da t e/T im e , this replaces the existing file if its modification date
and time are the same as or older than the new file.
Older
For File Version, this replaces the existing file if it has a version resource
that is older than the new file. If the existing file lacks a version resource, it
is not replaced.
For File Da t e/T im e , this replaces the existing file if its modification date
and time are older than the new file.
Directories are created when files are installed to them. Use this action only to create an
empty directory on the destination computer.
To complete the dialog box
zPathname
Create Service
This action installs a Windows service on operating systems where they are supported.
zService Name
zDisplay Name
zExecutable Path
zLogin Username, Login Password
zError Control
Enter the directory path to create. Start the path with a variable (example:
%MAINDIR%).
Enter the internal service name, which is used in the registry.
Enter the name to appear in the Services control panel.
Specify the complete path to the executable file as it will be on the destination
computer. Start the path with a variable (example: %MAINDIR%).
Enter the user name and password under which the service should run.
Specify what happens if an error occurs while the service starts.
WiseScript Editor Reference50
Page 51
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. If the computer is starting the last known good
configuration, startup fails. Otherwise, it restarts with the last known good
configuration.
zGroup
Enter the name of the load ordering group to which this service belongs. Leave this
empty if the service does not belong to a group.
zDependencies
Enter a list of semicolon-separated names of services or load ordering groups that
must start before this service. Leave this empty if there are no dependencies. If a
service is dependent on a group, at least one member of the group must be started
for this service to run.
Enter a plus sign (+) before group 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.
zService Type
Select a service type.
zStart Service
Select the default setting for starting the service.
zService Interacts With Desktop
Mark this to let the service display its user interface.
Create Shortcut
This action creates a shortcut. Common locations include the Start menu
(%STARTMENUDIR%), the Startup directory (%STARTUPDIR%), the installation
directory (%MAINDIR%), and the desktop (%DESKTOPDIR%).
To complete the dialog box
zSource Path
Specify the path of a file that will be installed on the destination computer. Start the
path with a variable (example: %MAINDIR%\Application.EXE) and do not enclose it
in quotation marks.
zDestination Path
Enter the path to the shortcut to be created, which should end in .LNK (example:
%GROUP%\Application.lnk). For the current user’s desktop, Start menu, or Startup
directory, use %DESKTOPDIR%, %STARTMENUDIR%, or %STARTUPDIR%. For the
All Users equivalents, use %CDESKTOPDIR%, %CSTARTMENUDIR%, or
%CSTARTUPDIR%.
WiseScript Editor Reference51
Page 52
zCommand Options
(Optional) If the shortcut is for an .EXE, enter command-line options.
zDefault 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.
zDescription
Enter text to appear in the Comment field of the shortcut’s properties dialog box.
zIcon Pathname
(Optional) Specify the file that contains the icon to be used for the shortcut.
Otherwise, the target file’s icon is used.
zWindow Size
Select an option to determine the appearance of the .EXE file’s window.
zIcon Number
Enter the number of the icon to use from the file specified in Icon Pathname
above.
zShift State, Hot Key Letter
These fields together populate the Shortcut Key field in the shortcut’s Properties
dialog box in Windows Explorer. See Windows help.
zSupport 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 121.
Custom Dialog
Use this action to create your own dialog box or dialog box set. See About Dialog Boxes
on page 92. To add a new dialog box within a wizard loop, see Adding a Dialog Box to
the Installation on page 93.
For details on the Dialog Box Properties dialog box, see Setting Dialog Box Properties on
page 94.
For details on sample scripts that use this action, see ScriptHelp.htm in the Samples
subdirectory of this product’s installation directory.
Delete File(s)
This action removes files from the destination computer.
You do not need to delete temp files if you use the Get Temporary Filename action to
create them because they are deleted automatically.
WiseScript Editor Reference52
Page 53
To complete the dialog box
zPathname
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. When you
select a path in the Browse for File dialog box, you must select a file.
zInclude Sub-Directories
If you entered the path to a directory or used a wildcard, mark this to delete
matching files in all subdirectories as well.
zRemove Directory Containing Files
If this is marked, and if the deletion leaves the directory empty, then the directory
is deleted also.
If you mark this check bo x and Include Sub-Directories, and you do not include a
file in the path, then all other empty subdirectories are deleted also. To prevent
deletion of the other subdirectories, add a trailing backslash 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 (scalable
bitmaps) with the Custom Billboard Editor.
See About Billboards on page 121.
You can use up to 16 Display Billboard actions in the script.
To complete the dialog box
zPathname
Specify the full path to the graphic file on your computer. To use variables in this
field, you must mark the Local Graphic option below.
zX-Position, Y-Position
Indicate the location on a 640 x 480 screen to place graphics. On larger screens, the
billboard is placed proportionately based on the 640 x 480 location.
zErase Num
Enter how many previously displayed graphics are erased before this graphic is
displayed. To display one graphic at a time, set this to 1. To display all graphics
simultaneously, set this to 0. The oldest graphic is removed first.
zBuild Effect
Select a transition effect.
WiseScript Editor Reference53
Page 54
zTransparent
Mark this to have pure blue (R=0, G=0, B=255) parts of the graphic become
transparent.
zCenter Horizontal
zPlace at Right
zScale to Screen
Mark this for the graphic to cover the same percentage of the screen regardless of
screen size.
zHide Progress Bar
Mark this to hide the progress bar during graphic display.
zCenter Vertical
zPlace at Bottom
zTile Background
Mark this to repeat the graphic edge-to-edge to fill the entire screen.
zErase All
Mark this to remove all previous grap hics from the screen be fore displaying the new
one.
zTimed Display
Mark this to display a series of graphics at evenly-spaced intervals, which is
calculated by the number of files to be installed. Place all Display Billboard actions
before the first Install File(s) action if you are using Timed Display.
zLocal Graphic
Normally, 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 message dialog box and can optionally branch the script based on
the end user response. Without the branching option, this dialog box has an OK button,
which continues, and a Cancel button, which halts installation.
To complete the dialog box
zMessage Title
Enter the title for the dialog box.
zMessage Text
This is displayed in the dialog box. Press Ctrl+Enter to add line brea ks in the
displayed text. You can use variables in this text.
zMessage Icon
Select an icon for the dialog box.
zStart If Block
Mark this to display Yes, No, and Cancel buttons instead of OK and Cancel. This
action then acts like an If action. Statements between this action and its matching
WiseScript Editor Reference54
Page 55
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.
zNo Cancel
Mark this to suppress the Cancel button. Use this in informational messages to
prevent the end user from canceling installation.
Note
The Display Message action can help you debug. Use this action anywhere in the script
to display the value of a variable by entering %VARIABLE_NAME% in Message Text.
The sample scripts CheckDiskSpace.wse and Search.wse use this action. For details on
sample scripts, see ScriptHelp.htm in the Samples subdirectory of this product’s
installation directory.
Display Progress Message
This action displays a small dialog box during installation, typically to indicate the
computer is still working during a long operation. The dialog box cannot be closed or
cancelled. Also use this action to remove a previous progress dialog box.
To complete the dialog box
zRemove 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.
zDisplay a new progress message
Message Title
Message Text
X-Position, Y-Position
Height, Width
Center Horizontally
Center Vertically
Display Text File
This action displays a 30 K or smaller text file in a dialog box. It is included to provide
backward compatibility for older WiseScripts.
To complete the dialog box
zFile Pathname
Specify a file on the destination computer (examples: %MAINDIR%\Readme.txt,
%TEMP%\%TEMPFILENAME%).
Enter the title for the dialog box.
Enter text to display in the dialog box. You can use variables in this text.
In pixels, enter the location of the upper-left corner of the dialog box.
In pixels, enter the dimensions of the dialog box.
Mark this check box to override the X-Position field.
Mark this check box to override the Y-Position field.
WiseScript Editor Reference55
Page 56
Edit INI File
zWindow Title
Enter the title for the dialog box.
zDescription
Enter text to explain the dialog box to the end user.
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
zFile
Enter the .INI file path, or select a path from the list and edit it.
zINI File Contents
Enter changes to make in the .INI file. Changes are interpreted as follows:
To add to a section, type the section name in brackets, then type new lines for
that section. If the .INI file already contains a name-value pair that you type,
the existing line is replaced by the new one. Example:
[SECTIONNAME]
Color=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=
Edit Registry
Comments (lines starting with ;) are not supported.
This action adds, edits, or deletes registry keys or values. You can create registry entries
manually or import a registry file (.REG).
To complete the dialog box
zRegistry Keys
This field shows root registry keys and the keys added by this action. Select a root
before adding or importing a key.
zValue Names
This field shows values being added or changed that reside under the key selected
on the left.
zNew Key
To add a new key, select the parent key in Registry Keys, click the New Key
button, and select Key from the drop-down. A dialog box appears, where you enter
information about the new key.
See Registry Key Settings Dialog Box on page 57.
WiseScript Editor Reference56
Page 57
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.
zDelete Key
Removes the selected key from the current installation. This does not remove it
from the destination computer. To do that, you must change the Operation field in
the key’s details dialog box.
zNew Value
To add a new value, select the parent key in Registry Keys, then click the New
Value button. A dialog box appears, where you enter information about the new
value.
zDelete Value
Removes the selected value from the current installation. This does not remove it
from the destination computer. To do that, you must change the Operation field in
the value’s details dialog box.
zData Settings
These fields in this section of the dialog box correspond to fields you set 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 ap pears when you double-cli ck the Edit R egistry action and c reate or edit
a registry key on the Edit Registry Settings dialog box.
To complete the dialog box
zOperation
Select the operation to apply to the key or its associated value.
Create/update key and value
The value is updated if it already exists. If the key or value does not exist, it is
created.
Create empty key
Creates the key but does not add any values.
Remove key and all subkeys
Deletes the key, its subkeys, and all named values associated with the key and
its subkeys on the destination computer.
Remove key and value only
Removes the named value from the key on the destination computer. If the key
has other named values, they are preserved.
Preserve existing key and value
Adds a new key or value if the specified item does not exist, but leaves the
existing value in place if one already exists. This option is not a v ailable with the
Edit Registry for SVS Layer script action.
WiseScript Editor Reference57
Page 58
zRoot
Select the parent key in which the new key is added.
zKey
Enter the name of the new key. You can create multiple hierarchi cal 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.
zValue Name
Enter the name of a new named value.
zData Value
The data for the value. If the Data Type (below) is Double Word (DWORD), the
data should be in decimal notation. To insert multiple lines of data here, press
Ctrl+Enter to begin a new line.
zData Type
Select the type of data contained in the named value. Available types are listed
below. The associated Windows API data types are in parentheses.
String
(REG_SZ prefix) Indicates that a value entry is an expandable string. To embed
a variable name, (such as %WIN%), enclose it with double percents
(%%WIN%%). If you enclose it in single percents, then the variable name is
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 embedded.
Multiple Strings
(REG_MULTI_SZ prefix) Identifies a value entry as a multiple string. These are
multiple pieces of text, separated by carriage returns.
Double Word
(REG_DWORD prefix) Identifies a value entry as a 32-bit (DWORD) entry.
Binary/Hex
(REG_BINARY prefix) Identifies a value entry as binary. Each byte should be
separated by at least one blank space. For instance: AD 30 C0 A9 40 20 A8 FC
4C 00 08.
None
This is provided for compatibility with SMS Installer installations. It behaves the
same as the binary data type.
zAppend Data
Normally, if you set a registry key to a new value and the key already exists, the
value is replaced with the new value. If you want to append the new data to an
existing multiple strings value instead of replacing it, mark this check box. This
option is unavailable unless Multiple Strings is selected in the Data Type dropdown list.
WiseScript Editor Reference58
Page 59
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 Laye r. 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
zRegistry Keys
This field shows root registry keys and the keys added by this action. Select a root
before adding or importing a key.
zValue Names
This field shows values being added or changed that reside under the key selected
on the left.
zNew Key
To add a new key, select the parent key in Registry Keys, click the New Key
button, and select Key from the drop-down. A dialog box appears, where you enter
information about the new key.
See Registry Key Settings Dialog Box on page 57.
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.
zDelete Key
Removes the selected key from the current installation. This does not remove it
from the destination computer. To do that, you must change the Operation field in
the key’s details dialog box.
zNew Value
To add a new value, select the parent key in Registry Keys, then click the New
Value button. A dialog box appears, where you enter information about the new
value.
zDelete Value
Removes the selected value from the current installation. This does not remove it
from the destination computer. To do that, you must change the Operation field in
the value’s details dialog box.
zData Settings
These fields in this section of the dialog box correspond to fields you set when
creating the value.
See Registry Key Settings Dialog Box on page 57.
WiseScript Editor Reference59
Page 60
zSVS 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. It takes no parameters, and
selecting it from the Actions list inserts it directly into the script with no further dialog
boxes or prompts.
See also:
If Statement on page 72
ElseIf Statement
This action is put inside an If block to check for another condition. It marks the
beginning of a block of code that is executed only if the condition checked by the If
Statement is false, all previous ElseIfs are false, and this ElseIf is true. You can use one
If Statement with multiple ElseIf Statements to check for multiple conditions.
To complete the dialog box
zIf 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 Expressions on page 28.
The variable is ignored and can be left blank. The result is considered true if it
evaluates to a non-zero result. Valid Password and Invalid Password evaluate
according to the password that is entered on the Passwords page.
(The password comparisons are not applicable in this product.)
zThe Value
Enter the value to be used in the comparison, or an expression if the comparison is
set to Expression True. If you enter variable names in this field, do not surround
them with percent signs (%). If you enter compiler variables, then you must
surround them with percent signs.
See also:
If Statement on page 72
WiseScript Editor Reference60
Page 61
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
This action evaluates a condition in the curren tly -runnin g Windows Installer installation.
You enter a Windows Installer condition and select a WiseScript variable to store the
result. It puts the value of 1 (true) or 0 (false) into the WiseScript variable. Use this
action only in WiseScripts that are called from a Windows Installer installation.
Note
This action works only if you have Windows Installer Editor installed.
To complete the dialog box
zDest. Variable
Select or enter a variable to store the result of the Windows Installer condition. The
variable is set to 1 if the condition is true, or 0 if false.
zCondition
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 Property on page 88
Execute Program
This action runs another .EXE. The .EXE can be a file that is already installed on the
destination computer, a file you installed as part of the installation, or a file you pro vi de
on a separate disk.
If the .EXE you plan to execute is coded to pass back a return v alue, the resulting return
value is put into the variables %INSTALL_RESULT% and %PROCEXITCODE%. If the
.EXE passes back a return value, mark the Wait for Program to Exit check box.
To complete the dialog box
z.EXE Path
Specify the full path to the program to run, including the program file name.
Example: %MAINDIR%\Application.exe
WiseScript Editor Reference61
Page 62
zCommand 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.
zDefault 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. Click Browse and select a directory from your installation. You can
select from directories that you created using the Create Directory action.
See Create Directory on page 50.
zVariables Added
List any variables created in the .EXE that are not present in the calling script.
zWindow Size
You can force the .EXE file to run in a maximized or a minimized window, or you can
let it run in its default window. Select Hidden to run the .EXE silent ly, which means
it runs minimized and its task is not shown on the task bar.
zWait for Program to Exit
Mark this to stop the installation while this program runs. The installation does not
resume until the program exits. Be sure to mark this if the .EXE returns a value to
the script. If the installation does not wait for the .EXE to exit, add the commandline option -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 action lets you execute VBScripts from within a WiseScript. This greatly expands
the functionality of WiseScripts because you can use all the scripting capabilities of
VBScript (example: arrays and subfunctions). Adding VBScripts can also save you time
because you can use scripts that others have created.
For each VBScript action in a script, 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.
See Editing a VBScript on page 63.
The WiseScript and VBScript interact so you can set a variable in either script and then
use that variable in the other script. The VBScript window also has an action to facilitate
the calling of COM objects.
See VBScript Actions on page 64.
Warning
You should be familiar with VBScript to use this feature.
WiseScript Editor Reference62
Page 63
To complete the dialog box
zVB Script Path
zCommand Line
You can use WiseScript variables in the command line. The sample script
MakeWebDir.wse uses WiseScript variables in the command line to let the end user
specify the name and location of a virtual directory that the script creates. F or details on
sample scripts, see ScriptHelp.htm in the Samples subdirectory of this product’s
installation directory.
Editing a VBScript
When 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.
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. You can use compiler variables in the path.
If the VBscript requires a command line, enter it here. A command line is probably
required if:
The VBScript required a command line when it ran stand-alone.
The WScript object with the Arguments property (WScript.Arguments) is in the
VBScript.
To edit a VBScript in Script Editor, use the following:
zActions in the Actions pane.
See VBScript Actions on page 64.
zButtons and drop-down list at the top of the Installation Script pane.
zRight-click menu.
zAny options on the Edit menu that are enabled.
Display Options
Use the buttons and drop-down list at the top of the Installation Script pane to display
different portions of the VBScript.
Event ViewClick this button and select a method from the drop-
down list to display one method at a time.
Full Module ViewClick this button to display the entire script. When you
select a method from the drop-down list, the script
opens to that method.
Right-Click Menu Options
zList Objects
Displays a drop-down list of predefined objects and, when possible, objects that are
called in the script.
WiseScript Editor Reference63
Page 64
VBScript Actions
For details on when called objects appear in this drop-down list, see VBScript
Actions on page 64.
zList 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.
For details on when this list appears for an object, see VBScript Actions on page 64.
zList Functions
Displays a list of VBScript functions. For help on VBScript functions, see the MSDN
Library (msdn.microsoft.com/library/).
zQuick Info
Displays help text, when possible, for a selected item. This help text can also appear
as a pop-up. Example: when you select an item in a drop-down list.
zCheck Syntax
Checks the script for basic syntax and displays a Syntax Error message. A syntax
error message also appear as a pop-up when a syntax error is detected.
zRevert to Saved
Reverts the current script to the last saved v e rsion, to undo any changes you made
since you last saved.
When 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. The VBScript window has three actions that facilitate the creation of the 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 is registered on
your computer, this action can provide the following functionality:
zThe object appears in the Li s t Objects drop-down list that is accessed from the
right-click menu.
zThe object has a List Properties/Methods drop-down that lists the exposed
properties and methods of that object. Example: This drop-down list appears when
you enter the object’s name followed by a period.
zA help pop-up is associated with the object and its properties and methods. This
pop-up displays help text for these items when they are selected in a drop-down list
or when you select Quick Info from the right-click menu.
When you call an object in a VBScript, the object persists between the execution of that
script and any other VBScripts that are executed by the same WiseScript. (Example: If
the WiseScript executes two VBScripts and the first VBScript calls an object, you do not
need to create the object in the second script to access its properties and methods.)
However, if you create an object in one editor window you will not automatically see its
properties and methods in a second window even though they will execute properly.
WiseScript Editor Reference64
Page 65
See Calling a COM Object in a VBScript on page 65
Get WiseScript Variable
Use this action t o 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.
See Set Variable on page 87.
In the VBScript, you put the name of the variable in the Get Variable function that
appears when you double-click this action. This action uses the VBScript GetVariable
function.
The sample script SetGetVariable.wse uses the Get WiseScript Variable action in its
VBScript to get a variable that is set in the WiseScript. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product’s installation directory.
Set WiseScript Variable
Use this action to create a script that sets a variable in the VBScript that can be used in
the WiseScript. You must also set the variable in the WiseScript prior to the Execute
VBScript action, but the VBScript determines the value of the variable.
See Set Variable on page 87.
To use the variable in the WiseScript, you must place the variable after the Execute
VBScript 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 de tails 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 WiseScript, a new tab appears at the
bottom of the Installation Script pane. When you click this tab, the VBScript window
appears. In the VBScript, you can call a COM object and then use the functions and
properties that are exposed by this object.
To call a COM object in a VBScript
1. Use the Execute VBScript action to add a VBScri pt to the WiseScript.
See Execute VBScript on page 62.
2. Click the tab for the VBScript that appears at the bottom of the Installation Script
pane.
The VBScript window appears.
3. Add a Call COM Object action.
The Call COM Object dialog box appears. The only required fields on this dialog box
are Creatable Object ProgID and Variable name. The other fields help you
identify an object’s ProgID.
Note
The Call COM Object dialog box only facilitates calling a COM object, it does not
guarantee that the information it accesses on your computer is correct.
4. To use TypeLib information to identify the object, click Select.
WiseScript Editor Reference65
Page 66
The Browse Typelib Information dialog box appears. It lists TypLib information for
all the objects registered on your computer.
5. 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. TypeLib information for an
unregistered object does not help you identify the object’s ProgID, but it does
display a list of objects in the Objects field for the file you selected. This
information might help you identify the correct object.
The Call COM Object dialog box reappears.
6. If the desired object does not appear in the Object field, select it from the dropdown list.
If a registered object has a ProgID, it will appear in Creatable Object ProgID. If
an object does not have a ProgID, you can not call that object. A ProgID consists of
the name of the application providing the object, followed 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 installation.
No message appears unless you also set the RESTART variable.
See Automatic Run-time Variables on page 132.
To complete the dialog box
zApplication Exit Code
If this script is called by another application, this is the return code to the calling
application. You can use a v ariable enclosed with %. F or example, with a WiseScr ipt
wrapper that executes an MSI, you could type %INSTALL_RESULT%. The value of
the Application Exit Code would then be the same as the exit code of the MSI. You
would then not have to create an Exit Installation action for each possible value that
Windows Installer co ul d return.
If the WISE_ERROR_RTN variable is already set, the value in WISE_ERROR_RTN
does not override the Application Exit Code but is written to the installation log.
See Run-time Variables on page 134.
WiseScript Editor Reference66
Page 67
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
zFile Name
Enter just the file name, not a full path. Wildcard characters (*, ?) are not allowed.
zVariable Name
Enter a variable in which to store the path of the file if it is found. If the file is not
found, this variable stores the Default Value specified below.
zDefault Value
Enter a value to put into the variable if the file is not found. To use an If statement
that tests the variable, leave this blank so it evaluates to false.
T o install a new v ersion of the file, specify the file’s typical location here. Then, if the
file is found, the location replaces the default value, but if it is not, this default value
is used to install the file.
zDescription
Enter text to display if the find operation takes more than 1.5 seconds to complete.
This happens only if the list of directories in the PATH is very long or a directory is
on a slow device (example: CD-ROM).
zSearch Directories
Enter a semicolon-delimited list of directories to search. You can use variables. If
this field is blank, only directories in the PATH envir onment variable are searched.
zRemove 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
This action puts the value of a Windows environment v ari able into a WiseScript variable.
To complete the dialog box
zEnv. Variable
Enter a Windows environment variable.
zVariable Name
Enter a variable to store the value of the environment variable.
zDefault Value
(Optional) Enter the value to store in the variable if the environment variable is not
found.
zRemove File Name
Mark this to remove a file name from the end of a returned path, leaving only the
directory name. This operation is not performed on the Default Value.
To run a batch file or other application in a DOS window, use Get Environment Variable
to put the value of ComSpec (path to command.com) into a variable (example: put it in
%COMMAND%). Then use the Ex ecute Progr am action to c all command.com by entering
%COMMAND% in the EXE Path field. Specify the file to open in the Command Line
WiseScript Editor Reference67
Page 68
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
zTitle
Enter the title for the dialog box.
zDescription
Enter text to explain the dialog box to the end user.
zName Prompt
Enter text to appear next to the Name field.
zCompany
Enter text to appear next to the Company field.
zSerial Number
Enter text to appear next to the Serial Number field.
zVariable
In the three Variable fields, enter the variables to store the Name, Company, and
Serial Number.
zConfirm Text
(Optional) 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
zVariable Name
Select or enter a variable to store the value.
zDefault Value
(Optional) Enter the value to put into the variable if the value is not found.
zRegistry Key
Enter the key that contains the value to be retrieved.
zValue Name
Enter the value name. (If you are reading the Win16 registry, lea ve this f ield blank.)
zRoot
Select the root that contains the registry key. (If you are reading the Win16
registry, leave HKEY_CLASSES_ROOT selected.)
zRemove File Name
Mark this to remove a file name from the end of a returned path, leaving only the
directory name. This operation is not performed on the Default Value.
WiseScript Editor Reference68
Page 69
zExpand Environment Variables
If you read a REG_EXPAND_SZ value, mark this to ha ve all environment v ariables 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.
To complete the dialog box
zVariable Name
Specify the variable in which to store the retrieved value.
zRetrieve
Select the information to retrieve:
Current Date/Time
The time is in 24-hour format. Example: 07/14/05 11:18:10
Windows Version
Example: 5.2.3790 (Windows 2003 Professional)
DOS Version
Example: 6.22
K Bytes Physical 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
Branding / Registration dialog box.
Registered Company Name
The company name entered when Windows was installed. This is used to pre-fill
the Branding / Registration dialog box.
Drive Type for Pathname
The type of drive of the file or directory that is specified in Pathname: N
(network), H (hard disk), C (CD-ROM), F (floppy or removable disk), R (RAM
disk).
First Network Drive
The letter of the first network drive, followed by a colon I f ther e are no network
drives, the response is blank.
First CD-ROM Drive
The letter of the first CD-ROM drive, followed by a colon. If there is no CD-ROM
drive, the response is blank.
WiseScript Editor Reference69
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.
Volume Serial Number
The serial number of the disk drive that is specified in Pathname.
Volume Label
The label of the disk drive that is specified in Pathname.
Windows Logon Name
The Windows network logon name of the user logged onto the destination
computer.
Service Pack Number
Service pack number of the current operating system, if one exists.
Current Date/Time (four-digit year)
Same as Current Date/Time above except a different format. Example: 07/
14/2005 11:18:10
File Date/Time Modified (four-digit year)
Same as File Date/Time Modified above except a different format. Example:
07/14/2005 11:18:10
Disk Free Space (KBytes)
Free disk space of the drive that is specified in Pathname. In Pathname, enter
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 (UTC) format. Coordinated Universal Time is an international time
standard, in which all time zones are computed relative to UTC. Example: in the
United States, Central Standard Time (CST) is six hours earlier than UTC time—
10:00 UTC is 4:00 CST.
Is OS 64 Bit
The value of the variable you specified above is set to 1 if the destination
computer is running a 64-bit operating system, and 0 if not.
zPathname
Use this field only for operations that retrieve information on files or directories.
Specify the full path of the file or directory to retrieve information from. You can use
variables (example: %MAINDIR%\Readme.txt). You also can enter a hardcoded
path (example: C:\Program Files\File.exe) but it is not recommended.
The sample script Autoplay.wse uses this action. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product’s installation directory.
WiseScript Editor Reference70
Page 71
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. Example: Use this to install a .DLL that is called during installation, and is then
no longer needed.
To complete the dialog box
zVariable
Specify a variable in which to store the temporary file name. Only a file name is
generated. To refer to this file, prefix it with the %TEMP% variable extension.
Example: If the variable is %HELPFILE%, the full path of the file would be
%TEMP%\%HELPFILE%.
Get Windows Installer Property
This action gets the value of a Windows Installer property in the currently running
Windows Installer installation and puts it into a WiseScript variable. Use this action only
in WiseScripts that are called from a Windows Installer installation.
Note
This action works only if you have Windows Installer Editor installed.
To complete the dialog box
zDest. Variable
Select or enter a variable to store the value of a Windows Installer property.
zProperty 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
Evaluate Windows Installer Condition on page 61
Halt Compilation
This action immediately stops compilation of the script. It must be placed between
Compiler Variable If and Compiler Variable End statements or the script will never
compile. Use this to ensure that conditions are met before compiling.
To complete the dialog box
zMessage Text
Enter a message to display to the user if the compile is stopped.
Example: You deve lop a script that uses runtime files. On y our own computer, you hav e
the correct runtime files to pull into the installation. However, you want to prevent
compilation on other computers if they lack correct runtime files because the resulting
installation could damage runtime installations on destination computers.
WiseScript Editor Reference71
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.
This action marks the beginning of a conditional block of script, an If block. If the
condition specified in the If Statement is true, the lines inside the If block are executed.
The If block can also contain an Else or several ElseIf actions.
To create an If block
1. Add an If Statement and complete the dialog box:
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 rules outlined in Variables and Expressions on page 28. The
variable is ignored and can be left blank. The result is considered true if it
evaluates to a non-zero result.
(The password comparisons are not applicable in this product.)
The Value
Enter 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 v ariables, 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
3. (Optional) Add an Else or several ElseIf actions. Follow the Else action with one or
4. Add an End Statement.
Sample scripts that use this action are Search.wse, WiseUp.wse, and scripts that
manipulate strings and perform calculations. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product’s installation directory.
See also:
Else Statement on page 60
ElseIf Statement on page 60
End Statement on page 61
Include Script
This action adds an additional script to the current installation script. During compile,
the include script is copied into the calling script at the location of the Include Script
action, resulting in a combination of the scripts.
Include scripts can save time because you can develop a library of WiseScripts that
perform specific functions, like subroutines. You can re-use include scripts and share
specified value.
more actions to perform if the compiler variable does not have the specified value.
WiseScript Editor Reference72
Page 73
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.
To make an include script, create a new file and select Blank Script. Otherwise the
include script contains the default script, which is designed to perform an installation.
The combined script would then have two wizard loops, two of every dialog box, and so
on. Only the script is inserted into the calling script.
To complete the dialog box
zPathname
Specify the path of the script. It should be a .WSE file on your computer, not the
destination computer. Because the main script and include scripts are combined
during compile, not run time, do not use a run-time variable in Pathname. Y ou can ,
however, use a compiler variable.
Example of a line in the script that includes a script:
Include Script C:\Scripts\OpensWord.wse
Example of what a short include script might look like:
Execute %PROGRAM_FILES%\winword.exe
Insert Line Into Text File
This action edits a text file on the destination computer. Use it to edit configur ation 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 where the text was found. Either
complete the Line Number field or the Search for Existing Text section. Do not
complete both because you can only do one or the other.
To complete the dialog box
zFile to Edit
Specify the path of the text file to edit (example: %SYS32%\File.txt).
zText to Insert
Enter the text to add to the file. If the line refers to a directory or file, start the path
with a variable (example: %MAINDIR%\Application.exe).
zLine Number
Enter the line number at which to insert the new text. Enter 0 to append to the end
of the file. Information in the Search for Existing Text area overrides any line
number that is specified here unless the text is not found.
zSearch for Text
Enter the text to search for. If more than one line in the file matches, only the first is
edited.
zComment Text
Enter comment to insert at the beginning of the found line. When replacing an
existing line, use this to leave the existing line in place but inactive. Set Insert
WiseScript Editor Reference73
Page 74
zInsert Action
zMatch Criteria
zIgnore White Space
zCase Sensitive
zMake Backup File
The sample scripts Add Tnsnames entr y.wse and T extFi le.wse use this action. For details
on sample scripts, see ScriptHelp.htm in the Samples subdirectory of this product’s
installation directory.
Install File(s)
This action installs files on the destination computer. Each file or directory to be installed
must have a separate Install File(s) action.
Action to insert before the existing line so that subsequent installations find and
edit the active command, not the commented line.
Select the action to be taken when a line is found.
Select how the line is matched with the text in Search for Text.
Mark this to ignore spaces and tab characters.
Mark this to make the match case-sensitive.
Mark this to make a copy of the text file before editing it. A number is appended to
the end of the file name for the backup copies (example: text.001, text.002, and so
on).
When you’re installing files permanently on the destination computer using 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
zSource Pathname
Specify the path of the file on your computer. You can use wildcards in this field to
indicate that all the files in a directory that match a certain pattern should be
installed (example: C:\Dev\*.exe). You can also use compiler variables, but you
should not use run-time variables, because this field is used at compile time.
zDestination Pathname
Specify the path the file will have on the destination computer. Use variables to start
the path (example: %MAINDIR%\Dev\File.txt). This field has a drop-down list with
common variables. Do not include wildcards in this field.
zDescription
Enter text to appear in the progress bar while this file is installed.
zRequire Password
(Not applicable in this product)
If you entered a password on the Password page, and you mark this, the end user is
prompted for the password before this file is installed.
WiseScript Editor Reference74
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 passwordprotected files are slated for installation, the prompt does not appear.
zInclude Sub-Directories
If you specify a directory in Source Pathname, mark this to include all
subdirectories and their contents.
zShared DLL Counter
If this is marked, and the file is a .DLL or .VBX, Windows tracks the file to prevent
its removal if an installed application is still using it.
zNo Progress Bar
To hide the progress bar, mark this for every file in the installation. If you mark it for
some files, but not others, the progress bar seems to display continuously because
the screen does not refresh between files.
zSelf-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 file, but specifies that it should be registered later. Include a SelfRegister OCX/DLL action to register the file.
See Self-Register OCXs/DLLs on page 84.
zReplace 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-installation (example: configuration
files).
Check File
The existing file is only replaced if the requirements you set in File Version and
File Date/Time are true.
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. If the existing file lacks a
version resource, it is not replaced.
For File Da t e/T im e , this replaces the existing file if its modification date
and time are the same or older than the new file.
Older
For File Version, this replaces the existing file if it has a version resource
that is older than the new file. If the existing file lacks a version resource, it
is not replaced.
For File Da t e/T im e , this replaces the existing file if its modification date
and time are older than the new file.
WiseScript Editor Reference75
Page 76
zRetain 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. However, if you call ext ernal .E XEs that install more files, the space those files
require is not accounted for. Use this action to increase the amount of required disk
space. Then use the Check Disk Space action to make sure that enough space exists.
Use this action inside an If block that checks whether the affected component is being
installed. Example:
If COMPONENTS Contains Any Letters in “A” then
Modify Component Size: 1024
End
The COMPONENTS variable is populated with a letter of the English alphabet for each
component set to be installed, starting with A for the first component, B for the second,
and so on.
To complete the dialog box
zSize (Kbytes)
Enter the amount of additional disk space to reserve.
zDest. 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 action lets you customize the uninstall, by turning logging off
and on at key points to prevent some actions from being recorded in the log. If you use
this action to stop logging, you must also use it to resume logging or no log file is
created.
To complete the dialog box
Select one of the following options for each Open/Close Install.log action that you add to
the script.
zResume/Start writing entries into installation log
zPause writing entries into installation log
This must be followed, at some point, by another Open/Close Install.log action that
resumes writing, or no log file is created.
zOpen new installation log
Mark this to create an installation log. Then enter the complete path or just the file
name of the new log to the right (examples: %MAINDIR%\Speciallog.log or
WiseScript Editor Reference76
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
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. Example: If you split the string “ONE,TWO” at the
first occurrence of a comma, “ONE” is put into destination variable 1 and “TWO” is put
into the destination variable 2. If the character or substring is not found, the entire
string is put into destination variable 1, and nothing is put into destination variable 2.
The find is case-sensitive.
You can also split a string at any arbitrary character position, which discards no
characters. Example: If you split the string “ONE,TWO” at character position four from
left, then “ONE,” is put into the destination variable 1 and “TWO” is put into the
destination variable 2.
To complete the dialog box
zSource Value
Enter the text to be parsed. You enter text and variables (examples: %MAINDIR%
or %MAINDIR%\%PICTDIR%). To include a lite ral percent ( %) symbol, use %%.
zPattern/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 characters, including numbers, and select one of the pattern
options in Operation. To split a string based on character position, enter the
character position, where 1 is the first character, and select one of the position
options in Operation.
zDestination Variable 1,2
Select or enter variables to store the two strings resulting from this operation.
Operation, below, determines how each variable is populated.
zOperation
Select how to split the text string.
zTrim Spaces
Mark this to remove leading and trailing spaces from both destination variables.
zIgnore Case
Mark to make pattern matching case-insensitive.
The sample scripts TextFile.wse and URL.wse use this action. For details on sample
scripts, see ScriptHelp.htm in the Samples subdirectory of this product’s installation
directory.
WiseScript Editor Reference77
Page 78
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
zMilliseconds to pause
Enter the number of milliseconds to pause the script. A millisecond is 1/1000 of a
second. To pause for one second, enter 1000.
Play Multimedia File
This action plays an audio (.WAV) or video (.AVI) file during installation. Playback is
asynchronous, which means the sound or movie can play while the installation
continues. The multimedia file must be installed on the destination computer before this
action is called. It must be small enough to fit into the destination computer’s RAM for it
to play correctly, because the disk is heavily accessed by the installation process. To
produce sound, the destination computer must be properly equipped and configured.
To complete the dialog box
zFile Type
Select either .WAV or .AVI.
zPathname
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%.
zX Position, Y Position
Indicate the location on a 640 x 480 screen at which an .AVI file should be played
back. Coordinates are adjusted proportionately for the display resolution on the
destination computer.
zLoop Continuously
Post to HTTP Server
This action posts information over the Internet to a Web server. (Example: Use it to
record user registration information or other data.) You must set up a CGI program or
Active Server Page (.ASP) on the server that accepts data sent by an HTTP POST
operation and deciphers encoded characters.
The destination computer must have a valid Internet connecti on. If end users might not
have this capability, you can add a prompt on a dialog box asking the end user if they
have Internet connectivity. Then use the results from the prompt to run this action or
not.
To complete the dialog box
zDestination URL
Enter the URL of the CGI program or ASP page that accepts posted data.
WiseScript Editor Reference78
Page 79
zText to Post
The text to post should be one or more lines in the format:
field=data
where field is the name of the fi eld 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.
The field names might be the same as variable names, but they do not have to be.
You include variables enclosed in % in the text to be posted. Use %% to send an
actual % symbol.
zError Handling
Specify how to handle errors in the posting operation.
Ignore Errors
The script continues regardless of any errors.
Abort Installation
The installation stops if the post cannot be completed.
Start Block
The Post to HTTP Server action begins a conditional block. The statements
between this action and the next End statement are executed only in the event
of an 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 WiseScripts. In new scripts, use custom dialog boxes or dialog
box controls to perform the same function. This action requires an End Statement,
because it begins a block of statements, similar to an If Statement.
To complete the dialog box
zDialog Type
Select Open File or Save As.
zDialog Title
Enter the title for the dialog box.
zDest. Variable
Select or enter a variable to store the path of the file or directory the end user
selects.
zDefault Extension
Enter the extension to append to the file name if the end user does not enter one.
zFilter List
Enter the file types to appear in the Files of Type drop-down list in the Open or
Save dialog box. Use Shift+Enter to enter a carriage return in this field. Example: to
show text, .JPGs and bitmaps, enter:
WiseScript Editor Reference79
Text Files (*.txt);*.txt;
Pictures (*.jpg);*.jpg;
Page 80
zAllow selection of multiple files
Mark this to let en d users select multiple files with Ctrl or Shift.
zPrompt if file does not exist
Mark this to display a confirmation dialog box if the specified file does not exist.
zFile must exist
Mark this to halt the installation until an existing file has been specified.
zPathname must exist
Mark this to halt the installation until an existing path has been specified.
zSkip write permissions test
If you selected Save As for Dialog Type, and you clear this check box, the
installation tries to create the file that the end user specified in the Save As dialog
box to verify write permissions. If you mark this check box, t he installation does not
try to create the file.
zDo not validate the pathname
Mark this to accept any path without any validation.
zDisplay prompt if overwriting existing file
Mark this to display a message if a file selected by the end user already exists.
Prompt for Text
Bitmaps (*.bmp);*.bmp
This action displays a dialog box that lets an end user enter a line of text. Optionally , y ou
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 boxe s or
dialog box controls to perform the same function.
To complete the dialog box
zWindow Name
Enter the title for the dialog box.
zDescription
Enter brief instructions here.
zPrompt Name
Enter the label to be displayed next to the text input field.
zDefault Value
Enter the text to be displayed in the text input field by default.
zVariable Name
Enter a variable to store the text entered by the end user.
zDirectory
Mark this to delete trailing backslashes from the text, so you can use it as a
directory path.
zConfirm If Exists
If this check box is marked, and the end user enters the path of an existing file or
directory, a dialog box asks whether to overwrite.
The sample scripts Adding.wse, Comcat$.wse, Division.wse, Instr.wse, Lcase$.wse,
Left$.wse, and Len.wse use this action. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product’s installation directory.
WiseScript Editor Reference80
Page 81
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
zTitle
Enter the title for the dialog box.
zDest. Variable
Enter a variable to store the letters correspondin g to th e button the end user
clicks.The button clicked by the end user is re turned as a l ett er: A for t he firs t radio
button, B for the second, and so on. If the script sets this variable to a letter before
this action runs, the corresponding button appears selected by default.
zDescription
Enter explanatory text to be displayed above the radio buttons. Press Shift+Enter
for a carriage return.
zComponent List
Enter the choices, one on each line, pressing Enter after each.
Read INI Value
This action reads an entry from an existing .INI file into a variable. Example: Obtain a
path to a file.
To complete the dialog box
zINI Pathname
Specify a complete path to the .INI file (example: %WIN%\Sample.ini).
zINI 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: DIRECTORIES).
zINI Item
Enter the name of the entry to read from the .INI file.
zDefault Value
Enter the value to store in the variable below if the specified entry is not found.
zVariable Name
Enter a variable to store the value of the INI item.
zRemove File Name
Mark this to remove a file name from the end of a returned path, leaving only the
directory name. This operation is not performed on the Default Value.
Read/Update Text File
This action begins a loop that reads and, optionally , updates text in a text file. Each loop
puts the next line of text into a variable. You can put actions in the loop that change the
contents of the variable (example: Parse String). Optionally, the changed variable can
WiseScript Editor Reference81
Page 82
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
zPathname
Specify the full path to the text file to be edited on the destination computer
(example: %WIN%\Sample.txt).
zVariable
Specify the variable in which to store each line of the text file (example: TEXTLINE).
zAction
Select an action:
Read lines of file into variable
Reads a line into the variable, but does not write it back to the original file.
Update file with new contents of variable
Reads a line into the variable, and at the en d of the loop, writes the content s of
the variable back to the line in the text file.
zMake Backup File
Mark this to make a copy of the text file before editing it. A number is appended to
the end of the file name for the backup copies (example: text.001, text.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 moved, it is
overwritten.
This action does not support reading or writing non-ASCII characters (characters with
codes above 127).
To complete the dialog box
zFile Pathname
Specify the path of the file to be read (example: %MAINDIR%\File.exe).
zVariable Name
Select or enter the variable that is to be read into or written from.
zFile Offset
Enter the number of bytes into the file to start writing or reading. Bytes are
numbered starting with zero.
zMax. Length
Enter the maximum number of bytes to be written to or read from the file. When
writing, if the length of the variable exceeds this value, the string is truncated.
When reading, any trailing spaces are trimmed.
WiseScript Editor Reference82
Page 83
zTransfer Direction
zNull Terminated
Register Font
This action registers a new TrueType font (.TTF file) that has been copied into the
Windows font directory.
To complete the dialog box
zFont File Name
zFont Name
Remark
Select whether to write to or read from the file.
If this check box is marked, a zero byte is written to the binary file after the string.
Specify the file name of the .TTF font file (not the path) to be registered. The dropdown list contains font files that you have added to this installation. The file must
already have been installed in the font directory on your computer, and the font’s
file name must match its internal name.
Enter the full name of the font here. The name you enter here appears in Font
menus on the destination computer. It is added to the Fonts section of the WIN.INI
file and to the registry.
This action adds comments or blank lines to the script. Remarks are green by default.
zComment
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
existing file or directory, or a file or directory that your installation installed. The file
must not be busy.
To complete the dialog box
zOld Pathname
Specify the full path to the existing file or directory (examples:
%MAINDIR%\Pictures\Picture.jpg or %MAINDIR%\Pictures). If you click Browse,
you can select only a file.
zNew File Name
Enter the new file name or directory name (examples: picture2.jpg or Photos).
Search for File
This action searches for a file on local drives, network drives, or all drives, and returns
the full path to the file.
WiseScript Editor Reference83
Page 84
To complete the dialog box
zFile 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.
zVariable Name
Enter a variable to store the file path.
zDefault Value
If the file is not found, the variable above contains the value you enter here. If this
is left blank, the variable is blank if the file is not found.
Example: Specify the location where the file is normally installed. If the file is found,
the new version could overwrite the found file. If the file is not found, the new
version could be installed to the default location.
zMessage Text
Enter a message to display during the search operation.
zReturn Type
Select whether to return only the first match, or list of all matches.
zDrives to Search
Select to search local drives, network drives, or both. Y ou can also choose to s earch
the directory path specified in File Name.
zSearch 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 m a n ually
locate the directory containing the file.
See Browse for Directory on page 38.
zRemove File Name
Mark this to remove a file name from the end of a returned path, leaving only the
directory name. This does not apply to the Default Value field.
The sample script Search.wse uses this action. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product’s installation directory.
Self-Register OCXs/DLLs
Use this action to self-register all queued .OCX, .DLL, and .EXE fil es or to add an existing
file to the queue.
zDescription/Pathname
If you mark Register all pending OCXs/DLLs/EXEs below, enter a message
to display to the end user during registration. The Browse button is unavailable
if you mark this option.
If you mark Queue existing file for self-registration below, specify a full
path of the file to register.
WiseScript Editor Reference84
Page 85
zRegister 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.
See Install File(s) on page 74 and Copy Local File(s) on page 48.
zQueue existing file for self-registration
Mark this to queue the file listed in Pathname for later self-registration.
Set Control Attributes
This action appears only when you are in a dialog box script.
This action shows, hides, enables, or disables a control in a dialog box. Controls without
names cannot be manipulated with this action.
To access this action
1. Double-click a Custom Dialog script line.
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 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
The sample scripts Event Handler.wse and License Agreement.wse use th is action. For
details on sample scripts, see ScriptHelp.htm in the Samples subdirectory of this
product’s installation directory.
Set Control Text
This action appears only when you are in a dialog box script.
This action changes the text associated with a control in a dialog box. Controls without
names cannot be manipulated with this action.
To access this action
1. Double-click a Custom Dialog script line.
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 Control Text.
Select how to manipulate the control.
WiseScript Editor Reference85
Page 86
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.
Control Text
Enter new text to associate with the control.
The sample script Event Handler.wse uses this action. For details on sample scripts, see
ScriptHelp.htm in the Samples subdirectory of this product’s installation directory.
Set Current Control
This action appears only when you are in a dialog box script.
This action sets a control to be the current control in a dialog box. The current control is
the one to which keyboard operations apply. (Example: If the OK button is the current
control, and you press Enter , the OK button is activated.) Controls without names 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 set as
current.
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.
Set File Attributes
This action sets the attributes of one file or a group of files.
To complete the dialog box
zFile Pathname
Specify a file to change (example: %MAINDIR%\Acrobat.pdf). You can use
wildcards to specify multiple files (example: %MAINDIR%\*.pdf).
zRead Only / Hidden / System
Mark the attributes to set.
zScan Directory Tree
Mark this to apply the changes to all files in the specified directory, along with all
files in its subdirectories and their subdirectories.
WiseScript Editor Reference86
Page 87
zArchive
Mark this to set th e a rchive 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.
To complete the dialog box
zMinimum Files
The minimum number of files to be specified by FILES= in Config.sys. Set this to
zero or leave blank to leave FILES= unchanged.
zMinimum Buffers
The minimum number of buffers to be specified by BUFFERS= in Config.s ys. Set this
to zero or leave blank to leave BUFFERS= unchanged.
Set Variable
This action sets the value of a variable by providing a literal value, by modifying the
variable’s existing value, or by evaluating an expression.
To complete the dialog box
zVariable
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.
zNew 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.
zOperation
Select the operation to be performed on the value in New Value.
Nothing
No additional changes are made.
Increment, Decrement
If the value is a number, it is increased or decreased by one. To do this
operation, you must specify the variable’s existing value in the New Value
field. Example: To increment the variable VAR, enter VAR in the Variable field
and %VAR% in the New Value field.
Remove trailing backslashes
Trailing \ characters are removed, converting the variable to a valid directory
name.
Convert to long or short filename
Converts an existing path to its equivalent long or short path if the installation
runs on Windows 95 or NT. For this to work, the specified directory or file must
exist.
WiseScript Editor Reference87
Page 88
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.
zAppend to Existing Value
Mark this to add the variable’s new value to the end of its original value instead of
replacing it.
zRemove File Name
Mark this to remove a file name from the end of a returned path, leaving only the
directory name.
zRead Variable From Values File
Mark this to read the variable from the values file that is specified on a command
line to the installation .EXE using the /M command-line option. The values file is a
simple text file with variables listed, one per line, in NAME=“VALUE” format. If the
variable is found in the values file, the specified v alue is used; otherwise, its value is
unchanged. It can be up to 32 K in size.
The sample scripts Adding.wse and Division.wse use 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 Windows Installer
installation.
Note
This action works only if you have Windows Installer Editor installed.
To complete the dialog box
zProperty Name
Enter the name of a Windows Installer property. This can be e i ther an existing
Windows Installer property , or a new property name. Entering a new property name
creates the property in Windows Installer.
zProperty Value
Enter the value to assign to the Windows Installer property. You can either hardcode a value or enter a WiseScript variable enclosed in percent signs.
See also:
Get Windows Installer Property on page 71
Evaluate Windows Installer Condition on page 61
Start/Stop Service
This action lets you start or stop a service on the destination computer. It only applies to
operating systems that support services.
WiseScript Editor Reference88
Page 89
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
zService 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. If you used the Create
Service action to create the service, this is the same name you entered in the
Create Service Settings dialog box.
zOperation
Select to start or stop the service.
Example: Suppose a service must be stopped before it can be updated. Use this action
to first stop the service, then update its files.
See also:
Create Service on page 50
While Statement
This action begins a While loop. An End Statement must end the loop. As long as the
condition specified in the While Statement Settings dialog box is true, the script lines
inside the loop execute repeatedly. If the condition is not true, then 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 28. The
variable is ignored and can be left blank. The result is considered true if it
evaluates to a non-zero result.
(The password comparisons are not applicable in this product.)
The Value
Enter the value to be used in the comparison, or an expression if the
comparison is set to Expression True. If you enter variable names in this field,
do not surround them with percent signs (%). If you enter compiler variables,
then you must surround them with percent signs.
Perform While loop at least once
Mark this so the loop executes 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.
2. Below the While Statement, add one or more actions to perform if the variable has
the specified value.
3. Add an End Statement.
WiseScript Editor Reference89
Page 90
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. Alternatively, use the predefined variables %SYS% or %SYS32% to access the
system directory. This action is included to provide backward compatibility for older
WiseScripts.
To complete the dialog box
zVariable Name
Enter a variable to store the result.
Wizard Loop
This action precedes dialog boxes that make up the majority of the installation’s end
user interface. End users can move forward and backward through these dialog boxes.
The script continues executing inside the wizard loop until the last dialog box has been
completed and accepted.
Use this script action to create the wizard loop.
To complete the dialog box
zDialog 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.
zSkip 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 back up configuration files before
installing, and the next asks where to store the backup files, you could set a
condition on the second dialog box to skip it if the DOBACKUP variable, which is set
by the first dialog box, is equal to “NO.”
If Variable
Build a condition by selecting or entering a variable and by selecting a
comparison. The first list shows variables defined in this installation. The second
list shows available comparisons.
Expression True means the expression in the Value field below is evaluated
according to the rules outlined in Variables and Expressions on page 28. The
variable is ignored and can be left blank. The result is considered true if it
evaluates to a non-zero result.
(The password comparisons are not applicable in this product.)
WiseScript Editor Reference90
Page 91
WiseScript Editor Reference91
Page 92
Chapter 4
Creating Custom Dialog Boxes
This chapter includes the following topics:
zAbout Dialog Boxes on page 92
zAbout the Custom Dialog Editor on page 92
zAbout Dialog Box Controls on page 94
zSolutions for Dialog Box Problems on page 115
zAbout Custom Dialog Box Sets on page 116
zCreating a Custom Dialog Box Script on page 118
About Dialog Boxes
Use the Custom Dialog Editor to change the appearance of installation dialog boxes and
to create new dialog boxes. You can edit and create default dialog box templates, add
interactivity to dialog boxes, and work with dialog box sets, and translate dialog bo x 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:
Create new dialog boxesSee Adding a Dialog Box to the Installation on
page 93.
Edit dialog boxesSee Editing Dialog Boxes on page 93.
Set dialog box propertiesSee Setting Dialog Box Properties on page 94.
Create a dialog box setSee About Custom Dialog Box Sets on
page 116.
Add interactivity to dialog boxesSee Creating a Custom Dialog Box Script on
page 118
Access the Custom Dialog Editor from:
Script EditorDouble-click the Custom Dialog script action or a
Custom Dialog script line.
WiseScript Editor Reference92
Page 93
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
1. In Script Editor, double-click the Custom Dialog script action in the Actions list.
The Dialog Box Properties dialog box appears.
2. Enter a title for the dialog box in Dialog Title and click OK. Do not enter the same
title as an existing dialog box.
See Setting Dialog Box Properties on page 94.
The new dialog box opens in the Custom Dialog Editor.
3. Add and configure controls on the new dialog box.
See About Dialog Box Controls on page 94
See Adding and Editing Dialog Box Controls on page 96
4. Select File menu > Save Changes and exit.
Note
To use 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 Dialog Boxes
When you edit a dialog box, the changes affect the current installation only. However, if
you save the dialog box and overwrite the .DLG template file, then the dialog box is
changed for all future installations
1. In Script Editor, locate and double-click the Custom Dialog script line that calls the
dialog box.
The dialog box opens in the Custom Dialog Editor.
2. Make changes to the dialog box by adding, editing, or removing controls.
See Adding and Editing Dialog Box Controls on page 96
See Aligning and Spacing Dialog Box Controls on page 113
3. Select File menu > Save Changes and exit.
See also:
WiseScript Editor Reference93
.
Page 94
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.
1. Open the dialog box in the Custom Dialog Editor.
See Editing Dialog Boxes on page 93.
2. Select Edit menu > Dialog Box Properties.
The Dialog Box Properties dialog appears. (This dialog box also appears when you
click Add on the Dialogs page.)
3. Complete the dialog box:
Dialog Title
Enter the title for the dialog box.
Font Name / Font Size
Enter the exact name of a font and a point size. This font type and size is
applied to any text whose font attribute is set to Default Font. When y ou add or
edit a text box, you can set the font to the default or override the default with a
customized font.
Width / Height
Enter the dialog box 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 y ou select Default, the
dialog box is centered on the screen.
Do not display wizard graphic on this dialog
Normally, the wizard graphic is set in the Wizard Loop script action, and applies
to all dialog boxes in the wizard loop. Mark this check box to turn off the wizard
graphic on this dialog box.
4. Click OK.
About Dialog Box Controls
Installation dialog boxes contain standard controls, which you can add and edit. Most
controls are configured by completing their Settings dialog box.
See Adding and Editing Dialog Box Controls on page 96.
You can add the following types of controls to dialog boxes:
Check boxA single check box for on/off, true/false settings.
WiseScript Editor Reference94
See Adding Check Box Controls on page 96.
Page 95
Combo BoxA combination edit field and drop-down list control that lets
the end user select a predefined value or enter a value.
See Adding Combo Box Controls on page 97.
Edit TextAn editable text field that accepts single or multiple lines.
You can also use this type of control to display a text file.
See Adding Edit Text Controls on page 99.
GraphicA non-editable bitmap graphic.
See Adding Graphic Controls on page 101.
Group BoxA boundary box drawn around related controls.
See Adding Group Box Controls on page 102.
Hot TextText that you can link to actions or a Web page.
See Adding Hot Text Controls on page 103.
List BoxA 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 AVIAn animation. This does not include controls to play, stop,
rewind, or fast forward the movie.
See Adding Play AVI Controls on page 106.
Push ButtonA clickable button. Generally you must configure buttons to
perform an action, such as displaying another dialog box.
Buttons can also close a dialog box, set script variables, and
take other actions. Every dialog box must contain at least
one button.
See Adding Push Button Controls on page 107.
Radio ButtonA group of mutually exclusive options with a separate radio
button for each option.
See Adding Radio Button Controls on page 109.
RectangleA box.
See Adding Rectangle Controls on page 110.
Text ControlStatic text field for displaying messages. The end user
cannot change text in this type of field.
See Adding Text Controls on page 111.
The sample scripts that use custom dialog boxes all use dialog box controls. For details
on sample scripts, see ScriptHelp.htm in the Samples subdirectory of this product’s
installation directory.
See also:
Aligning and Spacing Dialog Box Controls on page 113
Setting Tab Order of Dialog Box Controls on page 114
WiseScript Editor Reference95
Page 96
Adding and Editing Dialog Box Controls
1. Open the dialog box in the Custom Dialog Editor.
See Editing Dialog Boxes on page 93.
2. 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.
The settings dialog box for the control appears.
3. Complete the dialog box.
For information about the settings dialog bo x for each control, see About Dialog Box
Controls on page 94.
4. Click OK to add the new control to the dialog box.
You can resize and move the control using its handles. To select multiple controls, use
Shift+click. To resize and move controls with more precision, double-click the control to
open its settings dialog box.
See also:
Aligning and Spacing Dialog Box Controls on page 113
Setting Tab Order of Dialog Box Controls on page 114
About Dialog Box Controls on page 94
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 subcomponents.
1. Open the dialog box in the Custom Dialog Editor.
See Editing Dialog Boxes on page 93.
2. Select Add menu > Checkbox.
The Checkbox Control Settings dialog box appears.
3. Complete the dialog box:
Checkbox Text
Enter the text options for the check boxes, one on each line. If the end user
selects the first check box, the letter A is appended to the variable that stores
the return value. If the end user selects the second check box, the letter B is
appended, and so on. The variable stores letters of all check boxes that are
selected. Example: If the end user marks the first, third, and fourth check
boxes, the variable is “ABD.”
Variable
Specify the name of the script variable that stores the return value of this dialog
box control.
WiseScript Editor Reference96
Page 97
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,” last two options unavailable.
Sub-Components
If the check box control is being used to specify the components to be installed,
and if the components have sub-components, enter the names of subcomponent variables separated by commas.
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.
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 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 av er age width of the font and a ve rtical
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.
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 selecting components and you have specified the
COMPONENTS variable.
Retain Disabled
If you set the check box 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 takes the value of the option that was
selected, and the lowercase information is lost.
4. Click OK.
See also:
About Dialog Box Controls on page 94
About Dialog Boxes on page 92
Adding Combo Box Controls
A combo box can take three forms: a list box, a drop-down list, and a drop-down list
that can accept text entry. In the text entry drop-down list, end users can enter text or
WiseScript Editor Reference97
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.
1. Open the dialog box in the Custom Dialog Editor.
See Editing Dialog Boxes on page 93.
2. Select Add menu > Combo Box.
The Combo Box Control Settings dialog box appears.
3. Complete the dialog box:
Combo Box Text
Enter the text to be displayed in the list. Enter one item per line.
Sort
Mark this to sort the combo box items into ascending order.
Vert. Scroll
Mark this to let the end user scroll vertically if there are more items than fit into
the allocated space.
Auto HScroll
Mark this to scro ll 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 use r’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 before it is placed in the
variable.
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.
Variable
Specify the name of the script variable that stores the return value of this dialog
box control.
Note
T o cause an option in the list to be pre-selected, use a Set Variable action to set
a variable to the value of one of the options. Then select that variable in the
Variable field.
Combo Box Type
Select the combo box type:
WiseScript Editor Reference98
Page 99
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.
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 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 av er age width of the font and a ve rtical
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.
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 information. You can also use it
to display text (example: license agreements or ReadMe files).
1. Open the dialog box in the Custom Dialog Editor.
See Editing Dialog Boxes on page 93.
2. Select Add menu > Edit Text.
The Edit Text Control Settings dialog box appears.
3. Complete the dialog box:
Default
Enter text to appear in the Edit Text control by default. To start a new line,
press Ctrl+Enter and then mark the Multi-line check box below.
Variable
Specify the name of the script variable that stores the return value of this dialog
box control.
Alignment
Select how to align the text in the edit field. This is enabled only when the
Multi-line check box is marked.
WiseScript Editor Reference99
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. Scroll
Mark this to add a vertical scroll bar.
Auto HScroll
Mark this to scroll the text if it extends past the right edge of the edit field.
Auto VScroll
Mark this to scroll the text if it extends past the bottom of the edit field.
Multi-line
Mark this to allow multiple lines of text to be entered into the edit field.
Password
Mark this if entered text should display as asterisks (*), providing password
security.
No Hide Sel
Normally, text highlighting is hidden when the dialog box loses focus. Mark this
check box to suppress the hiding of highlighting.
Want Return
Mark this to let the en d user advance to the next line with the Enter key. This
option must be used with the Multi-line option.
Border
Mark this to include a border around the edit fi el d.
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 marked for input fields.
RichEdit
Mark this to support rich text objects (example: formatted text, bold, italic, font
size variations, and colors). This causes rich text files to display properly.
Read Default Text from File
Enter the path of a text file. This path should be relative. Use variable
substitution (example: %MAINDIR% to refer to the destination directory) to
begin the path. The file contents are displayed in this field.
Min. Length / Max. Length
Enter the minimum or maximum allowed number of characters f or te xt entere d
in this field. To make the field optional, set the minimum length to zero.
Directory
Mark this to remove trailing backslashes from the text before it is placed in the
variable.
WiseScript Editor Reference100
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.