WiseScript Editor (Wise Package Studio 5.5) Copyright
© 1994-2004 Wise Solutions, Inc. All Rights Reserved. This documentation and the accompanying software are copyrighted materials. Making unauthorized copies is prohibited by law. No part of the software or documentation may be reproduced, transmitted, transcribed, stored in a retrieval system or translated into any human or computer language without prior written permission of Wise Solutions, Inc. Wise Solutions, Inc. asserts its “Moral Right” to be identified as the author of this work, in all jurisdictions which recognize the “Moral Right.”
Notice
Unless otherwise provided by written agreement with Wise Solutions, Inc., this publication, and the software sold with this publication, are provided “as is” without warranty of any kind either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. The entire risk arising out of the use or performance of this publication and software remains with you. In no event will Wise Solutions, Inc., or any of its suppliers, be liable for any lost profits, lost savings, direct, incidental or indirect damages or other economic or consequential damages, even if Wise Solutions, Inc., or its suppliers, have been advised of the possibility of such damages. Wise Solutions, Inc. reserves the right to modify this document at any time without obligation to notify anyone. In no event shall Wise Solutions, Inc.’s or its suppliers’ liability under this agreement exceed the sum of any amounts paid hereunder by the customer to Wise or the supplier.
Trademarks Wise Solutions, Inc. owns a number of registered and unregistered Trademarks and Service Marks (the “Marks”). These Marks are extremely valuable to Wise Solutions, Inc. and shall not be used by you, or any other person, without Wise Solutions, Inc.’s express written permission. The Marks include, but are not necessarily limited to the following: Application Isolation Wizard™; ApplicationWatch™; ConflictManager®; ExpressBuild™; Installation Development Life Cycle™; InstallBuilder®; InstallMaker®; InstallManager®; InstallTailor™; MSI Debugger™; MSI Script™; PackageManager™; Preflight Deployment™; SetupCapture®; SmartMonitor™; SmartPatch®; Software Distribution Made Easy™; Software Installations Made Easy®; Visual MSIDiff™; Virtual Capture™; WebDeploy™; Wise Installation System®; Wise Package Studio®; Wise Software Repository™; Wise Solutions®; WiseScript™; WiseScript Express™; WiseUpdate®; WiseUser®; and the Wise Solutions logo. In addition to Wise Solutions, Inc.’s Marks, some Wise Products may include Trademarks or Service Marks owned by other corporations. These other Marks include, but are not necessarily limited to Microsoft® Windows® and Microsoft® Visual Studio® .NET, which are registered Trademarks of Microsoft Corporation. You shall not use any of the Trademarks or Service Marks of Wise Solutions, Inc., Microsoft Corporation, or any other entity, without the express written permission of such Trademark or Service Mark owner.
Wise Solutions, Inc.
47911 Halyard Drive; Plymouth, Michigan 48170 USA Phone: 734-456-2100 • Fax: 734-456-2456 •
[email protected] • www.wise.com
2
Contents 1
Welcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Documentation Roadmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Getting Help and Product Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2
WiseScript Editor Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 WiseScript Editor Views . . . . . . . . . . . . . . . . . . . . Navigating Between Views. . . . . . . . . . . . . . . . Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a New Installation . . . . . . . . . . . . . . . Opening a Microsoft SMS Installation . . . . . . . . Using Installation Expert . . . . . . . . . . . . . . . . . Using Setup Editor . . . . . . . . . . . . . . . . . . . . . Compiling, Testing, and Running the Installation Installation Management . . . . . . . . . . . . . . . . . . . Changing Source Directories . . . . . . . . . . . . . . Converting to UNC-Based Source File Paths. . . . Converting to Relative Source File Paths . . . . . . Using Self-Repair . . . . . . . . . . . . . . . . . . . . . . Customizing Your Development Environment . . . . . Creating and Editing Installation Templates . . . . Customizing Installation Expert Page Groups . . . Changing Installer Messages . . . . . . . . . . . . . . Setting Preferences . . . . . . . . . . . . . . . . . . . .
3
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. 13 . 13 . 14 . 14 . 15 . 15 . 16 . 16 . 18 . 18 . 18 . 19 . 19 . 21 . 21 . 21 . 23 . 23
Installation Expert Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Active Directory . . . . . Add/Remove Programs Autoexec.bat . . . . . . . Build Settings . . . . . . Compiler Variables . . . Components . . . . . . . Config.sys . . . . . . . . . Devices . . . . . . . . . . . Dialogs . . . . . . . . . . . Digital Signature . . . . File Associations. . . . . Files . . . . . . . . . . . . . Fonts . . . . . . . . . . . . General Information . . INI Files . . . . . . . . . . Installation Log . . . . . Languages. . . . . . . . . Media . . . . . . . . . . . . Microsoft SMS . . . . . . Password. . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. 26 . 27 . 27 . 29 . 30 . 31 . 32 . 33 . 33 . 34 . 35 . 36 . 40 . 41 . 41 . 42 . 43 . 43 . 44 . 44
3
Product Details. . . . . . Progress Bar . . . . . . . Registry . . . . . . . . . . Screen . . . . . . . . . . . Services . . . . . . . . . . Shortcuts . . . . . . . . . SmartPatch . . . . . . . . System Requirements . System Search. . . . . . Uninstall . . . . . . . . . . WebDeploy . . . . . . . .
4
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. 45 . 45 . 46 . 49 . 50 . 51 . 53 . 54 . 55 . 57 . 58
Setup Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 About Setup Editor . . . . . . . . . . . . . . . . . . . . . The Setup Editor Window . . . . . . . . . . . . . . Choosing a Script to Edit . . . . . . . . . . . . . . . Editing the Script . . . . . . . . . . . . . . . . . . . . Adding New Actions to a Script . . . . . . . . . . Finding Text in a Script . . . . . . . . . . . . . . . . Replacing Text in a Script . . . . . . . . . . . . . . Checking for Duplicate Files in Include Scripts Customizing the List of Actions . . . . . . . . . . About User-Defined Actions . . . . . . . . . . . . . . . Creating a User-Defined Action . . . . . . . . . . Creating a User-Defined Action Tutorial. . . . . About Debug Commands . . . . . . . . . . . . . . . . . Using the Debug Commands . . . . . . . . . . . . Building a Debug Version . . . . . . . . . . . . . . Basic Scripting Concepts. . . . . . . . . . . . . . . . . . Conditionals and Loops . . . . . . . . . . . . . . . . Variables and Expressions . . . . . . . . . . . . . . Compiler Variables vs. Runtime Variables . . . Anatomy of a Script . . . . . . . . . . . . . . . . . . About Components . . . . . . . . . . . . . . . . . . .
5
. . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. 63 . 63 . 65 . 65 . 67 . 67 . 68 . 68 . 69 . 70 . 70 . 71 . 75 . 75 . 76 . 78 . 78 . 79 . 80 . 81 . 81
WiseScript Actions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 WiseScript Editor and Wise Installation System Script Actions Add Directory to PATH . . . . . . . . . . . . . . . . . . . . . . . . . . . Add ProgMan Icons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add Text to INSTALL.LOG . . . . . . . . . . . . . . . . . . . . . . . . . Add to AUTOEXEC.BAT . . . . . . . . . . . . . . . . . . . . . . . . . . . Add to CONFIG.SYS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Add to SYSTEM.INI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Allow Floppy Disk Change . . . . . . . . . . . . . . . . . . . . . . . . . Browse for Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Call DLL Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Check Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Check Disk Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Check HTTP Connection . . . . . . . . . . . . . . . . . . . . . . . . . . Check If File/Dir Exists . . . . . . . . . . . . . . . . . . . . . . . . . . . Check In-use File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. 83 . 84 . 84 . 85 . 86 . 87 . 87 . 88 . 88 . 88 . 93 . 94 . 94 . 95 . 96
4
Check Service . . . . . . . . . . . . . . . . Compiler Variable If/Else/End . . . . . Config ODBC Data Source . . . . . . . . Copy Local File(s) . . . . . . . . . . . . . . Create Directory. . . . . . . . . . . . . . . Create Service . . . . . . . . . . . . . . . . Create Shortcut . . . . . . . . . . . . . . . Custom Billboard . . . . . . . . . . . . . . Custom Dialog . . . . . . . . . . . . . . . . Delete File(s) . . . . . . . . . . . . . . . . . Display Billboard . . . . . . . . . . . . . . Display Message. . . . . . . . . . . . . . . Display Progress Message . . . . . . . . Display Text File. . . . . . . . . . . . . . . Edit INI File . . . . . . . . . . . . . . . . . . Edit Registry . . . . . . . . . . . . . . . . . Else Statement . . . . . . . . . . . . . . . ElseIf Statement . . . . . . . . . . . . . . End Statement . . . . . . . . . . . . . . . . Evaluate Windows Installer Condition Execute Program . . . . . . . . . . . . . . Exit Installation . . . . . . . . . . . . . . . Find File in Path . . . . . . . . . . . . . . . Get Environment Variable . . . . . . . . Get Name/Serial Number . . . . . . . . Get ProgMan Group . . . . . . . . . . . . Get Registry Key Value . . . . . . . . . . Get System Information . . . . . . . . . Get Temporary Filename . . . . . . . . . Get Windows Installer Property . . . . Halt Compilation . . . . . . . . . . . . . . If Statement . . . . . . . . . . . . . . . . . Include Script . . . . . . . . . . . . . . . . Insert Line Into Text File . . . . . . . . . Install File(s) . . . . . . . . . . . . . . . . . Install ODBC Driver . . . . . . . . . . . . Modify Component Size. . . . . . . . . . Open/Close Install.log. . . . . . . . . . . Parse String. . . . . . . . . . . . . . . . . . Pause . . . . . . . . . . . . . . . . . . . . . . Play Multimedia File . . . . . . . . . . . . Post to HTTP Server . . . . . . . . . . . . Prompt for Filename . . . . . . . . . . . . Prompt for Text . . . . . . . . . . . . . . . Radio Button Dialog . . . . . . . . . . . . Read INI Value. . . . . . . . . . . . . . . . Read/Update Text File. . . . . . . . . . . Read/Write Binary File . . . . . . . . . . Reboot System . . . . . . . . . . . . . . . Register Font . . . . . . . . . . . . . . . . . Remark . . . . . . . . . . . . . . . . . . . . . Rename File/Directory . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . 96 . . 97 . . 97 . . 98 . 100 . 100 . 101 . 102 . 102 . 102 . 102 . 103 . 104 . 104 . 105 . 105 . 107 . 107 . 108 . 108 . 108 . 109 . 110 . 110 . 111 . 111 . 111 . 112 . 113 . 114 . 114 . 114 . 115 . 115 . 116 . 118 . 119 . 119 . 120 . 120 . 120 . 121 . 122 . 122 . 123 . 123 . 124 . 124 . 125 . 125 . 125 . 125
5
Search for File . . . . . . . . . . . . Select Components. . . . . . . . . Self-Register OCXs/DLLs . . . . . Set Control Attributes . . . . . . . Set Control Text . . . . . . . . . . . Set Current Control . . . . . . . . Set File Attributes. . . . . . . . . . Set Files/Buffers. . . . . . . . . . . Set Variable. . . . . . . . . . . . . . Set Windows Installer Property Start/Stop Service . . . . . . . . . While Statement . . . . . . . . . . Win32 System Directory . . . . . Wizard Loop . . . . . . . . . . . . .
6
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. 126 . 126 . 127 . 127 . 128 . 128 . 128 . 129 . 129 . 130 . 130 . 131 . 131 . 131
Creating Custom Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 About the Custom Dialog Editor. . . . . . . . . . . . . . . . . . . . Adding a Dialog to the Installation . . . . . . . . . . . . . . . Editing Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing Dialog Templates . . . . . . . . . . . . . . . . . . . . . . Setting Dialog Properties . . . . . . . . . . . . . . . . . . . . . . Using the Right-Click Menu in the Dialog Editor . . . . . . About Dialog Controls . . . . . . . . . . . . . . . . . . . . . . . . . . Adding and Editing Dialog Controls . . . . . . . . . . . . . . . Aligning and Spacing Dialog Controls . . . . . . . . . . . . . Setting Tab Order of Dialog Controls. . . . . . . . . . . . . . Solutions for Dialog Problems . . . . . . . . . . . . . . . . . . . . . Changing the Default Graphic on Wizard Dialogs . . . . . Disabling the Appending of the Program Files Directory Disabling the Directory Already Exists Message . . . . . . Keeping Disabled Controls From Reactivating . . . . . . . Dialogs and End User Input . . . . . . . . . . . . . . . . . . . . About Custom Dialog Sets . . . . . . . . . . . . . . . . . . . . . . . Creating a Dialog Set . . . . . . . . . . . . . . . . . . . . . . . . Configuring Dialog Set Properties . . . . . . . . . . . . . . . . About the Dialog Script Editor . . . . . . . . . . . . . . . . . . . . . Creating a Custom Dialog Script. . . . . . . . . . . . . . . . . Dialog Script Actions. . . . . . . . . . . . . . . . . . . . . . . . . Dialog Script Examples . . . . . . . . . . . . . . . . . . . . . . .
7
. . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. 135 . 135 . 136 . 136 . 137 . 137 . 138 . 138 . 152 . 153 . 155 . 155 . 155 . 156 . 156 . 156 . 157 . 157 . 157 . 159 . 159 . 159 . 161
Creating Custom Billboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Accessing the Custom Billboard Editor . . . . . . . . . . About the Custom Billboard Editor . . . . . . . . . . . . . Opening and Saving Custom Billboards . . . . . . . . . Adding Objects to a Billboard . . . . . . . . . . . . . . . . Editing Billboard Text Objects . . . . . . . . . . . . . Editing Billboard Line Objects. . . . . . . . . . . . . . Editing Billboard Rectangles and Ellipses . . . . . . Editing Billboard Polygon Objects . . . . . . . . . . . Editing Billboard Bitmap Objects . . . . . . . . . . . Resizing, Moving, and Aligning Billboard Objects
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. 163 . 164 . 165 . 166 . 166 . 167 . 167 . 168 . 168 . 169
6
Setting Billboard Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
8
Advanced Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Automating the Build Process . . . . . . . . . . . . . . . . . . . . . . AutoPlay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . About Sample Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Sample Scripts . . . . . . . . . . . . . . . . . . . . . . . . . Sample Scripts That Perform Tasks . . . . . . . . . . . . . . . Sample Script That Searches for Files or Applications . . . Sample Scripts That Restart the Destination Computer . . Sample Scripts That Use Expression Operators . . . . . . . Sample Scripts That Use Complex Dialogs . . . . . . . . . . . Sample Scripts That Perform Web and FTP Transactions . Sample Scripts That Call .DLLs. . . . . . . . . . . . . . . . . . . Sample Scripts That Check System Configuration. . . . . .
9
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. 173 . 174 . 175 . 175 . 177 . 178 . 178 . 178 . 179 . 183 . 184 . 184
Troubleshooting Installations . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Using the Installation Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 File Replacement Problems in System32. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
10 Quick Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 Standard Variables. . . . . . . . . . . . . . . . . Automatic Compiler Variables . . . . . . Automatic Runtime Variables . . . . . . . Runtime Variables . . . . . . . . . . . . . . Expression Operators . . . . . . . . . . . . . . . Windows Language Codes. . . . . . . . . . . . Command Line Options . . . . . . . . . . . . . WiseScript Editor (Wise32.EXE) . . . . . WiseScript Installations (Setup.EXE). . Uninstall (Unwise.EXE, Unwise32.EXE)
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. 190 . 190 . 190 . 192 . 195 . 197 . 199 . 199 . 199 . 200
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
7
Chapter 1
Welcome WiseScript Editor is an application development system for creating and editing installation packages based on the Wise Solutions scripting language (WiseScript™). Use WiseScript Editor to edit and refine installations that you've imported from WinINSTALL installations, or that you've recreated with SetupCapture or ApplicationWatch. With WiseScript Editor’s Installation Expert, you can point-and-click your way to an installation script quickly, without any programming knowledge or skill. In Installation Expert, you specify common installation tasks by filling out dialogs, not by writing code. The installation options that you define generate a script that is run when an end user installs your product. For advanced customization, you can edit the generated installation script in the Wise scripting environment, called Setup Editor. The Wise scripting language, WiseScript, is powerful, yet easy to learn. You create and edit lines in the script by setting options in dialogs, which decreases the chances of syntax or other errors. You can call .DLLs and .EXEs during installation, edit the registry, update .INI files, configure ODBC drivers and data sources, and more. Changes you make in Installation Expert are automatically reflected in Setup Editor, and vice versa. WiseScript Editor is available as a tool in Wise Package Studio®. For more information about Wise Package Studio, see Wise Package Studio Basics in the Wise Package Studio Help. Topics in this section cover: !
Documentation Roadmap.
!
Getting Help and Product Support.
!
How to Check Online Help.
8
Documentation Roadmap
Documentation Roadmap The WiseScript Editor 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 WiseScript Editor.
Online Help The online help contains detailed technical information and step-by-step instructions for performing common tasks. For details on using help, see Check Online Help on page 10.
Reference Manual All the material in the online help is also available in a .PDF-format reference manual, which you can access by selecting Help menu > Reference Manual.
Getting Started Guide The printed Wise Package Studio Getting Started Guide contains system requirements, installation instructions, and a tutorial. You can access a .PDF copy of the Getting Started Guide from Wise Package Studio by selecting Help menu > Getting Started.
Release Notes A release notes document, in .HTM format, covers new features, enhancements, bug fixes, and known issues for the current version of this product. It also contains links to release notes for other versions. Access the release notes in the following ways: !
Browse the product CD.
!
In Wise Package Studio, select Help menu > Release Notes.
!
If you are a registered user, visit http://support.wise.com to enter the Support Center, and then click the Downloads link.
9
Getting Help and Product Support
Getting Help and Product Support Wise Solutions offers many resources to help you use our products. You can search the product help or reference manual .PDF for answers, or you can use one of the many support resources available to you as a registered Wise Solutions customer.
Check Online Help You can access help in the following ways: !
To display context-sensitive help for the active page or dialog, press F1.
!
To select a help topic from a table of contents, index, or search, select Help menu > Help Topics.
If you need help and cannot find the answer in the documentation, read about our technical support options below.
Use the Wise Solutions Technical Support Center Registered Wise Solutions customers can use the Technical Support Center, located at www.wise.com/support.asp, to submit online support requests, register products, manage customer information, download updates, or search the Knowledgebase. The Knowledgebase contains how-to procedures, answers to common support questions, and workarounds.
Visit Our Newsgroups Visit Wise Solutions Newsgroups at www.altiris.com/support/forum/default.asp. Newsgroup postings by your peers contain answers, tips, analysis, and other comments. Contribute your own expertise to help others.
Subscribe to TechInfo TechInfo is a free e-mail newsletter that contains technical tips, product updates, and other important technical information. To subscribe or to read back issues, visit www.wise.com/techinfo.asp.
Ask Our Support Team If you can’t find an answer in our online resources, you can obtain support by phone or online at www.wise.com/support.asp. Wise Solutions offers flexible payment options to meet your support needs. For additional details about our support services, visit www.wise.com/supportoptions.asp or call 1-734-456-2600. Before you contact technical support, obtain the following: !
Serial number and product version, which you can find by selecting Help menu > About.
!
Operating system version and service pack version if applicable.
!
A description of what you do before the problem occurs.
!
The text of any error messages that appear.
!
Your name, company name, and how to contact you.
!
Contract number or payment information, if applicable.
Take Advantage of our Consulting and Training Services When you have a challenging repackaging or installation problem, turn to Wise Solutions. Our consultants can help with script writing, repackaging, installation
10
Getting Help and Product Support
development, and other solutions that are fully customizable to fit your project and budget. Visit www.wise.com/consulting.asp for details. To upgrade your installation and packaging skills, consider Wise Solutions training. Our certified instructors draw from practical experience to provide relevant course content. Visit www.wise.com/training.asp for course descriptions and schedules.
Contact Wise Solutions Sales Contact Wise Solutions’ Sales department to purchase additional products, upgrades, support services, or consulting and training services. U.S.: 1-800-554-8565 Europe/Netherlands: +31 70 392 72 20 Other International: 734-456-2100 (in U.S.) Web Site: www.wise.com/ordercentermain.asp
11
Chapter 2
WiseScript Editor Basics Read this overview before you create an installation. It discusses the process of creating and maintaining installations. Topics include: !
WiseScript Editor Views.
!
Creating a New Installation.
!
Installation Management.
!
Customizing Your Development Environment.
12
WiseScript Editor Views
WiseScript Editor Views WiseScript Editor has two views, Installation Expert and Setup Editor, which provide different development environments. Installation Expert lets you build an installation by pointing and clicking to fill out options. Setup Editor lets you develop more complex installations using WiseScript, an easy-to-learn scripting language. These two views are interrelated. As you build an installation using Installation Expert, a script is also created in Setup Editor. Example: When you add a new file to the installation using Installation Expert, a line appears in the script with installation instructions for that file. When the installation is run, the script installs the file.
Navigating Between Views To navigate between Installation Expert and Setup Editor, click the navigation buttons at the bottom left. You might see the following messages when navigating: !
This installation has custom script code, which is incompatible with Installation Expert. Click Yes to delete your custom code, or No to preserve it. If you click No, you have access to a limited set of pages in Installation Expert. This message appears if you create a custom script from scratch in Setup Editor, then attempt to switch to Installation Expert. Click No to preserve the custom script.
!
You are attempting to open an installation in Installation Expert, which is not compatible with some custom scripts, so the script will be opened in Setup Editor instead. This message appears if you open a custom script while in Installation Expert view. To safely view Installation Expert without converting your script, select Edit menu > Installation Properties from Setup Editor, or press Ctrl+Z. When Installation Expert opens, only the pages that do not affect the script appear.
13
Getting Started
Getting Started Following is a broad outline of possible steps for building and distributing an installation: 1.
Create a new installation. See Creating a New Installation on page 14.
2.
Set options on the Installation Expert pages to create basic installation functionality. See Using Installation Expert on page 15 and Installation Expert Pages on page 26.
3.
Edit the script in Setup Editor to create advanced installation functionality. See Setup Editor on page 62 and WiseScript Actions on page 83.
4.
Create or modify dialogs. See Creating Custom Dialogs on page 134.
5.
Test and debug the installation. See Compiling, Testing, and Running the Installation on page 16 and Using the Debug Commands on page 75.
6.
Explore options for outputting the installer .EXE file and prepare it for distribution. See Media on page 43 and WebDeploy on page 58.
7.
Use the Package Distribution tool in Wise Package Studio to distribute the installation into a variety of formats. To simply create a compiled .EXE, click Compile. See Package Distribution in the Wise Package Studio Help.
Creating a New Installation WiseScript Editor is a tool in Wise Package Studio that creates installations or custom .EXEs that can be run during another installation. When you create a new installation, you can start with an installation template or a blank script. With a template, the basics of an installation are configured. With a blank script, you build an installation or custom .EXE entirely in Setup Editor by using the Wise scripting language (WiseScript). 1.
2.
In Wise Package Studio, do one of the following: •
On the Projects tab, click the Run link to the right of the task or tool associated with WiseScript Editor. The installation associated with the current project might open by default. This tool might open to a different view based on command line options defined in Process Templates Setup.
•
On the Tools tab, double-click WiseScript Editor.
Select File menu > New. The New Installation File dialog appears.
3.
Select the Empty Project icon. The Empty Project icon creates an installation project file with a predefined script that has most of the elements of an installation already scripted. Project files do not store the files you add to an installation but the paths to the files. If you move files, the pathnames will break. For information on how to fix broken pathnames, see Changing Source Directories on page 18. Note The Blank Script icon creates a blank script, which you code from scratch. If you select it, you cannot see all the pages in Installation Expert. See Navigating Between Views on page 13.
4.
Click OK. The installation opens, and you can edit it on the pages in Installation Expert or by adding script actions in Setup Editor.
14
Getting Started
Opening a Microsoft SMS Installation You can open Microsoft SMS files (.IPF) and edit them just as you edit .WSE files. For information about SMS, visit www.microsoft.com and search for SMS. 1.
Select File menu > Open. The Open dialog appears.
2.
In Files of Type, Select SMS Installer Files (*.IPF).
3.
Specify the .IPF file. The installation script appears in Setup Editor. Edit and compile the file in the same manner as a .WSE file.
Using Installation Expert To display Installation Expert, click Installation Expert at the bottom of the WiseScript Editor main window. Each page of Installation Expert controls a specific aspect of the installation. On the Files page, you determine what files are included in the installation, and on the Registry page, you determine what registry keys and values are created on the destination computer. To see help for a page, press the F1 key while the page is displayed. Installation Expert pages are organized into logical groups and listed in the order in which you usually use them. However, you can fill out pages in any order and use only those you need. You can create a customized view of page groups and pages as described in Customizing Installation Expert Page Groups on page 21. Use (
) in the toolbar to navigate from page to page, or click the page name in the
list of pages. To expand or collapse a page group, click its name. To return a page to its last saved state, select Edit menu > Reset Page.
When you select different page names, this area changes to display the page’s options.
Page groups with pages.
Click to change views.
Click to compile, test, and run an installation.
15
Getting Started
Using Setup Editor As you specify settings in Installation Expert, WiseScript Editor generates a WiseScript with the steps to be performed by the installation. Setup Editor provides actions that duplicate functionality in Installation Expert, as well as additional actions that aren’t possible with Installation Expert alone. Installation Expert and Setup Editor are simply different views of the same installation, providing a different development environment. Use Setup Editor to tweak the installation you built in Installation Expert, or to build an entire installation or utility program from scratch. It is also useful for troubleshooting installations using built-in debugging tools such as breakpoints and single-stepping. A set of tabs at the bottom of the Installation Script pane let you quickly switch between include scripts.
List of available script actions. Double-click a script action to insert it in the script.
The Installation Script contains the commands to be executed when you run the installation.
The Standard tab shows all actions. Set the Custom tab to show actions you use frequently.
Include script tabs. Click tabs to switch between scripts.
Click to change views.
Click to compile, test, and run an installation.
Add script lines by double-clicking an action, and then selecting options for the action on a dialog. The script is displayed in English-like terminology to help with testing and troubleshooting. For details, see Setup Editor on page 62 and WiseScript Actions on page 83.
Compiling, Testing, and Running the Installation To test an installation use the Compile, Test, and Run buttons at the bottom of the main window. Note You can also use Setup Editor’s debugging functions to test the script. See About Debug Commands on page 75.
16
Getting Started
!
Compile Click Compile to build a single executable file that contains the installation script as well as all the files needed for the installation. This is the installer .EXE that you distribute to end users. If any files are absent or not readable, error messages appear when compiling. The installation is saved each time you compile unless you mark the Prompt to Save checkbox in Preferences; see Setting Preferences on page 23.
!
Test Click Test to compile and run the installation in test mode. In test mode, the installation performs all script actions without actually installing or modifying files. However, if any script lines are dependent on files being installed by 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 attempts to launch ReadMe, the second script line fails because the ReadMe is not in the Temp directory.
!
Run Click Run to execute the installation. The entire installation is executed just as it would be on the destination computer.
17
Installation Management
Installation Management There are several management tools to help maintain installations: !
To globally change source file directories, see Changing Source Directories on page 18.
!
To change the format of pathnames, see Converting to UNC-Based Source File Paths on page 18 and Converting to Relative Source File Paths on page 19.
!
To use self-repair, which enables an application to repair itself, see Using Self-Repair on page 19.
Changing Source Directories While creating an installation, you might change the directory structure on your computer, which can cause the paths to files on the Files page to become invalid. This can happen if you move: !
Files that are part of the installation to a new directory on your computer or network.
!
The installation file (.WSE) from your computer to another computer.
!
The installation file (.WSE) and use relative pathnames.
If the paths are invalid, you see messages when compiling that files could not be opened. Rather than re-adding the files from their new location, you can simply specify new source directories for the files to reflect their new locations. 1.
Select Edit menu > Source Directories. The Change Source Directories dialog appears with a list of all the directories referenced in the installation.
2.
Select a directory in the list. It appears in the New Pathname field.
3.
Edit the path so it points to the new location of the files. As you edit, the new path appears to the right of the original path in the list box. If you have moved the entire directory tree containing the installation files, you might only need to edit the root directory to change all the references.
4.
Mark Change Sub-Directories to update the paths of all the files in the subdirectories of the directories you’re changing.
5.
When you are done editing directories, click OK.
All parts of the installation that reference these directories are updated.
Converting to UNC-Based Source File Paths You can convert the paths of source files to UNC-based (Uniform Naming Convention) paths. If you keep all the installation source files on a central file server, this feature helps by converting mapped drive paths to standard UNC-based paths. Example: If you add files to an installation from your Y:\ drive, which is mapped to a file server, the paths in Setup Editor appear starting with Y:\. If a co-worker opens and compiles your script on another computer that doesn’t have its Y:\ drive mapped to the same file server, the compilation fails because the script cannot find the source files on the Y:\ drive. However, if you first convert all network paths to UNC-based paths, coworkers on the same network can open and compile your script without encountering errors. 1.
Select Edit menu > Source Directories.
18
Installation Management
The Change Source Directories dialog appears with a list of all the directories referenced in the installation. 2.
From Type, select Change source paths to UNC paths, and click OK. A warning appears because this action cannot be undone.
3.
Click Yes.
Converting paths to UNC-based paths does a one-time conversion of all the network paths in the script. Paths to files that are located on local drives are not converted. If Type is set to Change source paths to UNC paths, all network files you add subsequently are converted to UNC-based paths. If you change Type back to Do not modify source paths, the converted pathnames stay converted, but new files you add do not have UNC-based paths.
Converting to Relative Source File Paths You can convert the paths of source files to relative paths. You might do this to keep the source files in a central version and source control system, such as Microsoft Visual SourceSafe. In Microsoft Visual SourceSafe, if you copy the installation files to a different directory each time you perform a Get, you can use this feature to ensure that the paths stay valid, though the directory structure changes. A relative pathname uses .\ to indicate the current directory, and it uses ..\ to indicate one directory up. All paths are relative to where the installation (.WSE) file is located. 1.
Select Edit menu > Source Directories. The Change Source Directories dialog appears with a list of all the directories you have referenced in the installation.
2.
From Type, select Change source paths to relative paths, and click OK. A warning appears because this action cannot be undone.
3.
Click Yes.
Converting paths to relative paths does a one-time conversion of all the relative paths in the script. Paths to files that are not on the same drive as the installation file are not converted, because if they are on another drive, they cannot be written as relative paths. If Type is set to Change source paths to relative paths, all files you add subsequently are converted to relative paths. If you change Type back to Do not modify source paths, the converted pathnames stay converted, but new files you add do not have relative paths.
Using Self-Repair You can enable an application to repair itself. There are two ways to implement repair. One is passive, and is included in every installation you create. The other is proactive, and requires you to define files and registry entries that are crucial to the application. When these files or registry entries are absent and the application is launched via its shortcut, a self-repair process is initiated. Both self-repair and uninstall can only be run under the same user account under which the application was originally installed. During self-repair, the installation re-edits the registry, re-edits or recreates .INI files, reinstalls all files, and re-self-registers files. Self-repair works only if the destination computer is running a Win32 operating system.
Application Repair Initiated by the End User Every installation you create contains a repair option available to the end user. It is part of the uninstall wizard.
19
Installation Management
To run this repair option, the end user chooses the application in the Add/Remove Programs Control Panel and chooses the Repair option. If files need to be reinstalled, the end user is prompted for the media or network location of the original installation.
Configuring an Application for Automatic Self-Repair You can configure any installation you create for automatic self-repair. The advantage of automatic self-repair is that it does not depend on the end user to initiate it. Whenever the end user launches the application via its shortcut, files and registry entries that you specify are checked. If they are missing, the end user is prompted to repair the application. If files need to be reinstalled, the end user is prompted for the media or network location of the original installation. To configure you application for self-repair, follow these general steps: 1.
Determine the files and registry entries that are crucial for the application to run properly. During the application’s launch, these files and registry keys are checked, so limit the number of items to check to prevent the launch time from increasing.
2.
3.
On the details dialogs for each of these files and registry entries, mark the checkbox that flags them for self-repair. •
For a file, double-click the file on the Files page or double-click the Install File(s) script line that references the file. On the Install File Settings dialog, mark Repair application if this file is missing.
•
For a registry entry, double-click the value in the lower right list box on the Registry page and mark Repair application if this registry value is missing on the dialog that appears. In Setup Editor, multiple registry values are contained in one Edit registry keys script line. Double-click the Edit registry keys script line, navigate to the required registry value and select it, then mark Repair application if this registry value is missing.
Create a shortcut that runs the application, either on the Shortcuts page in Installation Expert or with the Create Shortcut script action in Setup Editor. While filling out the Shortcut Details dialog, mark Check self-repair items when this shortcut is opened. See Shortcuts on page 51 or Create Shortcut on page 101.
When the application is installed, the list of required items is put into a special registry key. When the end user launches the shortcut that runs the application, the shortcut actually runs unwise.exe (the uninstall program) with special command line options. Unwise.exe checks that the required items are present. If they are, unwise.exe opens the application. The end user sees none of this, and if the number of required items is few, the extra time to launch is negligible. If the required items are not present, unwise.exe displays a message that the application is damaged, and asks whether to repair it, run it anyway, or stop checking it on launch.
20
Customizing Your Development Environment
Customizing Your Development Environment You can customize your development environment to fit the way you work: !
Create your own installation templates so that each time you create a new installation, options you set frequently are already pre-configured. See Creating and Editing Installation Templates on page 21.
!
Change the page groups by either selecting a pre-defined view of page groups or creating your own view.
!
Change prompts and error messages displayed by the installation.
!
Set preferences for Setup Editor and the compiler.
!
Set the actions list in Setup Editor to display only those actions you use most frequently and add your own actions to the list. See Creating a User-Defined Action on page 70.
!
Change the dialogs that display during installation by editing default dialogs. See Editing Dialog Templates on page 136.
Creating and Editing Installation Templates When you create a new installation, it gets its configuration from a template file. Predefined templates contain logical defaults and commonly used settings. You can also create your own templates. Example: If all your installations have the same system configuration requirements and document file extensions, you can create a template with all these changes preconfigured. 1.
Select File menu > New. The New Installation File dialog appears.
2.
Select Empty Project and click OK.
3.
Make all the changes that should appear in installations created with this template.
4.
Select File menu > Save As and name and save the installation (.WSE) file in the Template directory.
The template directory is in the WiseScript Editor application directory. Caution Predefined templates are read-only. Editing them is not recommended, because they might be overwritten during upgrades. Instead, save customized templates with new names.
5.
To test your new template, select File menu > New. The New Installation File dialog appears and includes the template you just created.
6.
Select the template and click OK.
7.
Verify that the changes you made in the installation template are present in this new installation file. Example: If you changed the screen color, go to the Screen page and verify that the screen preview displays the new color screen instead of the default blue screen.
Customizing Installation Expert Page Groups By default, Installation Expert displays all page groups and all pages within each group. From the Pages menu, you can select one of the following page groups:
21
Customizing Your Development Environment
!
All Displays all page groups and all pages associated with each group.
!
Properties Displays only the pages that do not add or change script lines in the script. This page group also appears when you select Setup Editor > Edit menu > Installation Properties.
You can add your own sets of page groups to the Pages menu. This lets you customize your work environment so you only see the pages you frequently use. You can edit any set of page groups you create, but not the predefined sets. You also cannot edit page names.
Buttons for editing pages. They are disabled for the predefined sets of page groups.
Defined page groups. Customized page groups appear here.
Pages in the selected page group.
Buttons for editing page groups. They are disabled for the predefined sets of page groups.
1.
Select Pages menu > Customize. The Customize Pages dialog appears.
2.
From Name, select
.
3.
On the dialog that appears, specify a name for your new set of page groups. Include an & before a letter to set it as a keyboard shortcut.
4.
To add a new page group, click the Add button on the left and specify a name for the page group.
The name appears in the Name drop-down list.
The name appears in the Page Groups list. 5.
To add a page to a page group, select the page group, and click the Add button on the right. The Select Pages to Add dialog appears.
6.
Select the page or pages and click OK.
7.
Add more page groups and pages as appropriate.
8.
Click OK. Your new set of page groups appears under the Pages menu.
22
Customizing Your Development Environment
Changing Installer Messages You can edit prompts and error messages displayed by an installation. Editing the installation messages modifies the wise.ini file, which is located in the system directory. To back up the text strings, back up the wise.ini file before editing installer messages. To change wording in a non-English dialog, choose the language from the Language drop-down list under the toolbar in Setup Editor, and then double-click a Custom Dialog statement. The Language directory, located in the WiseScript Editor application directory, contains text for the uninstaller dialogs. 1.
To edit the installation messages, select Edit menu > Installer Messages. The Installer Messages dialog appears.
2.
Complete the dialog: • Language Name The name of the language as it appears in WiseScript Editor. • Translated Name The name of the language as it will appear in installations you create. • Language Code A three-letter code that matches the Windows-defined language to WiseScript Editor. See Windows Language Codes on page 197. • Messages Select the message to edit. • Message Text Enter or edit the message here. • Select Language Dialog When end users run an installation that supports multiple languages, the first dialog that appears is a Select Language dialog, where they choose the language they want. "
Dialog Title The title of the Select Language dialog.
"
Dialog Text The text that appears on the Select Language dialog. If the installer supports multiple languages, enter instructions in all supported languages here.
Setting Preferences In Preferences, customize options for script development and compiling. Also specify .DLLs to ignore for ApplicationWatch and the Import Visual Basic Project tool. 1.
To access Preferences, select Edit menu > Preferences.
2.
Complete the dialog: • Prompt to Save Mark this to have Setup Editor prompt you to save the installation script each time you build a new installer .EXE. If you do not mark this checkbox, the script is always saved before compiling. • Prompt for Changed Compiler Variables Mark this to receive a warning if the compiler variables _WISE_ or _ODBC32_ have changed from the last time the installation script was opened. Example: If you develop an installation script where the WiseScript Editor application directory is C:\Wise, the compiler variable _WISE_ is set to C:\Wise. If you then open the same script on a different computer, where the application
23
Customizing Your Development Environment
directory is C:\Program Files\Wise, then you are prompted to redefine the compiler variable _WISE_ to the new WiseScript Editor application location. Compiler variables are set on the Compiler Variables page. • Add Associated Icons and Registry Keys If you mark this, when you add a file on the Files page in Installation Expert, icons and registry keys that are associated with that file are added also. • Append New Script Lines If you mark this, when you add a new script action in Setup Editor, it is inserted after the currently selected script line, rather than before. • Listbox Compatible Mode If your computer has certain video drivers, you might have problems selecting items from list boxes within WiseScript Editor. If items you choose from list boxes are continually misinterpreted, mark this checkbox to eliminate list box problems. • Create Backup Copy During Save Mark this to create a new backup file every time you save. The names of the backups are the current file name plus a number. (Example: If the current file name is Application.wse, the backups are Application1.wse, Application2.wse, and so on.) Use caution with this checkbox because a new file is created every time you save. This option can also be set from Wise Package Studio Preferences; use this checkbox to override the Package Studio setting. • Show Tabs for Wise Include Scripts Mark this to show tabs for Wise Solutions’ include scripts in Setup Editor. • Color Selection Select the colors for the types of script actions recognized by Setup Editor. Select the type of script action, then click Set Color to select the color. • Suppress Version Error Mark this to suppress errors that normally occur when version checking is performed on files that do not have version resources. • Background Processing Mark this to allow other applications to run when compiling. This slows compiling by about 50%. If cleared, user input is ignored when compiling. • Smart Create Mark this to rebuild the installer .EXE whenever any file in the installation changes. If this is marked, the time you wait after clicking the Run button increases slightly because the compiler checks the modified dates and sizes of all files in the installation to determine if they have changed. Mark this checkbox only when testing and clear it for the final build. • Fast Create Mark this to speed up compiling by copying the compressed version of a file from the previous version of the installer .EXE to the new one. If the size or date of a file has changed, it is re-compressed. Mark this checkbox only when testing and clear it for the final build. • Run in Manual Mode Mark this to have the installer .EXE prompt for the locations of all directories to be used for installations (Windows, System, and so on) whenever the installer is run from within WiseScript Editor. • Shared Directory Normally, user-defined actions are stored in WiseScript Editor’s Actions directory. Use this field to specify an additional directory to hold user-defined actions. This can be a local or shared network directory. The actions stored in this directory
24
Customizing Your Development Environment
appear in the Actions list in Setup Editor in addition to the ones in the Actions sub-directory. • System .DLLs to Exclude Enter the names of .DLL and .OCX files that should not be included when you create a .WSE file with ApplicationWatch or Import VB Project from Wise Package Studio. Enter one file name on each line with no other delimiter. Example: If you are watching a Visual Basic application, you could ignore VBRUN300.DLL because that file is accessed by Visual Basic applications, but is not necessarily installed with the Visual Basic application.
25
Chapter 3
Installation Expert Pages In Installation Expert, the pages are organized into logical groups and listed in the order in which you usually use them. For quick reference, the pages here are arranged alphabetically. See Using Installation Expert on page 15.
Active Directory Use the Active Directory page to create a .ZAP file. You need a .ZAP file to distribute .EXEs through Microsoft Active Directory. The .ZAP file is created in the same directory as the installation .EXE. Microsoft Active Directory uses the information in the .ZAP file to distribute the .EXE. Note Complete the Product Details and Add/Remove pages before completing the Active Directory page. Three of the fields on the Active Directory page obtain their values from fields on those pages. !
Do Not Create Zap File During Compile Mark this to create an installation without a .ZAP file.
!
Create Zap File During Compile Mark this to add a .ZAP file to the installation and enable the following fields: • Friendly Name This field obtains its value from the Installation Title field on the Product Details page. • Command Line (Optional.) Enter a command line to apply to the installation .EXE. For information on command line options, see WiseScript Installations (Setup.EXE) on page 199. • Display Version (Optional.) This field obtains its value from the Software Version field on the Add/Remove programs page. • Publisher (Optional.) This field obtains its value from the Publisher field on the Add/ Remove Programs page.
To distribute the .ZAP file with the installation using Package Distribution in Workbench, select Network and Installation (.exe) on the Distribution Method dialog. If you distribute the installation to the share point directory and import it into Software Manager, the installation and the .ZAP file are copied to the share point Available Packages directory when you change its status to Available.
26
Add/Remove Programs Windows 2000 and Windows XP have an Add/Remove programs window that supports a rich display of application information. Use the Add/Remove Programs page to enter the information necessary to support these capabilities. Note The Add/Remove Programs page applies only when the application is installed on the Windows 2000 or XP platform. !
Display Icon Select an icon to appear next to the application name in the Add/Remove Programs window. Click Browse to select a file from the installation.
!
Icon Number Enter the resource index for the icon in the selected .EXE or .DLL file. Note An executable or icon file can contain multiple icons. To see the icons in a file, go to Windows Explorer, right-click any shortcut file, and select Properties. Click the Shortcut tab, then click Change Icon. The Change Icon dialog appears. It contains a graphical list of icons for the file. The icon number of the first icon is 0, the icon number for the second is 1, and so on.
!
Hide Change/Remove button Mark this to disable the Change and Remove buttons in the Add/Remove Programs control panel. If these buttons are disabled, the end user cannot remove this program using the control panel.
!
Publisher Enter the name of the company that publishes the application.
!
Contact Person Enter the name of a person or department that end users can contact if they have questions. Examples: a support technician or the support department.
!
Phone Number Enter the phone number of the contact person specified above.
!
Online Support URL Enter a URL where end users can get online support for the application.
!
Software Version Enter the version number of the application.
!
Help URL Enter the path to a help file that will be installed on the destination computer.
!
Comments Enter any additional comments for the end users.
Autoexec.bat Use the Autoexec.bat page to specify command lines to add to the destination computer’s AUTOEXEC.BAT file during installation. If the AUTOEXEC.BAT file changes, the end user is prompted to restart the computer to initiate the changes. !
Directory to add to PATH Enter the pathname of the directory to be added. To build the directory path, use one of the built-in WiseScript Editor runtime variables. Example: %MAINDIR% for the
27
Application directory or %SYS% for the Windows System directory. See Compiler Variables vs. Runtime Variables on page 80. !
Location of new directory Specify whether the installation should place the new directory at the beginning or at the end of the PATH variable.
!
Path selection Specify whether the installation should edit just the first PATH statement in the AUTOEXEC.BAT file or all path statements.
!
Commands to add to AUTOEXEC.BAT This section lists commands to be added to the AUTOEXEC.BAT file.
To add a command line to the AUTOEXEC.BAT file, click Add and enter the command line on the dialog. To specify how to add the command line to the AUTOEXEC.BAT file, select it and click Details. See Specifying How to Add Commands AUTOEXEC.BAT. To remove an existing command line, select it and click Delete.
Specifying How to Add Commands AUTOEXEC.BAT This dialog lets you specify how a command line is added to the AUTOEXEC.BAT file: at a specific line number or by searching for specific text. 1. 2.
Select Installation Expert > Autoexec.bat page. Double-click a command line. The Add Command to AUTOEXEC.BAT dialog appears.
3.
Complete the dialog: • Text to Insert Enter the line to add to Autoexec.bat. If the line refers to an application file, use a pathname (example: %MAINDIR%\Application\Application.exe). The PATH variable might not be set when the command is executed, so always use a pathname. • Line Number Enter the line number at which the new line should be inserted. Enter 0 (zero) to append the command to the end of the file. The Search for Existing Text area in this dialog 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. • Search 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. • Comment Text Enter text to insert at the beginning of the line that is found. Insert “REM ” (with the trailing space but without the quotation marks) to comment out the line, which lets you replace an existing command with a new 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. • Insert Action Select where to insert the new line in relation to the found line. • Match Criteria Select how the found line matches the Search for Text. • Ignore White Space Mark this to ignore spaces and tab characters.
28
• Case Sensitive Mark this to match case. • Make Backup File Mark this to make a copy of Autoexec.bat before editing it. 4.
Click OK.
Build Settings Use the Build Settings page to specify options for compiling the installation. !
Maximum Compression Mark this to make the installation file as small as possible before compiling an installation for distribution. Since it takes longer to compile an installation when maximum compression is enabled, disable it during development.
!
Use Internal 3D Effects This causes the installation to display 3D-style dialogs and controls, even if the destination computer does not have the CTL3D.DLL file. This option is applicable only when installing to a 16-bit Operating System. If you select TrueWin32 from Destination Platforms, this option is disabled.
!
No Reboot Message During Silent Installs Normally, when an installation is run in silent mode, it displays a message that the system must be restarted after installation. Mark this to not display the warning message and to reboot the system without warning. You can run an installation in silent mode by running it from the command line and adding a /s option.
!
Create Windows Me System Restore Snapshots Mark this to have the installation add system snapshot entries to the Windows Millennium (Me) System Restore utility. This lets end users restore their system to the state it was in before the application’s installation. The installation takes longer to perform when this is marked. This works only if you enable it in the Windows Millennium operating system.
!
Replace In-Use Files Mark this to have the installation force the replacement of in-use files by performing a reboot of the system. Otherwise, the end user is notified that the installation cannot be completed and the installation aborts.
!
Convert CD-ROM to Floppy When creating a CD-ROM-based installation, you can use the Copy Local Files script action to copy files from the CD-ROM to the end user’s hard disk, rather than embedding these files in the installer .EXE. Mark this to have these files included in the installer .EXE so the installation can be placed on floppy disk(s). (You can exclude individual Copy Local Files script actions from conversion by marking their Don’t Convert To Floppy checkbox. See Copy Local File(s) on page 98.)
!
Beep on New Disk Prompt Mark this to cause the compiled installation to beep when requesting a new disk.
!
ZIP Compatible Mark this to make the compiled installation compatible with the ZIP archive format. If you make the installation ZIP compatible, end users can extract files from it using any unzip utility, such as WinZip. They must open the installation by selecting File menu > Open in the ZIP utility. Double-clicking the installation launches it normally.
!
Network Installation Mark this if you are creating a network installation and want to reduce network traffic. If this is marked, a CRC (Cyclic Redundancy Check) is performed on existing files. If the file exists and is identical to the new installation file, the file is not copied
29
down, reducing traffic. However, because CRC checks are time-intensive, this can slow down the installation, so limit this option to installations that are performed without end user intervention. !
Destination Platforms Select the operating system for running the installation. • Windows 3.1x, 95, and NT (Win16/Win32) The installation can run under both Win16 and Win32 but is slower. • Windows 95 and NT (True Win32) The installation can run only under Win32 but is faster.
For the Pathname fields, click Browse to simplify path and file selection. !
Installation .EXE Name Specify a name and location for storing the executable file after it is compiled. If left blank, the name of the installation executable defaults to the name of the installation file (*.WSE).
!
Language .INI Name To use a language that is not built into WiseScript Editor, specify the path to an .INI file that contains translation resources.
!
Setup Icon Pathname Specify the path to the icon to be used for the installation .EXE file.
!
Dialogs Directory If you created a directory containing customized versions of dialogs and dialog templates, specify the path to that directory.
!
Temp. Files Directory Specify the path to a directory where WiseScript Editor can store temporary files while building the installation. If this directory is not specified, the Windows temporary directory is used.
Compiler Variables Use the Compiler Variables page to set compiler variables that change the compiled setup program. There are many uses for compiler variables. You could use a compiler variable to determine which files are included in the compiled .EXE file or to create either a Win16 or a Win32 version of the application. You could also use them to build a debug version of the installation, see Building a Debug Version on page 76. To see a sample script that uses compiler variables, open the file COMPVAR.WSE from the Samples directory in the WiseScript Editor application directory. See Creating an Installer That Can Be Customized During Compile on page 177. When you reference a compiler variable name in the script, you must surround the name with percent signs. (Example: %_DEBUG_%.) For information about variables, see Variables and Expressions on page 79. For automated build processes, you can specify compiler variable values from the command line, by entering the value directly on the command line or by storing the values in a text file. For information on using command lines, see WiseScript Editor (Wise32.EXE) on page 199. To add a compiler variable, click Add and complete the Compiler Variable Settings dialog. This dialog also appears if you double-click a variable to edit it. See Setting Compiler Variable Settings. To remove a variable, select it from the list and click Delete. There are 2 options for being prompted for compiler variables: !
Compiling from Command Line Mark this to be prompted for the value of compiler variables when you compile an installation from the command line.
30
!
Compiling from Within Wise Mark this to be prompted for the value of compiler variables when you compile an installation from WiseScript Editor. If you mark this, then a Select Compile Settings dialog appears at compile time that lists this compiler variable’s values. A dialog appears for each compiler variable you define. Value length is limited by the amount of text that displays on the dialog. The Do not prompt for value checkbox on the Compiler Variable Settings dialog overrides this setting.
Setting Compiler Variable Settings 1.
Select Installation Expert > Compiler Variables page.
2.
Click Add. The Compiler Variable Settings dialog appears. Use it to set compiler variable properties.
3.
Complete the dialog: • Variable Name Enter the name of the compiler variable. By convention, compiler variables begin and end with an underscore (_) character. Although Installation Expert does not enforce this convention, it is useful when reading scripts to be able to distinguish between compiler variables and regular script variables. • Default Value Enter the default value of the compiler variable. • Description Enter a brief description of how the variable is used. This information appears on the dialog when you are asked to choose a new value for the variable. • Value List For compiler variables that are displayed as a list, enter a list of allowable values, each on a separate line. Also see Building a Debug Version on page 76. • Data Entry Type Choose the method to be used to enter data for the compiler variable. Options include either a simple edit field in which the end user can enter text, an edit field with a Browse button for specifying directories, or a list of values that allows either single or multiple selections. • Do Not Prompt for Value If this is marked, you are not prompted for the value of this variable when compiling an installation even if Prompt for Compiler Variables is marked on the Compiler Variables page. Mark this for variables you do not expect to change frequently.
4.
Click OK.
Components Use the Components page to add components to the installation. Components let you add optional pieces, such as a spell checker, a tutorial, sample files, and other add-ons. When the installation is run, end users can choose which components they want to include. For information on building a component-based installation, see Letting the End User Select Components and Subcomponents on page 182. The current set of components is shown on this page in the same order that the components are listed in the installation. Any component that is marked as being installed by default is enabled in the component list during installation. (The end user can still deactivate this component.)
31
Use the buttons to the right of the list to add, edit, delete, or rearrange components. The Component Details dialog appears, if you click the Details or Add button. This dialog lets you name or rename the component and specify whether it should be installed by default. To remove a component select it and click Delete. If you use components in an installation, you must assign the appropriate program files to each component on the Files page. Once created, the component is added to the Components drop-down list in Installation Expert. Selecting a particular component from this list indicates that the settings you make apply only to that component and are implemented only if that component is installed. Note When an end user selects one or more optional components to be installed, a letter corresponding to each component is placed in a variable called COMPONENTS. Selecting the first component places an “A” in the variable, the second adds a “B,” and so forth. You can add up to 26 components this way. You can edit the installation script and use conditional statements to determine which files are installed when each component is selected.
Config.sys Use the Config.sys page to specify command lines to be added to the destination computer’s CONFIG.SYS file during installation. If the CONFIG.SYS file changes, the end user is prompted to restart the computer to initiate the changes. To add a command line to the CONFIG.SYS file, click Add and enter the line on the dialog. To specify how to add the command line to the CONFIG.SYS file, select it and click Details. See Specifying How to Add Commands to CONFIG.SYS on page 32. To remove an existing line, select it and click Delete.
Specifying How to Add Commands to CONFIG.SYS You can specify how a line is added to the CONFIG.SYS file: at a specific line number or by searching for a specific piece of text. 1.
Select Installation Expert > Config.sys page.
2.
Double-click a command line. The Add Command to CONFIG.SYS dialog appears.
3.
Complete the dialog: • Text to Insert Enter the line to add to Config.sys. If the line refers to a file, use a pathname. Example: %SYS%\Application.DLL. %SYS% refers to the active system folder. • Line Number Enter the line number at which the new line should be inserted. Enter 0 (zero) to append the command to the end of the file. The Search for Existing Text area in this dialog 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. • Search 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.
32
• Comment Text Enter text to insert at the beginning of the line that is found. Insert “REM ” (with the trailing space but without the quotation marks) to comment out the line, which lets you replace an existing command with a new 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. • Insert Action Select where to insert the new line in relation to the found line. • Match Criteria Select how the found line matches the Search for Text. • Ignore White Space Mark this to have the search operation ignore spaces and tab characters. • Case Sensitive Mark this to ignore spaces and tab characters. • Make Backup File Mark this to make a copy of Config.sys before editing it. 4.
Click OK.
Devices The Devices page lets you define device drivers to be installed under Windows 3.1x and Windows 9x. The specified devices are added to the [386Enh] section of the System.ini file. The driver usually has one of the following file extensions: .386, .drv, .vxd, or .sys. The driver file must already be added to the installation on the Files page. 1. 2.
Select Installation Expert > Devices page. Click Add. The Select File from Installation dialog appears. The list on the left displays the installation’s components with their directories. The list on the right displays the device files in the selected directory.
3.
To add a device to System.ini, select it from the list on the right and click OK.
To remove a device driver from the installation, select it from the list and click Delete. If you choose a device driver that is part of an optional installation component, the System.ini entry is added only if that component is installed.
Dialogs Use the Dialogs page to choose and edit the dialogs that make up the wizard end users navigate through during installation. The dialogs you choose determine the level of control the end user has over the installation. The wizard dialogs include: !
Welcome Welcomes the end user to the installation, suggests exiting other running applications, and warns of the software copyright.
!
ReadMe Displays the ReadMe file for the application. When you select this dialog, the Pathname field is enabled in the Settings section where you specify the .TXT file for the Readme text.
!
Branding/Registration Prompts for the end user’s name, company name, and, optionally, a serial number.
33
!
Destination Directory Lets the end user choose a destination directory for the installation. The directory the end user chooses is stored in the variable %MAINDIR%.
!
Backup Replaced Files Lets the end user choose whether to back up files that are replaced during the installation and where to store the backups.
!
Select Components Lets the end user choose which optional components to install.
!
Select Icon Group Name Lets the end user choose the group name for icons installed in the Program Manager or Start menu.
!
Start Installation Gives the end user a final chance to cancel the installation before installation begins.
!
Finished This dialog informs the end user that the software was successfully installed.
Adding and Editing Dialogs To add a dialog: 1.
Select Installation Expert > Dialogs page.
2.
Click Add. The Dialog Box Properties dialog appears.
3. 4.
Name the new dialog and set its default properties. Click OK. The Custom Dialog Editor opens. For information on using the Custom Dialog Editor, see Creating Custom Dialogs on page 134.
5.
Configure the new dialog.
6.
Close Custom Dialog Editor. The new dialog is added to the Dialogs page.
To edit a dialog: 1.
Select Installation Expert > Dialogs page.
2.
Mark the dialog’s checkbox and click Edit. The Custom Dialog Editor opens. For information on using the Custom Dialog Editor, see Creating Custom Dialogs on page 134.
3.
Edit the dialog. The changes you make affect only the dialogs in this installation.
Digital Signature Use the Digital Signature page to add an Authenticode digital signature to an installation so its integrity and authenticity can be verified. You must have a valid VeriSign commercial certificate to use this feature. For information about digital signatures, visit the VeriSign Web site at www.verisign.com and search for authenticode. The digital signature protocol of Internet Explorer 4.0 is used. You have 2 options for adding a digital signature:
34
!
Add a digital signature externally Mark this to leave space in the installation for a digital signature without actually adding it to the installation. This is useful if the installation must be digitally signed under a higher security environment by a different individual. Extra space is reserved to allow for the digital signature information. If an installation does not have extra space (approximately 5K), and a digital signature is added, errors occur when CRC checks are performed because of the resulting size increase. This option eliminates those errors.
!
Add a digital signature Mark this to add a digital signature to the installation and to enable the following fields: • Web URL Enter your company’s Internet Web address. • Descriptive Name Enter the name of your application. This name is embedded in your Authenticode certificate to let end users verify the name of the software they are installing. • TimeStamp URL Select or enter the URL you use for your timestamping service. Timestamping lets end users distinguish between a certificate that’s expired but was valid when it was used to sign the installation, and a certificate that was used to sign an installation while it was expired. The timestamping service must be available to build the installation but does not need to be available to the end user running the installation. • Credentials File, Private Key File Specify your VeriSign credentials file and private key file. They must be located in the Windows directory.
File Associations Use the File Associations page to associate a file extension with an application that can open a file with that extension. Example: If your application generates documents with a unique file extension, you can associate that file extension with your application. Then, when an end user double-clicks that document file, the operating system launches the associated program and opens the file.
To add a file association: 1.
Select Installation Expert > File Associations page.
2.
Click Add. The Select File from Installation dialog opens.
3.
At the bottom of the dialog, enter the three-letter document extension of the file type.
4.
In the left list box, select the directory containing the program file to associate with this file type. The names of all .EXE files in that directory display in the right list box.
5. 6.
Select the program file to associate with this file type. Click OK. The new file association appears on the Document Types page.
To remove a file association, select it and click Delete. To edit an existing file association, select it and click Details. See Editing Association Details.
35
If you choose an .EXE file that is part of an optional installation component, the association is created only if that component is installed.
Editing Association Details 1.
Select Installation Expert > File Associations page.
2.
Double-click a file association. The Association Details dialog appears.
3.
Complete the dialog: • Document Extension Enter the three-character extension that is associated with the program. • Document Identifier, Identifier Full Name Identify the program that can open files of the type listed in the Document Extension field. • Print Options Enter the command line options to be passed to the application to cause it to print the file instead of just opening it. This adds a Print menu option to the right-click menu for files of that document type. • Source Pathname This is the path to the .EXE program associated with the specified document extension. You cannot edit this field.
4.
Click OK.
Files Use the Files page to specify the files and directories to be installed on the destination computer. When you add files, Installation Expert does not actually copy or store the files, but records the location of the files. The files are not copied until you compile and build the installation. Therefore, if you change a file’s name or location, you must update its path, otherwise you get error messages when you compile. See Changing Source Directories on page 18. When you add a program file to the Files page, Installation Expert searches the registry for related information, such as file associations and icons. This information is added to the installation and entered on the corresponding Installation Expert pages. Note If you inadvertently add multiple instances of the same file (with the same path), only one copy is compiled into the installation .EXE. Use Setup Editor > Edit menu > Duplicate Files Report, to find duplicate files.
The upper two list boxes display the directories and files available to your computer. The lower two list boxes represent the directory structure and files that will be installed on the destination computer. Use the following buttons: !
Add Contents Add entire directories. When you add an entire directory you can filter it using wildcards. See Adding Contents of Directories to the Installation on page 38.
!
Add File Add single or multiple files. See Adding Files to an Installation.
36
!
New Folder Create directories to be installed on the destination computer.
!
Delete Folder, Delete File Remove a directory or file from the installation.
!
Details Edit file settings. See Specifying Installation File Settings.
Adding Files to an Installation 1.
Select Installation Expert > Files page.
2.
If the directory where the file is to be added is not listed in the lower left list box:
3.
•
Select the directory under which the new directory should be created.
•
Click New Folder, enter a directory name, and click OK.
In the lower left list box, select the directory to which the file will be added. You must assign all files to either the Application directory, a Windows directory, or a subdirectory that you create. If the installation contains more than one component, the list box contains directories for each component. • Application directory This represents the default installation directory for the program. This is where the executables, ReadMe files, and other non-system files are typically assigned. • Windows directory System level files, such as fonts and certain .DLLs, should be assigned to the appropriate Windows directory. The main system directories are already created, and you can add new ones.
4.
In the upper left list box select the directory containing the file or files to add. All the files in the selected folder are listed in the upper right list box.
5.
From the upper right list box, select the files to add and assign them to the destination directory: •
To assign a single file to the destination directory, double-click the file.
•
To assign multiple files, select them and click Add File.
6.
To add the contents of an entire directory or to use wildcard filters to add only specified files in the directory, select the directory in the upper right list box and click Add Contents. Complete the fields on the Add Wildcards dialog and click OK. See Adding Contents of Directories to the Installation.
7.
Repeat the preceding steps to assign all application files to the proper destination directory.
You can also drag files from Windows Explorer and drop them in a folder under the Destination Computer icon. When you drop the file, the Drag and Drop Settings dialog opens so you can set file properties (this is the same as the Install File Settings dialog.) To confirm the file’s location, click OK. To review file assignments, select a destination directory in the lower left list box. All files assigned to that directory are listed in the lower right list box. To delete a file from the installation, select it in the lower right list box, and click Delete File. To set advanced installation options for a particular file, double-click it in the lower right list box. This opens the Install File Settings dialog. See Specifying Installation File Settings on page 38. If you assign files to a directory that is part of an optional installation component, those files are installed only if that component is installed.
37
Adding Contents of Directories to the Installation You can add the entire contents of a directory to an installation or use wildcard filters to add only specified files in the directory. 1.
Select Installation Expert > Files page.
2.
In the upper left list box, select the directory whose contents you want to add.
3.
In the lower left list box, select the directory where you want to add the contents.
4.
Click Add Contents. The Add Wildcards dialog appears.
5.
Complete the Add Wildcards dialog: • Dest. Directory Enter the name of the installation directory that will hold the contents of the directory you’re adding. If you don’t enter a directory name, the contents are added to the directory that’s selected in the lower left list box. • Include Wildcard, Exclude Wildcard To include or exclude files based on specific criteria, enter a semicolon-delimited list of wildcards. (Example: Enter *.EXE for all .EXE files or *.DLL for .DLL files.) If you leave the wildcard fields blank, all files in the directory are added. • Include Subdirectories Mark this to add all the subdirectories within the directory you’re adding. The wildcard settings apply to the subdirectories also. • Add as a wildcard instead of adding the files Mark this to have the lower right list box display wildcard settings (as specified in the Include Wildcard field or *.* if no wildcards are specified) instead of the actual file names. This lets you add other files to the source directory later. When the installation is compiled, all files matching the wildcard filter are copied to the destination computer. With this option, the program does not automatically create icons and file associations.
6.
Click OK. The contents of the directory in the upper left list box are added to the directory you selected in the lower left list box or to the directory you specified in the Dest. Directory field. If you specified wildcards, only files that match the wildcard criteria are added.
Specifying Installation File Settings 1.
Select Installation Expert > Files page.
2.
In the lower right list box, select a file or files and click Details. If you selected a single file, the Install File Settings dialog appears. If you selected multiple files, the Multiple File Settings dialog appears.
3.
Complete the dialog: • Source Pathname Specify the pathname of the file on your computer. • Destination Pathname Specify the pathname the file will have on the destination computer. Use variables to start the pathname (example: %MAINDIR%\Dev\file.txt). This field has a drop-down list with common variables. Do not include wildcards in this field.
38
• Description Enter text to appear in the progress bar while this file is installed. • Require Password If you entered a password in Installation Expert > 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 password-protected files are slated for installation, the prompt does not appear. • Include Sub-Directories If you specify a directory in Source Pathname, mark this to include all subdirectories and their contents. • Shared 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. • No 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. • Self-Register OCX/DLL/EXE/TLB All .OCXs and .TLBs and some .DLLs and .EXEs support self-registration. Mark this so the file registers itself in the Windows registry before it is used. • Do Not Download With WebDeploy This checkbox is available if you click Complete support for Internet-based installation on the WebDeploy page. In an Internet-based installation, files are stored as separate files in the same directory as the installation .EXE on the Web server and are downloaded only as they are needed. Mark this checkbox to put the file in the installation .EXE rather than storing it as a separate file. • Repair application if this file is missing Mark this checkbox to initiate self-repair if this file is missing during application launch. This prevents your application from failing if this file is accidently deleted. For information on setting up self-repair, see Configuring an Application for Automatic Self-Repair on page 20. • Replace Existing File Specify 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.
• File Version, File Date/Time These become enabled if Check File is selected from Replace Existing Files. "
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.
39
"
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 Date/Time, 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 Date/Time, this replaces the existing file if its modification date and time are older than the new file.
• Retain duplicates on path By default, version checking removes existing copies of .DLLs that are found in the path list. To suppress this feature, mark this checkbox. • Existing File Pathname SmartPatch creates a patch file that contains only the differences between the older installation and the new installation. If you are using Smartpatch, specify the pathname where the installation can expect to find one of the files listed in Previous File Versions. If a wildcard was used in Source Pathname, this field should contain a directory. Start the path with a variable. • Previous File Versions Use the Browse button to create a list of files that are older versions of the file or files being installed. Note Rather than specifying SmartPatch information for each file, you can use the SmartPatch page in Installation Expert to specify entire directories that contain older versions of your files. See SmartPatch on page 53.
4.
Click OK.
Fonts Use this page to add fonts to an installation. You only need to add fonts when they are required by the application being installed. Any fonts added with the Files page are listed here.
To add a new font: 1.
Select Installation Expert > Fonts page.
2.
Click Add. The Select Fonts dialog appears, which lists the fonts in the Fonts directory on your computer.
3.
From Component, select the component in which to install the fonts.
4.
In the left list box, select the directory containing the font.
5.
In the right list box, select the font.
6.
Click OK.
40
The font is added to the selected component. To remove an existing font, select it on the Fonts page and click Delete.
General Information Use the General Information page to specify information about the installation file. The information on this page sets the version resource of the compiled setup file (.EXE). The end user sees this information by right-clicking the setup file and selecting Properties. If you plan to use an automated build system and want to set these values at compile time, create compiler variables to set these values, and enter the compiler variable name, surrounded by percent signs, in these fields. Example: If you create a compiler variable named _INST_VERSION_ to set the version, enter %_INST_VERSION_% in the Installation Version field. See Compiler Variables on page 30. Enter information about your application in the following fields: !
Installation Version The version number of the installation.
!
Description A description of the installation, perhaps including your application’s name.
!
Copyright The copyright notice for the installation.
!
Company Name The name of your company.
INI Files The INI Files page lets you create a new .INI file to store your program’s settings, or update an .INI file on the destination computer during installation. 1.
Select Installation Expert > INI Files page.
2.
Select the destination directory from the left list.
3.
Click New File to open the Edit INI File Settings dialog.
4.
From File, select a default path where the .INI file is stored. Example: %SYS32%\NONAME.INI.
5.
Overwrite the default NONAME.INI with the appropriate name. Example: System.ini.
6.
In INI File Contents, enter the information that appears in the .INI file. You can copy and paste the .INI contents from an existing file into this field. You must enter at least one section heading and one command line. If you create an .INI file to update a system file on the destination computer, your settings are merged into the existing system file during the installation. Any duplicate settings are overwritten with the values you enter here.
7.
Click OK.
To remove an .INI file, select it in the list on the right and click Delete. To edit an existing .INI file, select it in the list on the right and click Details. See Editing INI File Settings.
Editing INI File Settings 1.
Select Installation Expert > INI Files page.
2.
Select the file on the right of the INI Files page and click Details.
41
The Edit INI File Settings dialog appears. 3.
Complete the dialog: • File Displays the pathname to the .INI file. Installation Expert uses a variable (example: %MAINDIR%) to refer to the directory. To edit this field, you must create a new .INI file item. • INI 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=
4.
"
Comments (lines starting with ;) are not supported.
"
You can enter variables in INI File Contents to insert the values of script variables into the .INI file. See Variables and Expressions on page 79.
Click OK.
Installation Log Use the Installation Log page to create an installation log and to specify its location and name. As an alternative, set the compiler variable _LOGFILE_PATH_ to the path of the log file. The installation log is a text file that lists the events that occur while the installation runs. (Example: It contains the list of files that are replaced.) Entries are also added to the log when files are being deleted or backed up. However, the uninstaller does not take such entries into account during rollbacks. !
Do not create installation log Mark this if you do not want an installation log to be created. If you do this, the end user will get an error upon attempting to uninstall.
!
Create installation log in same directory as first installed file This saves the installation log in the root, because the first Install File action is in the uninstal.wse include script, which appears before any of your Install File lines. This option is included for backwards compatibility with WiseScripts from previous versions of the Wise Installation System.
!
Create installation log in custom directory Mark this to save the installation log in a directory you specify. This enables the options for selecting the directory. Select a directory and enter a name for the installation log in Install Log File Name. (Example: Install.log.) To create a new directory for the log within the Application or Windows directory, click New Folder.
42
Languages Use the Languages page to define the languages supported by the installation, the default language, and the font used by the Japanese version of the installation.
To add a language to the installation: 1.
Before you can add a language on the Languages page, you must first create a new language translation on the Installer Messages dialog, which you access by selecting Edit menu > Installer Messages. See Changing Installer Messages on page 23.
2.
Select Installation Expert > Languages page.
3.
Click Add. The Select Languages dialog appears, which lists the language translations that are available.
4.
Select the language and click OK. The language you select is added to the list on the Languages page. This list is presented to the end user at the start of the installation. Unless you’ve added languages, you can select U.S. English (the default), French, German, Italian, and Spanish.
To delete a language, select it from the list and click Delete. This removes the selected language from the installation, however, it does not delete the language translation that you entered on the Installer Messages dialog. Language Page settings: !
Default Language Select the default language for the installation.
!
Japanese Font Name, Japanese Point Size If you create a Japanese installation, enter the font and point size to be used. Note If you are working with a double-byte language do not include any other languages in the installation. Including double-byte with single-byte languages in the same installation can cause distortion of the fonts for the single-byte languages. If you need both single and double-byte installations, make a copy of the installation and include the double-byte languages in the copy.
!
Copy Default Mark this to copy messages from the default language to all others to provide a starting point for translating the message. Example: Your installation supports two languages and you add a Display Message action to your script with English selected in Setup Editor’s Language drop-down list. If Copy Default is marked and you select French from the Language dropdown list, the text you entered in the English Display Message is copied to the French version of the Display Message action.
!
Always Prompt Mark this to have the installation always prompt the end user to select a language, unless there is only one language in the installation.
Media Use the Media page to configure the installation for the type of media on which it will be stored and distributed.
43
!
Single File Installation Mark this to pack all the files into a single installation file. This is convenient if you plan to distribute the installation over a LAN, or as a single downloadable file over the Internet. (In the latter case, consider using WebDeploy technology to reduce the bandwidth required for the download.)
!
Media-Based Installation Mark this to break the installation into files that fit on a specific type of removable media and to enable the following fields: • Media Type Select the type of media to use: 5 1/4" high-density floppy; 3 1/2" doubledensity floppy; 3 1/2" high-density floppy; Zip disk (100MB); 3 1/2" Super LS120 diskette; CD-ROM (650MB); DVD-ROM (4.7GB); or a custom disk size. • Custom Size If you selected a custom disk size in the Media Type field, enter the formatted capacity of the media you are using in this field.
Microsoft SMS If an installation runs in a Microsoft Systems Management Server (SMS) environment, you can have the installation create a status .MIF file and a definition file (.PDF or .SMS) in the Windows directory during compile. Use the Microsoft SMS page to specify the information for the .MIF file and package definition file. For information about SMS, see msdn.microsoft.com. !
Install MIF Filename Enter the name of the application being installed. Example: sample.mif.
!
Uninstall MIF Filename Enter the name of the application being uninstalled. Example: uninstall_sample.mif.
!
Manufacturer, Product, Version, Enter the manufacturer, name, and version number of the application. These fields are required. If they are left blank, the package definition file is not created.
!
Serial Number Enter the serial number of the application being installed.
!
Package Definition File To create a package definition file when the installation is compiled, mark e one of the following and enter the correct SMS version: • Create Package Definition File (SMS 1.2 or earlier) Mark this to create a package definition file of file type .PDF. • Create SMS File (SMS 2.0 or later) Mark this to create a package definition file of file type .SMS.
To distribute the package definition file with the installation using Package Distribution in Workbench, select Network and the Installation (.exe) option on the Distribution Method dialog. If you distribute the installation to the share point directory and import it into Software Manager, the installation and the SMS package definition file are copied to the share point Available Packages directory when you change its status to Available.
Password Use the Password page to specify a required password or serial number for an installation. End users must enter the correct password or serial number to begin the installation.
44
!
Single password used for all installations Mark this to require a single password for any copy of the installation. In the field to the right of this option, enter the password.
!
Individual serial numbers used as password Mark this to have the installation work with a range of serial numbers and to enable the following fields. This does not produce multiple serialized copies of the installation but a single installation that accepts any of the generated serial numbers. • Serial Number Type Choose whether to create incremental serial numbers (in sequence) or randomly generated serial numbers. • Starting Serial Number, Ending Serial Number Define the range of serial numbers by entering a starting and ending number. • Approx. Serial Numbers Enter the approximate quantity of serial numbers. • Output File Specify a text file name, then click Export. This writes the serial numbers to the specified file. You can use this file to print labels to serialize your application. For maximum protection, use a random serial number scheme and a serial number range that exceeds the number of copies you will produce by a factor of 100 or more. Example: If you generate 1,000 random serial numbers between 1,000,000 and 9,999,999, unauthorized users have only a 1-in-9,000 chance of correctly guessing a serial number.
You can turn password protection on and off on a per-file basis by selecting a file on the Files page and clicking Details. See Require Password in Specifying Installation File Settings on page 38.
Product Details Use the Product Details page to specify the title and the default directory for the installation. !
Installation Title Enter the name of the application. It appears on the background screen and on wizard dialogs during the installation.
!
Default Directory Enter the name of the directory in which your application is installed by default. The end user can override this default.
!
Place default directory under Program Files Mark this to place the default directory in the Program Files directory instead of in the hard disk’s root directory. The end user can change the location.
Progress Bar Use the Progress Bar page to set options for the progress bar that displays while the installation is running. The default progress bar uses a .DLL written by Wise Solutions, which is located in Program Files\Wise Package Studio\WiseScript Editor\Progress. You can specify to use an external .DLL for displaying the progress bar. !
Progress Dialog Placement Select a screen position for the progress bar.
45
!
Progress Bar Based On Select how progress should be calculated: from the position in the compressed files in the installation .EXE, from the position in the installation script, or from the percentage of selected files.
!
Custom Progress Bar .DLL By default, this path points to an operating system-specific .DLL that displays a custom progress bar provided by Wise Solutions. If you have a custom .DLL that displays a progress bar, specify its path here. If you delete this path, the progress bar defaults to a smaller, more generic progress bar.
!
Center All Dialogs Over Progress Dialog Mark this to center all dialogs in front of the progress bar, effectively hiding it whenever end user input is required.
!
Do Not Allow Installation to Be Cancelled Mark this to disable the Cancel button on all dialogs that appear to the end user during installation. Use this option for administrative installations.
!
Do Not Allow Progress Dialog to Be Cancelled Mark this to disable the Cancel button on the Progress dialog that appears on the destination computer. Use this option for administrative installations.
In the Initialization Splash Screen section, you can modify the first splash screen that appears when the end user runs the installation or uninstall. !
Initialization splash screen Choose Custom to modify the splash screen.
!
Initialization .BMP File This is enabled when you select Custom from Initialization splash screen. Specify the .BMP file for the splash screen that end users first see when they run the installation. Note If the bitmap file you select for your custom splash screen doesn’t appear correctly, you probably haven’t selected a valid .BMP file. Non-valid bitmap files do not appear, and no error message is displayed to inform you of the problem.
Registry Use the Registry page to specify the registry entries to be installed or edited on the destination computer. You can either add registry entries manually or import a registry (.REG) file. The left two list boxes display key structure, and the right two list boxes display values. The upper two list boxes display keys and values in your computer’s registry. The lower two list boxes represent the keys and values to be installed on the destination computer. Use the following buttons: !
Add Keys Copy a registry key, including all its subkeys and values, from your computer to the installation.
!
Add Values Copy values from your computer to the installation.
!
New Create a new key or import a registry file into the installation. The presence of a key in this list does not necessarily mean that the key is added to the registry on the
46
destination computer. It merely indicates that the installation operates on the key in some way. The operation might be to add a new key or named value, to modify an existing named value, or to delete a value. !
Delete Key, Delete Value Remove a registry key or value from the installation. This does not delete the key or value on the destination computer.
!
Details Edit registry key settings.
Creating or Editing Registry Key Settings From the Registry page in Installation Expert, you can add new registry keys, edit existing registry values, and import registry files.
To add an empty registry key: 1.
In the lower left list, select the location for the key.
2.
Click New and select Key. The Registry Key Settings dialog appears.
3.
From Operation, select Create empty key.
4.
In Key, click at the end of the existing text, and add a backslash and the name of the new key. Example: Append \Preferences to the end of the existing key name.
5.
Click OK.
To add a registry value: 1.
In the lower left list box, select the key to contain the value you’re adding.
2.
Click New and select Key. The Registry Key Settings dialog appears.
3.
Configure the Registry Key Settings dialog and click OK. See Configuring Registry Key Settings on page 47 for details.
To edit a registry value: 1.
Double-click the value in the lower right list box. The Registry Key Settings dialog appears.
2.
Configure the Registry Key Settings dialog and click OK. See Configuring Registry Key Settings on page 47 for details.
To import a registry file: 1.
Click New and select Import.
2.
In the Select Registry File to import dialog, specify the registry file (.REG file).
Configuring Registry Key Settings Use the Registry Key Settings dialog to set or edit registry key settings. 1. 2.
Select Installation Expert > Registry page. Do one of the following: •
Click New > Key.
47
•
Double-click a registry value in the lower right list.
The Registry Key Settings dialog appears. 3.
Complete the dialog: • Operation 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.
• Root Select the parent key in which the new key is added. • Key Enter the name of the new key. You can create multiple hierarchical keys at once by separating them with backslashes, as in directory pathnames. (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. • Value Name Enter the name of a new named value. • Data 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. • Data 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 NT4/2000/XP 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 NT4/2000/XP system variables to be embedded.
48
"
Multiple strings (REG_MULTI_SZ prefix) Identifies a value entry as a multiple string. These are multiple pieces of text, separated by carriage returns. This is only supported for installations on Windows NT4/2000/XP.
"
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.
• Repair application if this registry value is missing Self-repair prevents an application from failing if this registry value has accidentally been deleted. Mark this checkbox to initiate self-repair if this registry value is missing during application launch. The end user must have access to the installation media to perform a repair, and you must also configure a shortcut to the application with self-repair turned on. See Configuring an Application for Automatic Self-Repair on page 20. • Append 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 checkbox. This option is disabled unless Multiple Strings is selected in the Data Type dropdown list. 4.
Click OK.
Screen Use the Screen page to set the background color or gradient and font for the installation. !
Background Gradient Select whether to display a full-screen gradient, a three-quarters screen gradient, or no gradient behind the installation dialogs.
!
Title Bar Mark this to cause the installation’s title to be displayed at the top of the screen in a title bar.
!
Hide Program Manager Mark this to hide the Program Manager during installation (Windows 3.x only).
!
No Background Gradient Mark this to display no gradient behind the installation dialogs.
!
Top Color, Bottom Color Click these buttons to choose the top and bottom colors for the background gradient. The installation generates a smooth transition between the two colors.
!
Screen Preview Displays a real-time mock-up of how the installation screen will look.
!
Bold/Light Fonts Select the option to always display bold or light fonts, or to use light fonts under Windows 95/98/NT and bold fonts under Windows 3.1x.
49
!
Message Box Font Specify the font to be used. If you do not specify a font, a standard sans serif font is used. For a Japanese installation, specify MS Gothic.
!
Point Size Select the point size for text displayed on the installation dialogs. If you do not specify a point size, the standard Windows text size is used.
!
Character Set Enter the number of the character set to be used. Use zero, which is the default, unless the installation is in Japanese. For a Japanese installation, enter 128 and make sure you have specified MS Gothic in the Message Box Font field.
Services The Services page lets you define applications to be installed as a service under Windows NT, 2000, or XP. The .EXE file you define as a service must already be a part of the installation. Consult your Microsoft developer documentation for information on creating services. This page only helps you install services, not develop them.
To add a new service item: 1.
Select Installation Expert > Files page.
2.
Add the .EXE file that runs the service.
3.
Select the Services page.
4.
Click Add. The Select File from Installation dialog appears. The left list box shows the directory structure of the installation, and the right list box shows .EXE files that were added to the selected directory.
5.
Select the .EXE file from the right list box and click OK. The service appears in the list on the Services page.
To remove an existing service, select it from the list and click Delete. To change the .EXE file for a service, select it from the list and click Details. See Configuring Service Settings on page 50. If you choose an .EXE file that is part of an optional installation component, the service is installed only if that component is installed.
Configuring Service Settings 1.
Select Installation Expert > Services page.
2.
Select a service and click Details. The Create Service Settings dialog appears. It lets you control the behavior of the service when it is run. Refer to your Microsoft developer documentation for information about creating services.
3.
Complete the dialog: • Service Name Enter the internal service name, which is used in the registry. • Display Name Enter the name to appear in the Services control panel. • Executable Path Specify the complete path to the executable file as it will be on the destination computer. Start the path with a variable (example: %MAINDIR%).
50
• Login Username, Password Enter the user name and password under which the service should run. • Error Control Specify what happens if an error occurs while the service starts. "
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 booting the last known good configuration, boot continues. Otherwise, it reboots to the last known good configuration.
"
Critical Error Logs the error if possible. If the computer is booting the last known good configuration, boot fails. Otherwise, it reboots to the last known good configuration.
• Group 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. • Dependencies 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;+widget", you create dependencies on the ftpsvr, httpsvr, and drc services and the widget group. • Service Type Select a service type. • Start Service Select the default setting for starting the service. • Service Interacts With Desktop Mark this to let the service display its user interface. 4.
Click OK.
Shortcuts Use the Shortcuts page to add shortcuts to Windows’ Program Manager or to the Start menu and desktop of the destination computer. If you added program files on the Files page, Installation Expert might have added the default application shortcuts. The Shortcuts page shows the Name, Location, and Source Path of the shortcuts that have been added so far.
To add a shortcut to an installation: 1.
Select Installation Expert > Shortcuts page.
2.
In Default Folder Name, enter the default folder name for your Program Manager or Start menu shortcuts. The end user can change this during installation. You must specify a folder name before you can add any shortcuts.
51
3.
Click Add. The Select File from Installation dialog opens.
4.
In the left list box, which shows the directory structure of the installation, select the directory containing the program file to associate with this file type.
5.
In the right list box, select the file to which to assign the shortcut.
6.
Click OK. The Shortcut Details dialog appears.
7.
Complete the dialog and click OK. See Editing Shortcut Details. The new shortcut appears on the Shortcuts page.
To remove a shortcut, select it and click Delete. To edit an existing shortcut, select it and click Details. If you create a shortcut to a file that is in an optional component of the installation, the shortcut is created only if that component is installed.
Editing Shortcut Details 1.
Select Installation Expert > Shortcut Details page.
2.
Click Details. The Shortcut Details dialog appears. Here you can edit the information about a shortcut being added to a Program Manager or Start menu group. To customize a shortcut further or to place it in a subfolder in the Start menu, go to Setup Editor and double-click the Create Shortcut line within the If System Has Windows 95 Shell Interface statement.
3.
Complete the dialog: • Shortcut Name Enter the name of the shortcut. • Command Line Options Enter the command line options that are used to open the file associated with the new shortcut. • Icon Pathname (Optional) Specify the file that contains the icon to be used for the shortcut. Otherwise, the target file’s icon is used. • Icon Number Enter the number of the icon to use from the file specified in Icon Pathname above. • Default Directory Enter the default directory that should be set when launching the target file, if different from the target file’s location. In Windows Explorer, this field is referred to as the Start in directory. • Shortcut Pathname Displays the pathname of the file that is opened by the shortcut. • Shortcut Location Select where to place the shortcut. • Enable Access For All Windows NT Users Mark this to add the shortcut to the common Program Manager group under Windows NT, so all end users can have access to it. This only works if the user logged in during installation has administrator privileges.
52
• Check self-repair items when this shortcut is opened Mark this to turn on self-repair functionality for this shortcut if you have configured the installation for self-repair. See Configuring an Application for Automatic Self-Repair on page 20. 4.
Click OK.
SmartPatch Use the SmartPatch page to turn an installation into an upgrade (patch), instead of a full version installation. When you distribute installations of this type, the destination computer must contain a previous version of the application for the installation to be successful. To create a smart patch, make sure your computer contains a copy of the old software that is being upgraded. After you specify the path to the old software, the SmartPatch feature compares the older versions of the application to the version being installed and generates a patch installation that contains only the differences between the 2 versions. This can result in a significantly smaller installation file. If you specify multiple previous versions, they’re upgraded no matter what version is on the destination computer. Select one of the following: !
Do Not Create SmartPatch Updates Mark this to create a full installation and not use the SmartPatch feature. You can also leave this feature off while testing an installation, to produce faster compiles.
!
Create SmartPatch Updates Mark this to enable SmartPatch and the following fields: • Error Checking By default, SmartPatch expects the same file names to exist in both the old and new copies of the software and displays errors when they don’t match. You can change the default level of error checking. "
Do not display errors Select this option if you expect a significantly different file set in the new installation.
"
Display error if all matching files not found Select this option to prevent errors such as specifying an empty or incorrect directory for the old software.
"
Display error if any matching files not found Select this option if the old and new installations should have all the same file names, but different versions.
• Patch Threshold Determines at what point SmartPatch simply includes the entire new file rather than creating a patch. The default is 85%, meaning that when the patch file (for all versions to be updated by SmartPatch) is at least 85% of the size of the complete file, the complete file is included rather than the patches. However, even though the entire file is included in the installation, it is not installed unless the end user has a valid copy of an older version of the file. • Maximum Memory Determines how much memory the SmartPatch feature can use. SmartPatch is very memory-intensive. Set this value to 2 MB less than the amount of RAM installed in your computer.
53
• Maximum Patch Compression Mark this to compress patch files as much as possible. This takes extra time, so leave this unmarked during development and testing, and mark it only when creating your final distribution build. • Directory This list displays directories on your computer that contain old versions of your application that end users might have installed on their computers. SmartPatch creates a patch file that updates any of these older versions to the most recent version. The directory structures of each version must match exactly—only the top-level directory name can be different. "
To add a path to an old version of the software, click Add and specify the directory.
"
To remove a path from this list, select it and click Delete.
System Requirements Use the System Requirements page to specify minimum hardware and software requirements for the installation and to set warning messages that display to the end user if the destination computer does not meet the requirements. You can set requirements for the Windows and Windows NT versions, the screen resolution, the screen color depth, and sound support.
To set a system requirement: 1.
2.
From the list on the System Requirements page, select an item to set its minimum requirement.
Select this:
If the application you are installing requires:
Windows Version
Windows 95, Windows 98, Windows Me, no version of Windows at all, or if it runs on all versions of Windows
Windows NT Version
Windows NT 4.0, Windows 2000, Windows XP, no version of NT at all, or if it runs on all versions of Windows NT
Screen Resolution
A specific screen resolution
Screen Colors
Specific color settings
Sound Support
The destination computer be capable of playing .WAV, .MIDI files, or both
Click Details. The Minimum System Requirements dialog opens. This dialog varies, depending on the selected requirement.
3.
Complete the dialog: • Requirement drop-down list Select the minimum system requirement for the application. "
Windows Version, Windows NT Version Specify the minimum version of Windows required by the application. Example: Choose Windows 98 if the application runs on Windows 98, but not on Windows 95.
54
"
Screen Resolution, Screen Colors, Sound Support Specify the minimum screen resolution, color palette, or audio support options the application requires.
• Type "
Recommended Select this if this configuration item is not required by the program. The message you enter in the Message Text field appears on the destination computer if it does not meet the specified requirement, and the installation continues once the message is acknowledged.
"
Required Select this if this configuration item is critical to the installation and the program cannot run without it. The message you enter in the Message Text field appears on the destination computer if it does not meet the specified requirement, and the installation is aborted.
• Message Title Enter a name to appear in the title bar of the warning message. This field is disabled unless a specific requirement was selected. • Message Text Enter the message that appears if the destination computer does not meet the specified requirement. This field is disabled unless a specific requirement was selected. Example: Your message can inform the end user why the installation cannot run: “This application requires Windows Me to run. Please upgrade.” 4.
Click OK.
System Search The System Search page specifies methods by which the installation can search for and detect a previous version of your application. If you know certain files, registry values, or .INI file changes that would be present if your application was installed previously, you can use this page to search for a previous version of your application. If a previous version is installed, its directory becomes the default directory for installation of the new software. Examples: If, during the previous installation, you wrote the installation directory pathname into an .INI file or into the registry, you can search for that pathname using this page. If you know of a specific file that exists only in the installation directory, you can search for that file, and get its directory. In either case, the pathname you find is put into the variable %MAINDIR%. The variable %MAINDIR% represents the default installation directory of the installation. If you search for a registry value, make sure the registry value contains a valid directory or pathname. If the search finds the registry Value Name, its Value Data is put into %MAINDIR%. If you search for an .INI value, make sure the .INI Item Name contains a valid pathname. If the search finds the .INI Item Name, its value is put into %MAINDIR%. If you know the pathname ends with a file name, mark Remove File Name when configuring the registry or .INI search.
To search for a previous version: 1.
Select Installation Expert > System Search page.
2.
Click Add and select the search method:
55
• Search for File Searches the destination computer’s hard drive and network for a specific file. • Read INI Value Searches within an .INI file for a value. Use this only to get an .INI value that you know to be a valid pathname on the destination computer. • Read Registry Value Searches the Windows registry for the key value you specify. Use this only to get an .INI value that you know to be a valid pathname on the destination computer. Depending on your selection, a corresponding dialog opens so you can configure the search. 3.
If searching for a file, complete the Search for File dialog: • File Name Enter the name of the file. • Description Enter the message to display on the progress dialog while searching. • Drives to search Select local hard drives only, network drives only, or both. • Search depth Set the search depth to zero to search the entire directory tree of the specified volumes. A search depth of 2 or 3 is recommended when searching network volumes.
4.
If searching for an INI value, complete the Read INI Value dialog: Select the directory that contains the .INI file from the directory tree. If the directory is not displayed, select its parent directory and click New Folder to add it. • INI File Name, INI Section Name, INI Item Name Enter the file name of the .INI file to be read, the section that contains the entry to be read (without the square brackets), and the item name of the entry. • Remove File Name Mark this to return only the directory name if it ends with a file name.
5.
If searching for an registry value, complete the Read Registry Value dialog: • Root Choose the root key that contains the named value to be read. • Key, Value Name Enter the name of the key and the value to be read from that key. • Remove File Name •
Mark this to return only the directory name if it ends with a file name.
6.
Click OK.
7.
Repeat the preceding steps to create additional search items.
The items listed on the System Search page display the search methods for finding the old version of the application. The installation performs the searches in the order listed until one is successful. It then makes the directory of the previous installation the default directory for the installation. If none are successful, the directory you enter in Default Directory on the Product Details page is the default directory. To remove a search item from the System Search page, select it and click Delete. To edit the details of a search item, select the item and click Details.
56
Uninstall Use the Uninstall page to specify whether the installation supports the uninstall capability and to set options for controlling which files are removed by the uninstall program. The uninstall program is named unwise.exe. Note Installations contain the Repair option when you choose the application name in the Add/ Remove Control Panel. Choosing Repair re-edits the registry and .INI files, re-installs all files, and re-self-registers files. !
Do not add support for uninstall Mark this to not give end users the ability to uninstall the application.
!
Support uninstall Mark this to allow uninstall and to enable the following uninstall options. • Display uninstaller background window Mark this to display a gradient window similar to the one displayed during installation. • Top Color, Bottom Color Click these buttons to choose the top and bottom colors for the background gradient. The uninstall generates a smooth transition between the two colors. • Uninstaller Font Specify the font to be used. If you do not specify a font, a standard sans serif font is used. For a Japanese installation, specify MS Gothic. • Point Size Select the point size for text displayed on the installation dialogs. If you do not specify a point size, the standard Windows text size is used. • Character Set Enter the number of the character set to be used. Use zero, which is the default, unless the uninstall is in Japanese. For a Japanese uninstall, enter 128 and make sure you have specified MS Gothic in the Uninstaller Font field.
To add a new command: The uninstaller reads commands from the Install.log file created during installation. On the Uninstall page, you can add commands for the uninstaller. 1.
On the Uninstall page, click Add and select the type of command to enter.
2.
If you select Delete File(s), the Delete File(s) dialog appears. Use this type of command to delete additional files, such as those created by your program on first run. It is not necessary to add commands to delete files the installation created.
3.
•
Select the directory containing the files to be deleted. If the directory is not displayed, select its parent directory and click New Folder to add it.
•
Enter the file name in Filename. You can use a wildcard to specify the files.
•
Click OK.
If you select Delete Registry Keys, complete the Remove Registry Tree dialog: Use this type of command to delete registry entries, such as those created during the execution of your program. It is not necessary to use this command to delete registry entries the installation added.
57
4.
5.
•
Select the registry keys to be deleted. If the key is not displayed, select the key it should be added to and click New Key to add it.
•
Click OK.
If you select Execute Program, complete the Select Program to Execute dialog. •
From the list on the left, select the directory containing the program to be executed.
•
From the list on the right, select the program to be executed (or enter its name in the Program Filename field). For best results, make sure that the program you execute has little or no user interface. The uninstall procedure should seem like a single program to the end user, even if additional programs are executed.
•
Click OK.
Mark Delete in-use files during uninstall to delete even those files that are in use when the uninstall program is running.
WebDeploy The WebDeploy page provides an efficient method for creating true Internet-based installations for your application. It creates a small stub installation that downloads the compressed files from a Web server as needed. For an example of a script that lets WebDeploy work through a proxy server, see Sample Scripts That Perform Web and FTP Transactions on page 183. Note WebDeploy supports only basic authentication. In your Web server software, make sure that the directory you use for WebDeploy is secured with basic, not domain, authentication. Also, if you use the FTP protocol for WebDeploy, keep in mind that WebDeploy doesn’t support passive transfers via FTP. Some firewalls and gateways require passive FTP transfers.
To create an Internet-based installation: 1.
Select Installation Expert > WebDeploy page.
2.
Select one of the following: • Add support for Internet-based Copy Local Files script action Mark this if you add a Copy Local Files script action that will download or upload to a Web site. If you mark this option, select the protocol for the Copy Local Files action from File Transfer Via. • Complete support for Internet-based installation Mark this to break an installation into downloadable chunks and a distributable .EXE file.
3.
Complete the following fields: • Host Address Enter the domain name or IP address of the Web or FTP host that will hold the installation files. • Host Username, Host Password Enter the user name and password required to log onto the server. If this is left blank, an anonymous logon is performed. It is a good idea to use password protection so that casual users of your Web or FTP server do not stumble across the WebDeploy files, and also to make sure that only users with the installation stub .EXE can access them. Because
58
everyone with a copy of the installation .EXE uses the same username and password, this is not suitable for tracking individual user access to the Web site. • Host Directory Enter the path to the WebDeploy files stored on the server. • File Transfer Via Select how to transfer the files: "
FTP Protocol This option is used within an intranet for companies who deploy their software behind a firewall. It works through WinSock, so you must have a valid WinSock layer for it to work. Using this protocol requires a name and a password. WebDeploy fails if the server allows anonymous login without a password. To have the FTP protocol work through a proxy server, see the workaround solution contained in the sample script PROXY.WSE, located in the Samples directory within the WiseScript Editor application directory.
"
HTTP Protocol This option is more universal because it can be used both outside and behind a firewall. The HTTP protocol attempts to read the information from the Web browser, which makes your files more widely available to your clients. It also allows for faster file transfers than the FTP protocol. Because of its flexibility and proxy server support, using the HTTP protocol is recommended.
• Cluster Size Enter a number in kilobytes. Files smaller than the cluster size are packed into data files up to the cluster size. Files larger than the cluster size make up their own data file. A smaller cluster size increases the transfer rate of data. It also minimizes the amount of files that a given installation must download because only the necessary files are downloaded. Example: An installation has four 5K files and one 50K file. You set the cluster size to 20K and compile. You end up with a 20K file, packed with the four 5K files, and a 50K file. 4.
Save and close the installation.
5.
In Wise Package Studio’s Workbench, select the Tools tab, and launch the Package Distribution tool.
6.
On the Specify File to Distribute dialog, specify the installation file to which you added WebDeploy, and click Next.
7.
On the Distribution Method dialog, mark FTP Server and click Next. This recompiles your application and uploads the installation file, as well as a WebDeploy configuration file, to an FTP server.
8.
Enter the information about the server, and click Next. File transfer commences. Once the files are uploaded to the server, you can test your application by connecting to the FTP server through an FTP client and downloading and running the installation .EXE. WebDeploy downloads and installs only the files that a particular end user requires, skipping those files that are the same version as existing files on the destination computer. To determine which files can be skipped, WebDeploy uses Microsoft’s VER.DLL. If the Internet connection is interrupted during the download, WebDeploy
59
picks up where the installation was cut off when download resumes. See The WebDeploy Process. Note Installations deployed through WebDeploy contain a Repair option in the uninstall wizard, but the Repair option does not function.
The WebDeploy Process Phase 1:
Your Computer
Package Distribution FTPs files (Does not work through proxy) When you develop the installation, you: ! Configure WebDeploy by specifying the location of installation files on the Web host ! Compile the installation ! Use Package Distribution to upload the installation
Phase 2:
Destination Computer
Your Internet Host (FTP/HTTP) Server ! Contains the installation • The installation is copied to the host but is not used yet • The installation and its pieces are stored in an .EXE file plus files named .001, .002, and so on
Your Internet Host (FTP/HTTP) Server ! Contains the installation .EXE and other files
(HTTP Protocol)
The end user: ! Downloads the installation .EXE from your web site
Phase 3:
Destination Computer (HTTP Protocol)
Your Internet Host (FTP/HTTP) Server ! Contains the pieces of an installation ready for download ! Contains the new installation and its ReadMe !
When the end user runs the installation, it: ! Runs an install wizard ! Determines which pieces of the application are needed ! Downloads only the required pieces from your web host ! Installs the appropriate pieces of the application
WebDeploy Versus Distributing to an FTP Server There is an important distinction between building a true Internet-based installation with WebDeploy and just distributing an installation to an FTP server. !
WebDeploy recompiles your information into stub files and data files, but does not actually put the files on the Web. The stub files are designed to be distributed over the Internet, that is, they contain all the server connection information. When an end user clicks the stub file, WebDeploy connects to the appropriate Web site, checks the
60
system on the destination computer to determine what it needs, then starts downloading files. After it has finished downloading the files, it starts the installation. !
When you mark the FTP Server option in the Package Distribution tool (with WebDeploy disabled), it simply copies your compiled files to the location you specify.
WebDeploy and FTP server distribution can be used in conjunction with each other. However, you should use an external FTP client to upload the files to the Web because the FTP Server feature in the WiseScript Editor fully automates the upload process, so you do not have direct control over the directories to which you are installing.
61
Chapter 4
Setup Editor Setup Editor provides a scripting environment where you can add advanced functionality to your script. The script is just another way of looking at an installation. You can use Setup Editor’s built-in debugger to help test and troubleshoot your script. Topics Include: !
About Setup Editor.
!
About User-Defined Actions.
!
About Debug Commands.
!
Basic Scripting Concepts.
62
About Setup Editor
About Setup Editor Setup Editor provides a powerful and easy-to-use environment for creating an installation script. You don’t need to memorize commands, because Setup Editor supports a point-and-click method of scripting. The script you create displays in clear English-like statements. Every installation is driven by a script that specifies how to display dialogs, edit the .INI files, add registry entries, and more. The script is compiled, along with all the files and other resources in the installation, into an installer .EXE. When an end user launches the installer .EXE, the script runs, executing all the actions specified in the script. If you create a new installation by selecting Empty Project on the New Installation File dialog, Setup Editor is populated with a default script. The default script is based on the template file Empty Project.wse in the WiseScript Editor\Template directory. If you create a new installation by selecting Blank Script on the New Installation File dialog, Setup Editor is empty. Some lines in the script correspond to options on pages in Installation Expert because these options generate script lines. (Example: If on the Product Details page in Installation Expert you enter InstallationName in the Installation Title field, then the following line is generated in the script: Set Variable APPTITLE to InstallationName.) Because pages in Installation Expert generate script lines, Setup Editor attempts to apply a default script based on Installation Expert pages whenever you switch from Setup Editor to Installation Expert. If you add script lines to a blank script in Setup Editor and attempt to go to Installation Expert, you see a warning that your script must be converted. For details, see Navigating Between Views on page 13.
The Setup Editor Window The Setup Editor window contains all the tools necessary to develop and edit scripts. To access Setup Editor, click Setup Editor at the bottom of the window.
Title field
Event and Language dropdowns.
Actions list.
Installation Script list.
Standard and Custom tabs.
There is a tab for the main installation script and each include script.
63
About Setup Editor
Title This field contains the script’s name. By default, it is the name entered in the Installation Title field on the Product Details page followed by “Installation.” If you change the title of the script here, it does not change on the Product Details page. When you run the installation, this name appears at the top of the splash dialog (the Initializing Wise Installation Wizard dialog), and in the title bar of the installation screen.
Event From this drop-down list, you select the script to edit. The Mainline script is the script that typically contains installation instructions. For details, see Choosing a Script to Edit.
Language From this drop-down list, you select a language for the script. This drop-down list includes all the languages the installation supports, which you set on the Languages page. When you add a script line that presents text to the end user, select each language in the Language drop-down list, and edit that script line so it contains the translated text. (Example: You set an installation to support French and English on the Languages page. While in the U.S. English script, you add a Display Message script line that states, “Do you want to view the ReadMe file now?” You should then select French from the Language drop-down list and edit the script you just added with a French translation of the message.) See Languages on page 43. The dialogs that ship with WiseScript Editor are pre-translated, so you do not need to edit them.
Actions The Standard tab of this list displays all the actions you can add to your script. The Custom tab displays only your customized list of actions. See Customizing the List of Actions on page 69.
Installation Script This list contains the script that is executed when an end user runs the installation. To edit a script line, double-click it. To copy and paste script lines, use the editing commands on the Edit menu. Script lines are color-coded based on the type of the script line. To change the color code, see Setting Preferences on page 23. The default color code is as follows: !
Compiler Variable Items - gray
!
Include Script Items - black
!
Install/Copy File Items - black
!
Logic items - blue
!
New Variable Values - red
!
Remarks - green
For information on working with scripts, see Choosing a Script to Edit on page 65. To show tabs for Wise include scripts, mark the Show Tabs for Wise Include Scripts checkbox in Preferences. See Setting Preferences on page 23.
Right-click Menu Use the right-click menu of actions and script lines to perform common operations.
64
About Setup Editor
Choosing a Script to Edit In Setup Editor, you can edit event scripts and include scripts.
Event Scripts Event scripts are scripts that handle events. (Example: The end user canceling the script.) There are 3 event scripts you can select from the Event drop-down list and edit: !
Mainline The primary script that’s executed during the normal installation process. It contains placeholders for Cancel and Exit scripts. When you open a script using File menu > Open, that script is considered the “main installation script,” and is on the first tab below the installation script. Changes in the main installation script are reflected in Installation Expert and vice versa.
!
Exit 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 here. See Creating a User-Defined Action on page 70.
!
Cancel 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 preinstallation state.
Include Scripts Include scripts are scripts that are added to an installation by way of an Include Script action. See Include Script on page 115. Scripts can be included either in your main installation script or in other include scripts. During runtime, include scripts are run when the Include Script action that references them is encountered. For each Include Script action in your script, a new tab appears at the bottom of Setup Editor. To show tabs for Wise include scripts, mark the Show Tabs for Wise Include Scripts checkbox in Preferences. See Setting Preferences on page 23. Include scripts can help save time in developing installations, 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. By default, all scripts based on the Empty Project template on the New Installation File dialog contain 2 include scripts: rollback.wse and uninstal.wse. These are special Wisecreated scripts. The rollback.wse script is in the Cancel event script and is executed if the end user cancels the installation after it starts. If the end user chooses to backup replaced files, this script will roll the destination computer back to its pre-installation state. The uninstal.wse script adds uninstall support to each new installation. Note Changes made to an include script are saved to that script when you save the installation.
When you do a text search, all event scripts are searched and you can mark an option to search all include scripts.
Editing the Script To edit your script in Setup Editor, use the commands on the Edit menu, 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.
65
About Setup Editor
Note Changes made to an include script are saved to that script when you save the installation.
To edit the parameters of a script line: Double-click a script line. For most script actions, a dialog opens so you can configure its options. If it is a custom billboard or custom dialog script line, the appropriate editing environment opens.
To duplicate or move script lines: Select the script lines, then select Edit menu > Duplicate or Edit menu > Move Up or Move Down.
To copy and paste script lines: 1.
Select the script line or lines.
2.
From the Edit menu, select Cut or Copy.
3.
If you’re copying the lines to another installation, open that installation script in Setup Editor. You cannot open multiple scripts in the same instance of WiseScript Editor unless it is an include script. See Choosing a Script to Edit on page 65. However, you can open multiple instances of WiseScript Editor, and open different scripts in each.
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. Note To insert lines below the line you selected, mark the Append New Items checkbox in Preferences. See Setting Preferences on page 23.
To save a script to a text file: Select File menu > Save Script Text to File. Specify the location and name of the file. This text file is for viewing and printing only. You cannot make changes in the text file and import it back into Setup Editor.
To comment out script lines: You can temporarily comment out certain script lines to help with the debug process. Commented out lines remain in the script, but are skipped when the script is executed. 1.
Select the line or lines in the script to disable.
2.
Select Edit menu > Comment.
The commented out lines appear in green. To reactivate commented out lines, select them again and select Comment again.
To show or hide line numbers or connection lines: From the right-click menu, select Line Numbers or Connection Lines. Connection lines connect the beginning and end of an if-block or a loop.
66
About Setup Editor
Adding New Actions to a Script In Setup Editor, add actions to a script in any of 3 ways: !
Drag an action from the Actions list onto a line in the Installation Script list. The new action appears above the line that is highlighted when you drop the action.
!
Select the line in the script above which you want the new action to appear, an double-click the action in the Actions list.
!
Select the line in the script above which you want the new action to appear, and start typing the first few letters of the action name. As you type, the current line becomes a drop-down list with all the action names, and the action that most closely matches the letters you typed is the current item in the list. Use the arrow keys to move up and down the list or continue typing the action name. When the action you want is the current item in the list, press Enter.
Note To insert lines below the line you selected, mark the Append New Items checkbox in Preferences. See Setting Preferences on page 23.
When you add an action, a dialog appears that lets you set the parameters for the action unless it does not require parameters. If the new action is a Custom Dialog or Custom Billboard action, the appropriate editing environment opens. For details, see WiseScript Actions on page 83. Some actions come in pairs. (Example: When you add an If action, you must also add an End action at the end of the conditional block.) Setup Editor indents actions inside these pairs.
Finding Text in a Script In Setup Editor, use the Find command to find lines in the script that contain a particular string of text. This command searches not only the visible text in the script lines, but also the parameters and options on the configuration dialogs associated with each script line. The Find command searches from the currently-selected line down to the last line. 1.
Select Edit menu > Find. The Find Text in Installation Script dialog appears.
2.
In Find What, enter the text to find. Use the ? wildcard to represent any character.
3.
To search for the text across all scripts, mark Search Across Include Scripts. See Choosing a Script to Edit on page 65.
4.
Click Find Next. The dialog displays the script line that contains the text, with the text item in which the search text was found. A message indicates if the search text was not found.
5.
To view the script that contains the found text and its parameters, close the Find Text in Installation Script dialog and double-click the script line.
6.
Press F3 to find the next occurrence. A message dialog informs you when the search has reached the end of the script.
67
About Setup Editor
Replacing Text in a Script In Setup Editor, use the Replace command to find a string and replace it with a new string. You can only replace parameters and editable text. The Replace command searches from the currently-selected line down to the last line. 1.
Select Edit menu > Replace.
2.
In Find What, enter the text to find, and in Replace With, the text to replace it.
The Replace Text in Installation Script dialog appears. Use the ? wildcard to represent any character. 3. 4.
To search for the text across all scripts, mark Search Across Include Scripts. See Choosing a Script to Edit on page 65. Click Find Next. The dialog displays the script line that contains the text, with the text item in which the search text was found. A message indicates if the search text was not found.
5.
Click the appropriate button: • Find Next To leave the found text untouched and to find the next occurrence of the search text. • Replace To replace the found text with your replacement text, and to find the next occurrence of the search text. • Replace All To replace all occurrences of the search text. Use this with caution! The text you are searching for might be found in more places than you expect. You cannot undo this operation. • Close To close the dialog when you are done replacing.
When no more occurrences of the search text are found, the search dialog closes.
Checking for Duplicate Files in Include Scripts In Setup Editor, you can check your scripts for the existence of duplicate files. Files are considered duplicates if their source paths are identical. You might have duplicate files if your main script contains Install File(s) script lines, and the same file is referenced in both the main script and the include script. 1.
Select Edit menu > Duplicate Files Report. It checks the main installation script and all include scripts for duplicates. If no duplicate files are found, a message appears telling you that no duplicate files were located. If duplicate files are found, the Save As dialog appears.
2.
If the Save As dialog appears, specify a name and location for your duplicate files report. Notepad opens displaying the duplicate files report. It looks something like this: c:\export.txt Line: 1 File: c:\include2.wse Line: 49 File: c:\MyInstaller\MainInstall.wse The duplicate file is C:\export.txt. It is found in line 1 of the file include2.wse and line 49 of the file MainInstall.wse. The file include2.wse is an include script inside the MainInstall.wse script.
68
About Setup Editor
Customizing the List of Actions In Setup Editor, the Standard tab displays a list of all available actions and the Custom tab displays your customized list of actions. You can rearrange the actions on the Custom tab. 1.
Select Edit menu > Custom Action List. The Custom Action List Settings dialog appears.
2.
To add an action, select an action in the Actions list and click Copy.
3.
To delete or reorder a custom action, select the action in the Custom Action List and click Delete or click Move Up or Move Down.
4.
Click OK.
You can customize your Actions list further by creating your own user-defined actions. See About User-Defined Actions.
69
About User-Defined Actions
About User-Defined Actions Setup Editor contains a list of built-in actions that you can add to your script, and it lets you create your own actions. You can streamline your development process by creating actions for tasks you perform frequently with scripting. Example: You’ve written a section of script that launches a Web page on your company’s Web site. Some of the script lines do a registry lookup to determine the default browser on the destination computer, and other lines open the browser to the specified URL. For each installation you create, you copy this section of script from an old installation script to your new one, then change some of the options, such as the URL. To make this section of script conveniently available in all new installations that you develop, you could turn it into a user-defined action. User-defined actions appear in the Actions list in Setup Editor along with the built-in script actions. You create a user-defined action by creating a separate WiseScript and saving it in the Actions directory in the WiseScript Editor application directory, or in the directory specified in the Shared Directory field in Preferences. When you create a user-defined action, specify the following in the script:
Action Name The file name of the script.
Dialog Include a dialog only if your action has parameters that you need to change each time you use the action. This dialog appears when your action is double-clicked. Example: For an action that opens a URL in the end user’s browser, you might include a dialog 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 on the destination computer’s browser, the script lines determine the default browser and launch 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 to your script. You enter a combination of text and variables to determine the format.
Creating a User-Defined Action This procedure outlines 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 four parts of the user-defined action. For an example of how to complete these details, see Creating a User-Defined Action Tutorial. 1.
Select File menu > New.
2.
Select Blank Script and click OK. If you see a warning message that the installation script is not compatible with Installation Expert, click OK. In Setup Editor, you should see a completely empty script.
3.
Select File menu > Save. The Save As dialog appears.
70
About User-Defined Actions
4.
Save the script file in the Actions directory, which is in the WiseScript Editor application directory, or the shared directory specified in Preferences. The file name you enter is the name that appears in the Actions list in Setup Editor after you exit and re-open WiseScript Editor.
5.
If your user-defined action includes a dialog where you can enter options for the action, create the dialog. •
From the Event drop-down list in Setup Editor, select Exit.
•
Add a Custom Dialog action to the Exit script, and create your dialog in Custom Dialog Editor. Note To add a drop-down list on your custom dialog 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.
6.
From Event, select Mainline. This returns you to the main script.
7.
Add script lines that perform the functionality 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 advanced functionality.
8.
In the Title field, enter the format of the script line. This determines how the script line of your user-defined action looks in the script. Example: Your user-defined action displays an HTML file on the Web. In your action, a dialog 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 userdefined action to an installation script, the dialog appears and you enter www.wise.com/support.htm for the URL. The script line for your user-defined action displays in the format you specified, except that it shows the variable’s value instead of the variable name. It displays: Display HTML File www.wise.com/ support.htm.
9.
Save the script. Make sure it is saved in the Actions directory or in the shared directory specified in Preferences.
10. Test your new user-defined action: •
Exit WiseScript Editor. The new action is not displayed in the Actions list until you exit and re-open WiseScript Editor.
•
Open WiseScript Editor and select File menu > New > Empty Project.
•
In Setup Editor, double-click your user-defined action in the Actions list. If it includes a dialog, the dialog opens. Complete the dialog and click OK.
•
Save the project and click Test to test your script.
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 where you can specify how many milliseconds to pause the installation.
71
About User-Defined Actions
To create a new blank script for the action: 1.
Select File menu > New. The New Installation File dialog appears.
2.
Select Blank Script and click OK. If you see a warning message that the installation script is not compatible with Installation Expert, click OK. In Setup Editor, you should see a completely empty script.
3.
Select File menu > Save. The Save As dialog appears.
4.
Save the script file in the Actions directory, which is in the WiseScript Editor application directory, or the shared directory specified in Preferences. Name the file Wait. You must save user-defined actions in the Actions directory or in the shared directory specified in Preferences for them to appear in the Actions list in Setup Editor. The file name you enter is the name that appears in the Actions list after you exit WiseScript Editor and re-open it.
To create a dialog 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 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 appears.
3.
In Dialog Title, enter “Enter Time to Wait” and click OK. The Custom Dialog Editor opens.
4.
Click the Text Control tool on the toolbar. The Text Control Settings dialog appears.
5.
In Text, enter “Milliseconds to Wait” and click OK.
6.
Click the Edit Text tool on the toolbar. The Edit Text Control Settings dialog appears.
7. 8.
In Default, enter %WAIT_TIME%, in Variable, enter WAIT_TIME, and click OK. Click the Push Button tool on the toolbar. The Push Button Control Settings dialog appears.
9.
In Label, enter OK, mark the Return to Previous Dialog action, mark Default Button, and click OK.
10. Click the Push Button tool on the toolbar again. The Push Button Control Settings dialog appears. 11. In Label, enter Cancel, mark the Abort Installation action, and click OK. 12. Rearrange the dialog so that it looks something like this:
72
About User-Defined Actions
13. When you are done editing the dialog, select File menu > Save Changes and exit.
To create a script for the action: 1.
From Event, select Mainline to return to the main part of your script. The script should be blank.
2.
In Actions list, double-click the Call DLL Function action. The Call DLL Function dialog appears. 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, consult documentation provided as part of the Microsoft Developer Network (msdn.microsoft.com).
3.
Complete the dialog: • 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 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.
5.
Click OK on the Call DLL Function dialog.
6.
In Title (located above the Actions list), enter “Wait %WAIT_TIME% Milliseconds.” The text you enter determines how the script line looks in the script.
7.
Save changes in your script. It should already be named Wait.wse and should be located in the Actions directory within the WiseScript Editor application directory or in the shared directory specified in Preferences.
To test the action: 1.
Exit WiseScript Editor. You must completely exit and reopen WiseScript Editor for the new action to appear in the Actions list.
2.
Open WiseScript Editor and select File menu > New > Empty Project and click OK. An empty project contains a default script in Setup Editor.
3.
In the Installation Script list, click the top line in the script.
73
About User-Defined Actions
4.
In the Actions list, double-click the Wait action. The dialog 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 A millisecond is one-thousandth of a second, so 9000 milliseconds equals nine seconds.
6.
Save the project.
7.
Click Test to test your script.
After the blue screen appears, it should take about nine seconds before the installer’s Welcome dialog 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 look at 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.
74
About Debug Commands
About Debug Commands Once you create or modify a script, you are ready to test it. You can do this by using the Test or Run buttons on the navigation bar, or by using the more flexible capabilities of Setup Editor’s debug commands. With these commands, you can single-step through a script or run to a breakpoint to view the script and the values of variables. You can also use Display Message and Compiler Variable actions to generate a debug version when you compile.
Using the Debug Commands The Debug menu in Setup Editor has a set of debug commands that let you step through your script to make sure it functions properly. When you run an installation in debug mode, you can see what the script is doing at any time and the values of any variables that have been set. 1.
Select Debug menu and select a command. • Go Use to begin debugging. It launches your installer .EXE and a yellow arrow displays next to your first line of script. Also use it to proceed to the next breakpoint. • Set Breakpoint Use to set a breakpoint at the selected action. A breakpoint is a place in the script that temporarily halts execution. • Single Step Use to step through the script and execute only the script action with the arrow next to it. • Stop Debugging Use to exit the installation and resume normal Setup Editor operation.
2.
Edit the script errors as they occur rather than waiting for the installer to finish. Do this by double-clicking the script action, or by using any of the methods for changing a script described in About Setup Editor on page 63. Changes you make are not reflected in the installer .EXE that is currently running. After you edit an action, the debugger asks whether to stop the installer .EXE.
75
About Debug Commands
The Variables list contains the variables with their values for the selected action. To edit a variable’s value, double-click it.
The yellow arrow indicates the next action to be processed. The red dot indicates that a breakpoint was set for this action. Breakpoints temporarily halt the execution of the installation.
Building a Debug Version You can use a compiler variable to build 2 versions of an installation: a normal version and a debug version with Display Message actions. You add the Display Message script lines to your script to check the value of a variable or display other relevant information. You then put this script inside a Compiler Variable If block that lets you customize your installer .EXE at compile time. Each time you build the installation, you are asked whether to produce a debug version. If you choose not to build a debug version, the script actions you place inside the Compiler Variable If block are not included in the installer .EXE. 1.
Select Installation Expert > Compiler Variables page.
2.
Click Add. The Compiler Variable Settings dialog appears.
3.
Complete the dialog: • Variable Name Enter _DEBUG_. • Default Value Enter NO. • Description Enter “Compile debug version of this installer?” • Value List Enter YES on the first line and NO on the second line. • Data Entry Type Select List of values (single-select). • Do Not Prompt for Value Make sure this is cleared.
4.
Click OK.
76
About Debug Commands
5.
On the Compiler Variables page, mark Compiling from Within Wise.
6.
Select Setup Editor and add the following actions with their parameters immediately below the script line that sets the value of MAINDIR (Set Variable MAINDIR to Application): • Compiler Variable If In If Variable, enter _DEBUG_, select Equals from the drop-down list, and in The Value, enter YES. • Display Message In Message Title, enter Main Directory, and in Message Text enter The Main Directory is %MAINDIR%. • Compiler Variable End You should see the following lines in your script: Set Variable MAINDIR to Application If Compiler Variable _DEBUG_ Equals “YES” then Display Message “Main Directory” Compiler Variable End
7.
Click Test to test your debug version. A dialog appears asking if you want to build a debug version.
8.
Mark YES and click Next.
Because the Display Message dialog is compiled into the installer .EXE, it appears with the current value of MAINDIR when your installer runs. If you selected NO, the Display Message would not be compiled into the installer .EXE. You can add the Compiler Variable If blocks anywhere to insert Display Message script lines to help with your debugging. You can use any type of script action inside the Compiler Variable If block.
77
Basic Scripting Concepts
Basic Scripting Concepts If you do not have a basic understanding of scripting concepts, you should become familiar with them before attempting to write an installation script. See: Conditionals and Loops Variables and Expressions on page 79 Compiler Variables vs. Runtime Variables on page 80 Anatomy of a Script on page 81 About Components on page 81 Setup Editor on page 62
Conditionals 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 known as conditionals and loops. Conditionals 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 whether they’re running Windows 95/98/Me or Windows NT4/2000/XP. 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 2 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 conditionals and loops is marked using the End action. Setup Editor indents everything inside a conditional or loop so you can see which actions are affected.
Else and ElseIf Actions In addition to the If and End markers, conditionals can use the Else and ElseIf actions, which mark the beginning of actions to be executed when the condition described by the If (or other conditional statement) is not true. When the Else action is used, it goes 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 conditional or loop can contain another conditional or loop. This is called nesting. You define a nested conditional or loop by adding a second If or While action (or other start-of-conditional or start-of-loop marker) before the End action of the first conditional 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 conditionals and loops as deep as you like, but in most circumstances you won’t find it necessary to nest
78
Basic Scripting Concepts
more than 3 or 4 deep. Setup Editor’s indentation, which increases for each nested structure, helps you interpret deep nestings.
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 2 sources. Some variables are defined by Installation Expert. (Example: The WIN variable contains the path to the Windows system directory.) You can also define up to 986 of your own variables 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 !
Must begin with a letter.
!
Must be 28 characters or less.
!
Can contain only numbers, letters, and underscore characters.
!
Cannot begin with an underscore character; only compiler variables can start with an underscore character.
Variables and Substitution By using variables the installer .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 % sign 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 % sign in your script, use %%. You can use substitution to: !
Build messages to display to the end user
!
Set locations for copying or installing files
!
Initialize new variables to the value of one or more other variables.
Expressions If you are using a variable name as part of an expression, do not surround the variable name with %. (Example: if you use an If, ElseIf, While, Set Variable, or a Wizard Loop action to evaluate an expression, do not enclose the variables you reference in the expression with %.) The exception to this rule is compiler variables. Enclose compiler variables inside percent signs no matter where you enter them. A few types of actions (If, While, 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 195. To read about scripts that evaluate expressions with an If statement, see Sample Scripts That Use Expression Operators on page 178.
79
Basic Scripting Concepts
Compiler Variables vs. Runtime Variables When They Are Set WiseScript has 2 kinds of variables: compiler and runtime. When you initiate a compile by clicking the Compile, Test, or Run button, the values of compiler variables are set immediately, either by prompting you or by reading the values from the Compiler Variables page. Setup Editor then searches the entire script and replaces any instance of the compiler variable with the value. These variables cannot be changed by end users who run the installer .EXE. Runtime variables are set by selections the end user makes on the installation’s dialogs, by characteristics of their computer, or by the contents of files on their hard disk, such as a settings file, an .INI file, or the registry. The difference between compiler variables and runtime 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 runtime.
In Conditionals and Expressions You can use both types of variables in variable substitution. However, they have distinctly different behaviors when used in conditionals 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 conditional based on runtime variables, all the script actions required by the conditional are included in the installer .EXE. WiseScript Editor doesn’t know which part of the conditional will be executed until the installer .EXE is run because it depends on variables whose values are not known until runtime. The values of compiler variables, on the other hand, are known when the installer .EXE is built. Therefore, WiseScript Editor does not include the script actions inside a compiler variable conditional when building the installer .EXE.
Naming Compiler Variables By convention, the names of compiler variables begin and end with an underscore. WiseScript does not enforce this convention, but you might find the naming scheme helpful in keeping track of which variables are known at compile time and which are known only at runtime.
Using Compiler Variables If an Install File(s) action is included inside a Compiler Variable If block, the file it installs is not added to the installer .EXE if the conditional is false. You can use this functionality for many purposes. See Compiler Variables on page 30. Example: You can create a script that compiles an installer .EXE for either a 16-bit or 32-bit version of your application based on the value of a compiler variable, including 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 installer .EXE, making it smaller than a universal installation for both 16 and 32 bit systems. You can also use compiler variables to create a “debug” version of your script that includes Display Action messages to display runtime variable values and other useful information at various points in the installation. By enclosing your debugging actions in compiler variable conditionals, you can easily “strip them out” when the installation has
80
Basic Scripting Concepts
been debugged by changing the value of a compiler variable. The debugging actions are not compiled into the final build. For details, see Building a Debug Version on page 76.
When to Use !
Variable substitution can use either type of variable.
!
When a script action places a value into a variable, the variable must be a runtime variable. Compiler variables can’t be changed by scripts, but only by the person who builds the installer .EXE.
!
In most other instances, the type of variable to use is implicit (example: the Compiler If script action requires a compiler variable) or noted explicitly.
Anatomy of a Script An installation script has four basic sections. Whether you are modifying the default script generated by Installation Expert or writing your own script from scratch, an understanding of these sections can help insure that your script works correctly.
Initialization In this section, default values for an installation are set, including the default directory, standard components, and Start menu. Information that is needed later in the installation is read from .INI files or the registry. Files that display 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 dialogs that ask the end user what optional components they want to install, what directory to put the files in, and so on. This section generally uses a Wizard Loop action. It displays any ReadMe or License files installed in the Initialization section.
File Copy This is the longest section of the installation script. Files are copied from the installer .EXE to the destination computer.
System Configuration After files have been installed, the destination computer’s configuration files (.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.
About Components When an end user selects to install one or more optional components, a letter corresponding to each component is placed in a variable called COMPONENTS. Selecting the first component places an A in the variable, the second adds a B, and so forth. Up to 26 components can be added. The wizard dialogs created by Installation Expert take care of placing the correct values in the COMPONENTS variable. You can also use the Select Components script action or a custom dialog to accomplish the same result. In the installation script, use conditional statements of the form “If COMPONENTS contains ‘A’” to determine which files are installed when each component is selected. Setup Editor scans the script looking for these conditionals to determine how much disk space is required by each optional component. You must use the variable COMPONENTS and the proper conditional format for this feature to work. For an example of a
81
Basic Scripting Concepts
components-based installation script, see Letting the End User Select Components and Subcomponents on page 182.
82
Chapter 5
WiseScript Actions The Wise scripting language, WiseScript, 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. For information on how to insert actions or create user-defined actions, see Setup Editor on page 62. See: Add Directory to PATH Add ProgMan Icons Add Text to INSTALL.LOG Add to AUTOEXEC.BAT Add to CONFIG.SYS Add to SYSTEM.INI Allow Floppy Disk Change Browse for Directory Call DLL Function Check Configuration Check Disk Space Check HTTP Connection Check If File/Dir Exists Check In-use File Check Service Compiler Variable If/Else/End Config ODBC Data Source Copy Local File(s) Create Directory Create Service Create Shortcut Custom Billboard Custom Dialog Delete File(s) Display Billboard Display Message Display Progress Message
Display Text File Edit INI File Edit Registry Else Statement ElseIf Statement End Statement Evaluate Windows Installer Condition Execute Program Exit Installation Find File in Path Get Environment Variable Get Name/Serial Number Get ProgMan Group Get Registry Key Value Get System Information Get Temporary Filename Get Windows Installer Property Halt Compilation If Statement Include Script Insert Line Into Text File Install File(s) Install ODBC Driver Modify Component Size
Open/Close Install.log Parse String Pause Play Multimedia File Post to HTTP Server Prompt for Filename Prompt for Text Radio Button Dialog Read INI Value Read/Update Text File Read/Write Binary File Reboot System Register Font Remark Rename File/Directory Search for File Select Components Self-Register OCXs/DLLs Set Control Attributes Set Control Text Set Current Control Set File Attributes Set Files/Buffers Set Variable Set Windows Installer Property Start/Stop Service While Statement Win32 System Directory Wizard Loop
WiseScript Editor and Wise Installation System Script Actions WiseScript Editor does not support the following Wise Installation System script actions: Add BDE Alias
83
Configure BDE Install DirectX Install WinCE Component Install WiseUpdate Client To edit a script that contains any of these script actions, use the Wise Installation System.
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 reboots at the end of installation so that the new PATH takes effect. !
Directory to Add to PATH Enter the directory to be added to PATH (example: enter %MAINDIR%).
!
Location of New Directory Select to add to the beginning or end of the PATH.
!
Path Selection Some destination computers have several PATH variables. Use this list to add the directory to all PATH variables.
Add ProgMan Icons This action adds and deletes icons and deletes groups in Windows Program Manager desktop (Windows 3.1, Windows NT 3.51) or any DDE-compatible Program Manager replacement. To create shortcuts on Windows later operating systems, use the Create Shortcut action instead of this action. We recommend that, for portability, you use variables to specify file names and paths. !
Action Select an action below. •
Add Icon. Specify all the fields below, except Icon PathName and Icon Number.
•
Delete Icon. Specify only Group Name and Icon Name.
•
Delete Group. Specify only Group Name.
Note Always place deletions before additions in the script. If you delete an icon from a nonexistent group, Program Manager might remove an icon with the same name from the last-added group, if it exists. Deleting icons and groups first eliminates this problem. !
Group Name You can prompt the user for this name and store the result in a variable. If you added a default folder name on the Shortcuts page in Installation Expert, its name is stored in %GROUP% in the standard script.
!
Icon Name
!
Command Line Specify the command line to be applied to the icon’s target file.
!
Icon PathName Specify a pathname to a file where the icon is stored.
84
!
Default Directory Specify the default directory that should be set when launching the target file, if different from the target file’s location.
!
Icon Number Enter the resource number of the icon (from the pathname specified above).
!
Run Minimized Mark this to cause the application to start in a minimized state.
!
Separate Space Mark this to cause a Win16 .EXE to run in its own address space under Windows NT 3.51. If you mark this checkbox, use a Check Configuration action to make sure this action only runs on Windows NT 3.51. Leave this unmarked if this action will run on Windows 3.1.
!
Personal Group Mark this to cause the icon to be added to a personal Program Manager group.
Add Text to INSTALL.LOG This action adds commands to the installation log. As the installation runs on the destination computer, each action it performs is logged in Install.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. To stop and start writing to Install.log, see Open/Close Install.log on page 119. Specify the location of Install.log on the Installation Log page in Installation Expert. By default, it is created in the application directory (MAINDIR). In the Add Text to Install.log dialog, enter the text to add to Install.log. Because the log is written continuously during installation, the location of the text in the log depends on where in the script you put the Add Text to Install.log script line. !
Log 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: Note Also specify uninstall actions in Installation Expert > Uninstall page.
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
85
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 Solutions RegDB Root: 2 where RegDB Root is one of the following: 0 1 2 3
-
HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS
Add to AUTOEXEC.BAT This action edits Autoexec.bat, which is executed during boot, 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. !
Text to Insert Enter the line to add to Autoexec.bat. If the line refers to an application file, use a pathname (example: %MAINDIR%\Application\Application.exe). The PATH variable might not be set when the command is executed, so always use a pathname.
!
Line Number Enter the line number at which the new line should be inserted. Enter 0 (zero) to append the command to the end of the file. The Search for Existing Text area in this dialog 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.
!
Search 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.
!
Comment Text Enter text to insert at the beginning of the line that is found. Insert “REM ” (with the trailing space but without the quotation marks) to comment out the line, which lets you replace an existing command with a new 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.
!
Insert Action Select where to insert the new line in relation to the found line.
!
Match Criteria Select how the found line matches the Search for Text.
!
Ignore White Space Mark this to ignore spaces and tab characters.
86
!
Case Sensitive Mark this to match case.
!
Make 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 destination computer is restarted automatically to force the new commands to take effect. !
Text to Insert Enter the line to add to Config.sys. If the line refers to a file, use a pathname. Example: %SYS%\Application.DLL. %SYS% refers to the active system folder.
!
Line Number Enter the line number at which the new line should be inserted. Enter 0 (zero) to append the command to the end of the file. The Search for Existing Text area in this dialog 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.
!
Search 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.
!
Comment Text Enter text to insert at the beginning of the line that is found. Insert “REM ” (with the trailing space but without the quotation marks) to comment out the line, which lets you replace an existing command with a new 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.
!
Insert Action Select where to insert the new line in relation to the found line.
!
Match Criteria Select how the found line matches the Search for Text.
!
Ignore White Space Mark this to ignore spaces and tab characters.
!
Case Sensitive Mark this to match case.
!
Make 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 105.
87
!
Device Name Enter the full command line for the device (example: device=vshare.386). The referenced files need a pathname 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 device entry with the same device name but a different driver pathname, the old entry is commented out and the new entry is added.
Allow Floppy Disk Change This action closes all files in use by the installation, which lets the end user change floppy disks. Windows does not allow floppy disk changes when files are open. (Example: Use this script action to run an .EXE located on another disk.) Because builtin code handles floppy disk changes for the next installation disk, use this action only for special circumstances. Because this action requires no configuration, no dialog appears when you add it.
Browse for Directory This action displays a dialog asking the end user to select a directory. It is included to provide backward compatibility for older WiseScripts. In new scripts, use custom dialogs instead. !
Window Name Enter the title for the dialog.
!
Description Enter text to explain the dialog to the end user.
!
Prompt Name Enter explanatory text to be displayed above the directory field.
!
Default Value Enter the default location of the new directory. This appears as a default in the directory field.
!
Variable Name Enter a variable to store the chosen directory. The standard script uses the variable MAINDIR for this purpose.
!
Don’t Append Mark this to prevent the default directory (Default Value field) from being appended to the chosen directory.
!
Confirm If Exists Mark this to warn the end user if the chosen directory already exists.
Call DLL Function This action calls a .DLL function from a .DLL on the destination computer. They can be be .DLLs you’ve 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. !
DLL Pathname Specify the pathname 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%.
88
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. !
Function Name Enter the name of the function to call. The function should be exported when creating the .DLL. The function’s parameters and return value must exactly match those specified below (case-sensitive).
!
Call a function written specifically for WiseScript When calling functions developed specifically for WiseScript, mark this option and fill in Variables Added, Parameter String, and Action below. Each .DLL function takes a single parameter (lpDllParams) that points to a structure containing information that can be passed back and forth between the .DLL function and the running installation script. The Prompt.wse sample script contains an example of this.
!
Variables 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 %.
!
Parameter 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.
!
Action 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.
!
Perform 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 checkbox is cleared, the loop is executed if the condition is true, but is not executed if the condition is false.
!
Call 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.
!
Return Value Type Select the data type of the return value, which are described in DLL Parameter Settings.
89
!
Returned Variable Select or enter a variable to store the returned value.
!
Hide 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. To help with .DLL development, review sample source code, such as GETCPU32.C, in the WiseScript Editor\DLL directory. Also included is sample source code for C and Delphi .DLLs written for WiseScript. Calling Visual Basic ActiveX controls is not supported. To read about scripts that use this action, see Sample Scripts That Call .DLLs on page 184.
DLL Parameter Settings The DLL Parameter Settings dialog 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. !
Parameter Type Check the table below for alternate names for data types.
WiseScript
Corresponds to Win32 SDK type
Corresponds to Visual Basic type
Description
short
SHORT
Integer
16-bit, signed integer data type
word
WORD
Integer
16-bit, unsigned integer data type
long
LONG, LRESULT, BOOL
Long, Boolean
32-bit, signed integer data type
dword
DWORD (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.)
Long
32-bit, unsigned integer data type
string pointer
Use for any parameter that ends in STR such as LPSTR and LPTSTR.
Long
32-bit pointer to an ANSI character type null terminated string
short pointer
Pointer to SHORT or SHORT* (use for PSHORT or LPSHORT)
Long
32-bit pointer to a SHORT data type (see SHORT for the reference to this data type)
word pointer
Pointer to WORD or WORD* (use for PWORD or LPWORD)
Long
32-bit pointer to a WORD data type (see WORD for the reference to this data type)
long pointer
Pointer to LONG or LONG* (use for PLONG or LPLONG)
Long
32-bit pointer to a LONG data type (see LONG for the reference to this data type)
90
WiseScript
Corresponds to Win32 SDK type
Corresponds to Visual Basic type
Description
dword pointer
Pointer to DWORD or DWORD* (use for LPDWORD or PDWORD)
Long
32-bit pointer to a DWORD data type (see DWORD for the reference to this data type)
string buffer
char [size]
String
Use to place a character buffer of the given size (number of characters) into a structure. Use only with structures.
Note If you are using the Win16 SDK, use word instead of dword for parameters that start with H or end with HANDLE. !
Buffer 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.
!
Passing 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 inside it. See Passing Complex Structures to a .DLL: An Example.
!
Value Source Select the type of value to be passed: Variable (pass by reference), constant (pass by value), constant with null value, or constant with window handle (pointing to the installation window).
!
Variable Name If Value Source is set to Variable, select or enter a variable.
!
Constant Value If Value Source is set to Constant, enter a constant here. You can enter a variable here (example: %NUMUSERS%). Note WiseScript Editor maintains backward compatibility with .DLLs written specifically for the API available in previous versions so that you can continue to use older scripts with the new WiseScript Editor. However, future versions of WiseScript Editor might not support this API, and it is therefore not documented here. For new installations, write standard .DLLs and specify their parameters as explained above. Compile both 16-bit and 32-bit functions using the large memory model, or explicitly declare all pointers to the structure as far. WiseScript reserves 5KB of stack space for 16bit .DLL functions you call, and 100KB of stack space for 32-bit .DLL functions you call. You must free any memory allocated by your .DLL routines.
Passing Complex Structures to a .DLL: An Example In addition to passing simple parameters, such as integers and strings, to a .DLL, you can also pass complex structures (sometimes called records in Pascal or Visual Basic).
91
For each parameter, you select a passing type. For non-structure parameters, select Normal from Passing Type in the DLL Parameter Settings dialog. 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 3 parameters: a structure that contains 3 elements, an integer, and another structure that contains 2 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 6 parameters in the Call DLL Function dialog: the 3 elements of the first structure, the integer, and the 2 elements of the second structure. To add parameters, see DLL Parameter Settings on page 90.
Parameter type in Wise
Passing Type in Wise
name (first element of EMPLOYEE structure)
string pointer
First element of a structure
salary (second element of EMPLOYEE structure)
long
Contained within structure
title (third element of EMPLOYEE structure)
string buffer (buffer length of 50)
Contained within structure
int
long
Normal
deptname (first element of DEPARTMENT structure)
string pointer
First element of a structure
deptnum (second element of DEPARTMENT structure)
string pointer
Contained within structure
Parameter in the C function
92
Check Configuration This action tests the hardware configuration, operating system, 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. !
If System Use the drop-down lists to build a statement of what to check for. 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 2000, this action returns TRUE if Windows 2000 or Windows XP is running.
!
Action Occurs when the statement above is true. All options below display the message described in Title and Message Text below, unless Message Text is blank. • Display Message Only. • Abort Installation. • Start Block Begins a conditional block. All actions between this action and the next Else or End action are executed.
!
Title Enter the title for the dialog.
!
Message Text Appears in the body of the message dialog. Leave this blank to prevent a message from appearing.
93
Note Checking for “Share Loaded” opens a temporary file and attempts to lock a section of it. It detects all versions of DOS SHARE, Windows VSHARE, Windows NT/2000/XP, and Windows 95/98. Checking for “VGA or better” graphics makes sure display resolution is at least 640x480. Checking for free memory tests the amount of memory (including virtual memory) available at installation time.
To read about scripts that use this action, see Sample Scripts That Check System Configuration on page 184.
Check Disk Space This action determines if there is enough disk space available for installation, based on files that are always installed as well as optional components the end user selects to install. If you add components on the Components page, the Files page in Installation Expert shows an Always Installed folder and other component folders. If the installation contains no optional components, 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. !
Component 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 or the Select Components custom dialog.
!
Status Variable Select or enter the variable to store the result of the disk space check. If there is not enough disk space, an error message is displayed, and the end user can halt installation, ignore the error, or retry the disk space check. Status Variable is set to R if the end user chooses to retry, which lets you define what retrying means. (Example: Let the end user select a different directory or different components.) If no status variable is selected, clicking Retry simply executes the test again.
!
Reserve Space You can specify required disk space for up to 3 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 119.
!
Do not cancel during silent installation Mark this to continue installing if the disk space check fails during a silent installation. A message is written to the Install.log. Otherwise, if the disk space check fails, the installation is halted with no message to the end user.
To read about a script that uses this action, see Sample Scripts That Check System Configuration on page 184.
Check HTTP Connection This action determines whether a given URL is valid by using WinSock.dll to attempt to download the HTML page.
94
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 return codes and error strings come from the APIs that attempt the download. A sample of the return string is: ProxyServer= ProxyIgnore= ProxyPort=80 ProxyType=CERN WinInetText= WinInetError=0 WinSockError=11001 This indicates that no proxy server was used and that WinSock returned the error code 11001. Note If the Web server redirects invalid URLs to another internal Web page, no error is detected by this action.
In the Check HTTP Connection dialog, specify the URL to check, then select or enter variables to store returned error numbers and error text. !
URL to Check Include “http://” in the URL.
!
Win32 Error Text Variable Select or enter a variable to store the error text returned by the 32-bit winsock.dll.
!
Win32 Error Number Variable Select or enter a variable to store the error code returned by the 32-bit winsock.dll.
!
Win16 Error Text Variable Select or enter a variable to store the error text returned by the 16-bit winsock.dll.
!
Win16 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. !
If Select a test. To check if a .DLL is loaded, select Module loaded in memory.
!
Pathname
!
•
To check a file or directory, enter its pathname. Wildcard characters, such as *, are not valid. Use variables (example: %WIN%) rather than hardcoding a path.
•
To check if a .DLL is loaded, enter just the .DLL name, not a pathname.
Title Enter the title for the dialog.
95
!
Message Text Appears in the body of the message dialog. Leave this blank to prevent the message from appearing.
!
Action 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.
!
Perform loop at least once If you chose Start While Loop, mark this to force the loop to execute once before the test is performed. If the checkbox is cleared, the loop is executed if the condition is true, but is not executed if the condition is false.
To read about a script that uses this action, see Prompting the End User to Insert a Floppy Disk on page 177.
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. !
Variable 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, or Non-Existent (which means the file could not be found).
!
Pathname Enter the pathname of the file to check. You can use variables to build the pathname.
Check Service This action checks if a particular service is running. You can check services on Windows 3.51, NT 4.0, 2000, and XP. On other operating systems this action always returns a result of Unknown. !
Variable Select or enter a variable in which to put the status of the service. Possible return results are: Unknown, Running, Stopped, Paused, StartPending, StopPending, ContinuePending, or PausePending. Unknown means the service was not found or the current user does not have privileges to query the service. If the status ends with the word Pending, the service has received a request, but is still processing the request.
!
Service 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.
96
Compiler Variable If/Else/End Compiler Variable If, Else, and End statements let you to compile different versions of the installation program. Compiler variables are set at compile time, and Compiler Variable If, Else, and End statements determine which parts of the script are included based on a compiler variable value. You create compiler variables on the Compiler Variables page in Installation Expert. The value of the compiler variable can be set by: the default value you enter when creating the compiler variable, a dialog that prompts you at compile time for the value, or on the command line. With Compiler Variable If, Else, and End statements, the statements inside an If block are added to the script according to the value of the compiler variable. Example: On the Compiler Variable page, create a compiler variable named _DEBUG_, set to “N” by default, and make sure the Compiling From Within Wise option is marked. Then in the installation script, add a Compiler Variable If statement that checks if _DEBUG_ equals “Y”. In the If block, add a Display Message action that contains useful debug information, such as the value of a variable. End the If block with a Compiler Variable End statement. When you compile, you are prompted for the value of this compiler variable. If you change it to “Y”, then the Display Message action within the Compiler Variable If block is added to the final script. Complete the Compiler Variable If Settings dialog: !
If Variable Build an If statement by selecting a compiler variable and a comparison. The first list shows compiler variables on the Compiler Variables page in Installation Expert. The second list shows available comparisons. If you select File Exists from the second list, the If statement checks to see if the file that you enter in The Value exists. If you select File Version Equal or Greater, specify the file in The Value.
!
The Value (Case-sensitive) The value for the comparison operation. Do not use variables in this field, because it is checking on your computer in real time, not runtime.
You can add a Compiler Variable Else action, and you must include a Compiler Variable End action. To read about a script that uses this action, see Sample Scripts That Perform Tasks on page 177. Also see: Compiler Variables on page 30 Compiler Variables vs. Runtime Variables on page 80 Building a Debug Version on page 76
Config ODBC Data Source This action configures an ODBC data source for use with an existing ODBC (Open Database Connectivity) driver. !
Data 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.
!
Driver 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.
97
!
Install Data Source for Select Win16 or Win32 APIs.
!
Data Source Attributes Either enter attributes, or use the Import button to import them from an ODBC data source installed on your computer.
!
Display Configuration Dialogs Mark this to display standard data source configuration dialogs to the end user. Otherwise, the data source is configured with default settings.
!
System DSN Mark this checkbox 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. It can also copy files from an FTP or HTTP server. !
Source Specify the pathname 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:\MyPictures\*.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.
Note Wildcards cannot be used if you are copying from an FTP or HTTP server. !
Destination 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 full directory path. To copy files to the installation directory, start this path with %MAINDIR%.
!
Description Enter text to display in the progress bar during file copy.
!
Local Path A hard-coded path that specifies the location of the files on your computer at compile time. Specify this for the installation progress bar to update correctly based on file size. See the description of the Source field above.
!
Require Password If you entered a password in Installation Expert > Password page, and you mark this, the end user is prompted for the password before this file is installed.
98
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. !
Include Sub-Directories If you specify a directory in Source, mark this to include all subdirectories and their contents.
!
Shared 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.
!
No Progress Bar Mark this to hide the progress bar while this file is being copied.
!
Self-Register OCX/DLL/EXE/TLB All .OCXs and .TLBs and some .DLLs and .EXEs support self-registration. Mark this so the file registers itself in the Windows registry before it is used. This action does not register the 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 127.
!
Don’t Convert to Floppy If Convert CD-ROM to Floppy is marked in Installation Expert > Build Settings page, mark this to override that option for this file.
!
Replace Existing File Select when to replace existing files on the destination computer. • Always The new file always replaces the old file. • Never The file never overwrites an existing file. Select this for files that should be installed if they are not present, but 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. "
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 Date/Time, 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 Date/Time, this replaces the existing file if its modification date and time are older than the new file.
!
Retain Duplicates in Path By default, version checking removes existing copies of .DLLs that are found in the path list. To suppress this feature, mark this checkbox.
99
To read about a sample script that uses this action, see Downloading a File From a Web Site During Installation on page 183.
Create Directory Directories are created when files are installed to them. Use this action only to create an empty directory on the destination computer. !
Pathname Enter the directory path to create. Start the path with a variable (example: %MAINDIR%).
Create Service This action installs a Windows service on operating systems where they are supported. !
Service Name Enter the internal service name, which is used in the registry.
!
Display Name Enter the name to appear in the Services control panel.
!
Executable Path Specify the complete path to the executable file as it will be on the destination computer. Start the path with a variable (example: %MAINDIR%).
!
Login Username, Login Password Enter the user name and password under which the service should run.
!
Error Control Specify what happens if an error occurs while the service starts. • 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 booting the last known good configuration, boot continues. Otherwise, it reboots to the last known good configuration. • Critical Error Logs the error if possible. If the computer is booting the last known good configuration, boot fails. Otherwise, it reboots to the last known good configuration.
!
Group 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.
!
Dependencies 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.
!
Service Type Select a service type.
100
!
Start Service Select the default setting for starting the service.
!
Service 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%). !
Source 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.
!
Destination 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%.
!
Command Options (Optional) If the shortcut is for an .EXE, enter command line options.
!
Default Directory Specify the default directory that should be set when launching the target file, if different from the target file’s location. In Windows Explorer, this field is referred to as the Start in directory.
!
Description Enter text to appear in the Comment field of the shortcut’s properties dialog.
!
Icon Pathname (Optional) Specify the file that contains the icon to be used for the shortcut. Otherwise, the target file’s icon is used.
!
Window Size Select window appearance.
!
Icon Number Enter the number of the icon to use from the file specified in Icon Pathname above.
!
Shift State, Hot Key Letter These fields together populate the Shortcut Key field in the shortcut’s Properties dialog in Windows Explorer. For details, see Windows help.
!
Support OSD software update checking Open Software Description (OSD) is a Microsoft technology for describing and distributing software. Mark this for the shortcut to work with OSD.
!
Check self-repair items when this shortcut is opened Mark this to turn on self-repair functionality for this shortcut if you have configured the installation for self-repair. See Configuring an Application for Automatic SelfRepair on page 20. Typically, use this for a shortcut that launches the application.
101
Custom Billboard This action opens the Custom Billboard Editor, which lets you create scalable images to display to end users during installation. For details, see Creating Custom Billboards on page 162.
Custom Dialog Use this action to create your own dialog or dialog set. For details, see Creating Custom Dialogs on page 134. To add a new dialog within a wizard loop, see Adding a Dialog to the Installation on page 135. To read about scripts that use this action, see Sample Scripts That Use Complex Dialogs on page 179. For details on the dialog Properties dialog, see Setting Dialog Properties on page 137.
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 get deleted automatically. !
Pathname Specify the file or files to delete (examples: %TEMP%\Application.dll or %MAINDIR%\*.htm). You cannot perform wildcard deletions in the Windows, System, or root directories. Clicking Browse shows only files in the current WiseScript that are installed into the %MAINDIR%, %SYS32%, %SYS%, OR %FONTS% directories.
!
Include Sub-Directories If you entered the pathname to a directory or used a wildcard, mark this to delete matching files in all subdirectories as well.
!
Remove Directory Containing Files If this is marked, and if the deletion leaves the directory empty, then the directory is deleted also.
Display Billboard This action displays a bitmap or .GRF file during installation if you have the background set to display a gradient (in Installation Expert > Screen page). Create .GRF files (scalable bitmaps) with the Custom Billboard Editor. See Creating Custom Billboards on page 162. You can use up to 16 Display Billboard actions in the script. !
Pathname Specify the full pathname to the image file on your computer. To use variables in this field, you must mark the Local Graphic option below.
!
X-Position, Y-Position Indicate the location on a 640 x 480 screen to place images. On larger screens, the billboard is placed proportionately based on the 640 x 480 location.
!
Erase Num Enter how many previously displayed graphics are erased before this image is displayed. To display 1 image at a time, set this to 1. To display all images simultaneously, set this to 0. The oldest image is removed first.
!
Build Effect Select a transition effect.
102
!
Transparent Mark this to have pure blue (R=0, G=0, B=255) parts of the image become transparent.
!
Center Horizontal
!
Place at Right
!
Scale to Screen Mark this for the image to cover the same percentage of the screen regardless of screen size.
!
Hide Progress Bar Mark this to hide the progress bar during image display.
!
Center Vertical
!
Place at Bottom
!
Tile Background Mark this checkbox to repeat the graphic edge-to-edge to fill the entire screen.
!
Erase All Mark this checkbox to remove all previous graphics from the screen before displaying the new one.
!
Timed Display Mark this checkbox 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.
!
Local Graphic Normally, you specify image 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.
To read about a script that uses this action, see Creating an Installer That Can Be Customized During Compile on page 177.
Display Message This action displays a message dialog and can optionally branch the script based on the end user response. Without the branching option, this dialog has an OK button, which continues, and a Cancel button, which halts installation. !
Message Title Enter the title for the dialog.
!
Message Text This is displayed in the dialog. Press Ctrl+Enter to add line breaks in the displayed text. You can use variables in this text.
!
Message Icon Select an icon for the dialog.
!
Start 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 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.
103
!
No 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. See Building a Debug Version on page 76 for more information.
To read about a script that uses this action, see Checking Disk Space by Calling a Windows .DLL on page 184.
Display Progress Message This action displays a small dialog during installation, typically to indicate the computer is still working during a long operation. The dialog cannot be closed or cancelled. Also use this action to remove a previous progress dialog. !
Remove previous progress message(s) Mark this to remove the previous progress dialog from the screen. Marking this disables the rest of this dialog. To display another progress message, add another Display Progress Message action.
!
Display a new progress message • Message Title Enter the title for the dialog. • Message Text Enter text to display in the dialog. You can use variables in this text. • X-Position, Y-Position In pixels, enter the location of the upper left corner of the dialog. • Height, Width In pixels, enter the dimensions of the dialog. • Center Horizontally Mark this checkbox to override the X-Position field. • Center Vertically Mark this checkbox to override the Y-Position field.
Display Text File This action displays a 30K or smaller text file in a dialog. It is included to provide backward compatibility for older WiseScripts. In new scripts, to display the ReadMe file, use the ReadMe dialog on the Dialogs page in Installation Expert. !
File Pathname Specify a file on the destination computer (examples: %MAINDIR%\Readme.txt, %TEMP%\%TEMPFILENAME%).
!
Window Title Enter the title for the dialog.
!
Description Enter text to explain the dialog to the end user.
104
Edit INI File This action edits an .INI file on the destination computer. To edit SYSTEM.INI, use the Add to SYSTEM.INI action instead. !
File Enter the .INI file pathname, or select a path from the list and edit it.
!
INI 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:
•
To delete a name-value pair, type the name with an equals sign followed by nothing. Example:
[SECTIONNAME]
Color= •
Comments (lines starting with ;) are not supported.
Edit Registry This action adds, edits, or deletes registry keys or values. Create registry entries manually or import a registry file (.REG). To copy registry settings from your computer’s registry, use Installation Expert > Registry page instead. !
Registry Keys This field shows root registry keys and the keys added by this action. Select a root before adding or importing a key.
!
Value Names This field shows values being added or changed that reside under the key selected on the left.
!
New 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 appears, where you enter information about the new key. See Registry Key Settings Dialog on page 106. 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.
!
Delete 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.
!
New Value To add a new value, select the parent key in Registry Keys, then click the New Value button. A dialog appears, where you enter information about the new value.
105
!
Delete 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.
!
Data Settings These fields in this section of the dialog correspond to fields you set when creating the value. See Registry Key Settings Dialog on page 106.
To read about a script that uses this action, see Running a Program Once After Computer Restart on page 178.
Registry Key Settings Dialog This dialog appears when you double-click the Edit Registry action and create or edit a registry key on the Edit Registry Settings dialog. This dialog also appears when you create or edit registry entries on the Registry page in Installation Expert. !
Operation 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.
!
Root Select the parent key in which the new key is added.
!
Key Enter the name of the new key. You can create multiple hierarchical keys at once by separating them with backslashes, as in directory pathnames. (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.
!
Value Name Enter the name of a new named value.
!
Data 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.
!
Data 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.
106
• 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 NT4/2000/XP 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 NT4/2000/XP 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. This is only supported for installations on Windows NT4/2000/XP. • 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. !
Repair application if this registry value is missing Self-repair prevents an application from failing if this registry value has accidentally been deleted. Mark this checkbox to initiate self-repair if this registry value is missing during application launch. The end user must have access to the installation media to perform a repair, and you must also configure a shortcut to the application with selfrepair turned on. For information on how to set up self-repair, see Configuring an Application for Automatic Self-Repair on page 20.
!
Append 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 checkbox. This option is disabled unless Multiple Strings is selected in the Data Type drop-down list.
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 Action list inserts it directly into the script with no further dialogs or prompts.
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.
107
!
If Variable Build an If statement 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 79. The variable is ignored and can be left blank. The result is considered true if it evaluates to a nonzero result. Valid Password and Invalid Password evaluate according to the password entered on the Passwords page in Installation Expert.
!
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.
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 dialogs or prompts.
Evaluate Windows Installer Condition This action evaluates a condition in the currently-running 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. !
Dest. 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.
!
Condition Enter a condition to evaluate. This can be any condition that can be evaluated in Windows Installer. You can either enter the literal condition or use WiseScript variables enclosed in percent signs.
Also see: Get Windows Installer Property on page 114 Set Windows Installer Property on page 130
Execute Program This action runs another .EXE. The .EXE can be a file already installed on the destination computer, a file you installed as part of the installation, or a file you provide on a separate disk. If the .EXE you plan to execute is coded to pass back a return value, 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 checkbox. !
.EXE Path Specify the full pathname to the .EXE to be executed (example: %MAINDIR%\Application.exe).
108
!
Command Line Enter the command line options for the .EXE you are calling, as if you were typing them in the Run dialog.
!
Default Directory Specify the directory that should be current when the .EXE file is executed. The installation does the equivalent of a Change Directory command (cd) before launching the .EXE. Click Browse and select a directory from your installation. You can select from directories that you created on the Files page in Installation Expert.
!
Variables Added List any variables created in the .EXE that are not present in the calling script.
!
Window 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 silently, which means it runs minimized and its task is not shown on the task bar.
!
Wait for Program to Exit If this checkbox is marked, the installation does not continue until the .EXE has exited. Make sure you mark this checkbox if the .EXE returns a value to the script. If the installation does not wait for the .EXE to exit, add the command line parameter -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 is launched. In Windows 95, the Write.EXE application calls WordPad.EXE. If you instruct the script to wait until the application exits, call WordPad.EXE directly. Otherwise, the script continues without showing WordPad.EXE because Write.EXE exits.
To read about scripts that use this action, see Downloading a File From a Web Site During Installation on page 183 or Prompting the End User to Insert a Floppy Disk on page 177.
Exit Installation This action calls the Exit script and exits the installation. The Exit script is accessible in the Event drop-down list in Setup Editor. No message appears unless you also set the RESTART variable. See Automatic Runtime Variables on page 190. !
Application Exit Code If this installation is called by another application, this is the return code to the calling application. 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 Runtime Variables on page 192.
!
Install Status MIF This section is disabled unless you enter Status MIF information on the Microsoft SMS page in Installation Expert. • MIF Text This text is added to the Status MIF file when this action is executed. • Success/Failure A status for the installation is added to the Status MIF file.
109
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. !
File Name Enter just the file name, not a full path. Wildcard characters (*, ?) are not allowed.
!
Variable Name Enter a variable to store the path of the file if it is found. If it is not found, this variable stores the Default Value specified below.
!
Default Value This value is 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. To install a new version of the file, specify the file’s typical location here. Then, if the file is located, the location replaces the default value, but if it is not, this default value is used to install the file.
!
Description 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).
!
Search Directories Enter a semicolon-delimited list of directories to search. You can use variables in this field. If this field is blank, only directories in the PATH environment variable are searched.
!
Remove File Name Mark this to remove a file name from the end of a returned pathname, leaving only the directory name. This operation is not performed on the Default Value.
To read about a script that uses this action, see Sample Script That Searches for Files or Applications on page 178.
Get Environment Variable This action puts the value of a Windows environment variable into a WiseScript variable. !
Env. Variable Enter a Windows environment variable.
!
Variable Name Enter a variable to store the value of the environment variable.
!
Default Value (Optional) Enter the value to store in the variable if the environment variable is not found.
!
Remove File Name Mark this to remove a file name from the end of a returned pathname, 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 Execute Program action to call command.com by entering %COMMAND% in the EXE Path field. Specify the file to open in the Command Line field. Add the /c command line option to cause the command line window to close when your program finishes execution.
110
Get Name/Serial Number This action displays a dialog that requests the end user’s name, company name, and a product serial number. It provides backward compatibility with older WiseScripts. In new scripts, use the Branding / Registration dialog in Installation Expert > Dialogs page. !
Title Enter the title for the dialog.
!
Description Enter text to explain the dialog to the end user.
!
Name Prompt Enter text to appear next to the Name field.
!
Company Enter text to appear next to the Company field.
!
Serial Number Enter text to appear next to the Serial Number field.
!
Variable In the 3 Variable fields, enter the variables to store the Name, Company, and Serial Number.
!
Confirm Text (Optional) Enter text to be displayed in a separate dialog to confirm registration. If this is blank, no confirmation dialog appears.
Get ProgMan Group This action displays contents of the Programs group and lets the end user select a group. It provides backward compatibility with older WiseScripts. In new scripts, one of the pre-defined dialogs in Installation Expert > Dialogs page performs this function. !
Window Name Enter the title for the dialog.
!
Description Enter text to explain the dialog to the end user.
!
Prompt Name Enter text to explain the input field.
!
Default Value Enter the default Start menu group.
!
Variable Name Enter a variable to store the group specified by the end user.
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. !
Variable Name Select or enter a variable to store the value.
!
Default Value (Optional) Enter the value to put into the variable if the value is not found.
!
Registry Key Enter the key that contains the value to be retrieved.
111
!
Value Name Enter the value name. (If you are reading the Win16 registry, leave this field blank.)
!
Root Select the root that contains the registry key. (If you are reading the Win16 registry, leave HKEY_CLASSES_ROOT selected.)
!
Remove File Name Mark this to remove a file name from the end of a returned pathname, leaving only the directory name. This operation is not performed on the Default Value.
!
Expand Environment Variables If you read a REG_EXPAND_SZ value, mark this to have all environment variables in the registry value replaced with their actual values.
To read about a script that uses this action, see Launching a Web Page From an Installer on page 183.
Get System Information This action retrieves information about the destination computer and puts it into a variable. The Pathname field is only used when specified in the descriptions below. When it is used, you can browse to a file in the installation, or enter a path to a file using variables (example: %PROGRAM_FILES%\file.exe). You can hardcode a pathname (example: C:\Program Files\file.exe) but it is not recommended. !
Variable Name Select or enter a variable to store the retrieved value.
!
Retrieve Select information to retrieve: • Current Date/Time Military-style (24 hour) date and time. Example: 07/14/04 11:18:10 • Windows Version Example: 5.0.2195 (Windows 2000 Professional) • DOS Version Example: 6.22 • K Bytes Available Memory The amount of physical RAM. • File Date/Time Modified When the file specified in Pathname was modified. Example: 07/14/04 11:18:10 • File Version Number The version of the file 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. • Registered Company Name The company name entered when Windows was installed. This is used to pre-fill the Branding / Registration dialog. • Drive Type for Pathname The type of drive of the file or directory whose path is in Pathname: N (network), H (hard disk), C (CD-ROM), F (floppy or removable disk), R (RAM disk).
112
• First Network Drive The letter of the first network drive, followed by a colon If there 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. • 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 Pathname of the destination computer. • Installer EXE Pathname The pathname, including the file name, of the installation currently executing. • File Size (Bytes) The size of the file specified in Pathname. • Volume Serial Number The serial number of the disk drive specified in the Pathname field. • Volume Label The label of the disk drive 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 (4-digit year) Same as Current Date/Time above except a different format. Example: 07/14/ 2004 11:18:10 • File Date/Time Modified (4-digit year) Same as File Date/Time Modified above except a different format. Example: 07/14/2004 11:18:10 • Disk Free Space (KBytes) Free disk space of the drive specified in Pathname. In Pathname, enter a drive (C:\) or a pathname (%MAINDIR%\ReadMe.txt). If you enter a pathname, it returns the free space on the drive the pathname refers to. You can enter a UNC path such as \\SERVER\Apps\CAT.EXE. Windows 95/98 does not return the disk space for UNC paths. • Current Date/Time (Regional settings) Gets the date and time specified by the destination computer’s regional settings. !
Pathname Specify the full pathname of the file or directory to retrieve information from (example: %MAINDIR%\readme.txt). Use this field only for operations that retrieve information on files or directories.
To read about a script that uses this action, see AutoPlay on page 174.
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 you create using this file name are deleted when the installation
113
finishes. Example: Use this to install a .DLL that is called during installation, and is then no longer needed. !
Variable Select or enter a variable 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. !
Dest. Variable Select or enter a variable to store the value of a Windows Installer property.
!
Property Name Enter the name of the Windows Installer property in the currently running Windows Installer installation.
Also see: Set Windows Installer Property on page 130 Evaluate Windows Installer Condition on page 108
Halt Compilation This action immediately halts 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 make sure conditions are met before compiling. !
Message Text Enter the message the end user sees if the compilation is terminated.
Example: You develop a script that uses runtime files. On your own computer, you have 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. 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.
If Statement 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. !
If Variable Build an If statement 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 79. The variable is ignored and can be left blank. The result is considered true if it evaluates to a non-
114
zero result. Valid Password and Invalid Password evaluate according to the password entered on the Passwords page in Installation Expert. !
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.
To read about a script that uses this action see Sample Script That Searches for Files or Applications on page 178. For scripts that evaluation expressions within an If statement, see Performing Calculations on Integer Values on page 178 and Parsing Strings on page 179. For a script that uses nested If, Else, and End statements, see Checking an FTP Site for Newer Files on page 183.
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 them with colleagues. They typically contain just a few lines of code, such as calling an .EXE or displaying a particular dialog. 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 Setup Editor view. To determine if files are duplicated in an installation because of an include script, select Edit menu > the Duplicate Files Report. 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 2 wizard loops, 2 of every dialog, and so on. Only the script is inserted into the calling script. Any configuration in Installation Expert is ignored, including compiler variables on the Compiler Variables page. !
Pathname Specify the pathname 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 runtime, do not use a runtime variable in Pathname. You 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. Use it to edit configuration files that cannot be edited by Edit INI File, Add Device to System.ini, Add Command to Config.sys, or Add Command to Autoexec.bat. You can insert a new line at a particular line number, or you can search for text and insert a new line before, after, or in place of the line 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.
115
!
File to Edit Specify the pathname of the text file to edit (example: %SYS32%\file.txt).
!
Text to Insert Enter the line to add to the file. If the line refers to a directory or file, start the path with a variable (example: %MAINDIR%\application.exe).
!
Line Number Enter the line number at which to insert the new line. Enter zero to append to the end of the file. The Search for Existing Text area overrides any line number specified here unless the text is not found.
!
Search for Text Enter the text to search for. If more than one line in the file matches, only the first is edited.
!
Comment Text Enter text to insert at the beginning of the found line. When replacing an existing line, use Comment Text to leave the existing line in place but inactive. Set Insert Action to insert before the existing line so subsequent installations find and edit the active command, not the commented line.
!
Insert Action Select the action to be taken when a line is found.
!
Match Criteria Select how the line is matched with text in Search for Text.
!
Ignore White Space Mark this to ignore spaces and tab characters.
!
Case Sensitive Mark this to make the match case-sensitive.
!
Make Backup File Mark this to make a copy of the file before editing it. The backup has the same file name except with a number appended to the end.
To read about a script that uses this action, see Creating a Connection Between a Database Client and Oracle Server on page 177 or Manipulating a Text File on page 177.
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. It easiest to use Installation Expert to add most files, and to use Setup Editor to add or edit a few Install File(s) lines. 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 94. The results from an Install File(s) action are put into a variable, INSTALL_RESULT. See its description in Automatic Runtime Variables on page 190. !
Source Pathname Specify the pathname 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 runtime variables, because this field is used at compile time.
116
!
Destination Pathname Specify the pathname the file will have on the destination computer. Use variables to start the pathname (example: %MAINDIR%\Dev\file.txt). This field has a drop-down list with common variables. Do not include wildcards in this field.
!
Description Enter text to appear in the progress bar while this file is installed.
!
Require Password If you entered a password in Installation Expert > 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.
!
Include Sub-Directories If you specify a directory in Source Pathname, mark this to include all subdirectories and their contents.
!
Shared 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.
!
No 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.
!
Self-Register OCX/DLL/EXE/TLB All .OCXs and .TLBs and some .DLLs and .EXEs support self-registration. Mark this so the file registers itself in the Windows registry before it is used. This action does not register the 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 127.
!
Do Not Download With WebDeploy This checkbox is available if you click Complete support for Internet-based installation on the WebDeploy page. In an Internet-based installation, files are stored as separate files in the same directory as the installation .EXE on the Web server and are downloaded only as they are needed. Mark this checkbox to put the file in the installation .EXE rather than storing it as a separate file.
!
Repair application if this file is missing Mark this checkbox to initiate self-repair if this file is missing during application launch. This prevents your application from failing if this file is accidently deleted. For information on setting up self-repair, see Configuring an Application for Automatic Self-Repair on page 20.
!
Replace Existing File Select when to replace existing files on the destination computer. • Always The new file always replaces the old file. • Never The file never overwrites an existing file. Select this for files that should be installed if they are not present, but which might be customized by the end user and should therefore not be replaced on re-installation (example: configuration files).
117
• 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 Date/Time, 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 Date/Time, this replaces the existing file if its modification date and time are older than the new file.
!
Retain Duplicates in Path By default, version checking removes existing copies of .DLLs that are found in the path list. To suppress this feature, mark this checkbox.
!
Existing File Pathname SmartPatch creates a patch file that contains only the differences between the older installation and the new installation. If you are using Smartpatch, specify the pathname where the installation can expect to find one of the files listed in Previous File Versions. If a wildcard was used in Source Pathname, this field should contain a directory. Start the path with a variable.
!
Previous File Versions Use the Browse button to create a list of files that are older versions of the file or files being installed.
Install ODBC Driver This action configures an ODBC driver in the registry. If the destination computer is Windows NT4/2000/XP, this action adds registry settings. It also returns the directories where the ODBC Manager and ODBC Driver .DLLs should be copied but does not actually install these files. Use an Install File(s) action to install these files to the proper directories. You should be proficient with ODBC before using this action. !
Driver Name The name of the ODBC driver. This driver, along with its support files, should be installed in the directory returned in the Driver Pathname Variable. The Import button adds an ODBC driver, with all its settings, from drivers installed on your computer.
!
Manager Pathname Variable (Optional) Select or enter a variable to store the directory where the ODBC.DLL file should be installed. If you are installing multiple ODBC drivers, only the first Install ODBC Driver action needs to set this variable.
118
!
Driver Pathname Variable Select or enter a variable to store the directory where the driver files should be installed.
!
Install Drivers For Select a Win16 or Win32 installation. The Win16 ODBC installation requires the Win16 version of ODBCINST.DLL. The Win32 ODBC installation requires ODBCCP32.DLL.
!
Driver Attributes Enter attributes for the installed ODBC drivers in ENTRY=VALUE format. This is added to the ODBCINST.INI file.
Modify Component Size For files within the installation .EXE, the amount of required disk space is automatically tracked. However, if you call external .EXEs 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. !
Size (Kbytes) Enter the amount of additional disk space to reserve.
!
Dest. Path Enter the directory where the files will be installed (example: %MAINDIR%\Pictures).
Open/Close Install.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 after, or no log file is created. Select one of the following options for each Open/Close Install.log action that you add to the script. !
Resume/Start writing entries into installation log
!
Pause 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.
!
Open new installation log Mark this to create a new installation log. Then enter the complete path or just the file name of the new log to the right (examples: %MAINDIR%\Speciallog.log or Speciallog.log). If just a file name is entered, the log is written to the same directory as the first installed file. The log’s default location and name are set on the Installation Log page of Installation Expert. See Installation Log on page 42.
119
Also see Add Text to INSTALL.LOG on page 85.
Parse String This action splits a text string and places the results in 2 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 4 from left, then “ONE,” is put into the destination variable 1 and “TWO” is put into the destination variable 2. !
Source Value Enter the text to be parsed. You enter text and variables (examples: %MAINDIR% or %MAINDIR%\%PICTDIR%). To include a literal percent (%) symbol, use %%.
!
Pattern/Position Enter the character pattern or the character position at which to split. Character patterns are case-sensitive unless you mark Ignore Case. To split at a pattern, enter any number of 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.
!
Destination Variable 1,2 Select or enter variables to store the 2 strings resulting from this operation. Operation, below, determines how each variable is populated.
!
Operation Select how to split the text string.
!
Trim Spaces Mark this to remove leading and trailing spaces from both destination variables.
!
Ignore Case Mark to make pattern matching case-insensitive.
To read about scripts that use this action, see Creating a Connection Between a Database Client and Oracle Server on page 177, Launching a Web Page From an Installer on page 183, or Manipulating a Text File on page 177.
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. !
Milliseconds to pause Enter the number of milliseconds to pause the script. A millisecond is 1/1000 of a second. To pause for 1 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
120
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. !
File Type Select either .WAV or .AVI.
!
Pathname Specify the pathname 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 filename, then install the file to %TEMP%\%TEMPFILENAME%.
!
X 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.
!
Loop 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 connection. If end users might not have this capability, you can add a prompt on a dialog asking the end user if they have Internet connectivity. Then use the results from the prompt to conditionally run this action or not. !
Destination URL Enter the URL of the CGI program or ASP page that accepts posted data.
!
Text to Post The text to post should be one or more lines in the format field=data, where field is the name of the field as it is expected by the CGI program, and data is the data to be sent in that field. If a line does not appear to contain a field name followed by an equals sign, it is assumed to be a continuation of the previous line, and the data on the 2 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.
!
Error Handling Select 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.
121
Prompt for Filename This action prompts the end user to select a file using a standard Open or Save dialog. The complete pathname 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 dialogs or dialog controls to perform the same function. This action requires an End Statement, because it begins a block of statements, similar to an If Statement. !
Dialog Type Select Open File or Save As.
!
Dialog Title Enter the title for the dialog.
!
Dest. Variable Select or enter a variable to store the pathname of the file or directory the end user selects.
!
Default Extension Enter the extension to append to the file name if the end user does not enter one.
!
Filter List Enter the file types to appear in the Files of Type drop-down list in the Open or Save dialog. Use Shift+Enter to enter a carriage return in this field. Example: to show text, .JPGs and bitmaps, enter: Text Files (*.txt);*.txt; Pictures (*.jpg);*.jpg; Bitmaps (*.bmp);*.bmp
!
Allow selection of multiple files Mark this to let end users select multiple files with Ctrl or Shift.
!
Prompt if file does not exist Mark this to displays a confirmation dialog if the specified file does not exist.
!
File must exist Mark this to halt the installation until an existing file has been specified.
!
Pathname must exist Mark this to halt the installation until an existing pathname has been specified.
!
Skip write permissions test If you selected Save As for Dialog Type, and you clear this checkbox, the installation attempts to create the file that the end user specified in the Save As dialog to verify write permissions. If you mark this checkbox, the installation skips the file creation attempt.
!
Do not validate the pathname Mark this to accept any pathname without any validation.
!
Display prompt if overwriting existing file Mark this to display a message if a file selected by the end user already exists.
Prompt for Text This action displays a dialog that lets an end user enter a line of text. Optionally, you can treat the entered text as a pathname and do verification on it. It is included to provide backward compatibility for older WiseScripts. In new scripts, use custom dialogs or dialog controls to perform the same function.
122
!
Window Name Enter the title for the dialog.
!
Description Enter brief instructions here.
!
Prompt Name Enter the label to be displayed next to the text input field.
!
Default Value Enter the text to be displayed in the text input field by default.
!
Variable Name Enter a variable to store the text entered by the end user.
!
Directory Mark this to delete trailing backslashes from the text, so you can use it as a directory pathname.
!
Confirm If Exists If this checkbox is marked, and the end user enters the pathname of an existing file or directory, a dialog asks whether to overwrite.
To read about scripts that uses this action, see Performing Calculations on Integer Values on page 178 or Parsing Strings on page 179.
Radio Button Dialog This action displays a dialog with up to 10 radio buttons. It provides backward compatibility with older WiseScripts. In new scripts, use custom dialogs and dialog controls to perform the same function. !
Title Enter the title for the dialog.
!
Dest. Variable Enter a variable to store the letters corresponding to the button the end user clicks.The button clicked by the end user is returned as a letter: A for the first 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.
!
Description Enter explanatory text to be displayed above the radio buttons. Press Shift-Enter for a carriage return.
!
Component 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: Use this to obtain a pathname to a file. !
INI Pathname Specify a complete pathname to the .INI file (example: %WIN%\Wise.ini).
!
INI Section INI files have sections that are delineated by bracketed section names (example: [DIRECTORIES]). Enter the name of the section that contains the entry to be read, without brackets (example: DIRECTORIES).
!
INI Item Enter the name of the entry to read from the .INI file.
123
!
Default Value Enter the value to store in the variable below if the specified entry is not found.
!
Variable Name Enter a variable to store the value of the INI item.
!
Remove File Name Mark this to remove a file name from the end of a returned pathname, 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 be written back to the file. The loop repeats for each line of the file. This action requires an End Statement. !
Pathname Specify the full pathname of the text file to be edited on the destination computer (example: %WIN%\Wise.txt).
!
Variable Select or enter the variable to store each line of the text file (example: TEXTLINE).
!
Action 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 end of the loop, writes the contents of the variable back to the line in the text file.
!
Make Backup File Mark this to create a backup file (example: text.001, text.002, and so on) if the original text file is changed.
To read about a script that uses this action, see Manipulating a Text File on page 177.
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. Note This action does not support reading or writing non-ASCII characters (characters with codes above 127). !
File Pathname Specify the pathname of the file to be read (example: %MAINDIR%\file.exe).
!
Variable Name Select or enter the variable that is to be read into or written from.
!
File Offset Enter the number of bytes into the file to start writing or reading. Bytes are numbered starting with zero.
124
!
Max. 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.
!
Transfer Direction Select whether to write to or read from the file.
!
Null Terminated If this checkbox is marked, a zero byte is written to the binary file after the string.
Reboot System This action reboots the destination computer. !
Reboot Operating System On Windows 9x or 3.1, this restarts Windows at the end of installation. On Windows NT4/2000/XP, this option logs the end user out of Windows.
!
Reboot Computer System Performs a full system reboot on the destination computer at the end of installation on all operating systems, if the end user has administrator privileges. On Windows NT4/2000/XP, if the end user does not have administrator privileges, this option only logs the end user out.
Register Font This action registers a new TrueType font (.TTF file) that has been copied into the Windows font directory. !
Font File Name Specify the file name of the .TTF font file (not the pathname) to be registered. The drop-down 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.
!
Font 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. Under Windows 95 or later, the font is added to the registry.
Remark This action puts comments or blank lines in the script. Remarks are green by default. You can change the color Preferences. !
Comment Enter the comment. To insert 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. !
Old 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.
125
!
New 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. !
File Name Enter the name of the file to search for. The file name can contain wildcard characters (*, ?). If you select Directory given by File Name field in the Drives to Search field, then include the full pathname rather than just a file name.
!
Variable Name Enter a variable to store the file pathname.
!
Default 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.
!
Message Text Enter a message to display during the search operation.
!
Return Type Select whether to return only the first match, or list of all matches.
!
Drives to Search Select to search local drives, network drives, or both. You can also choose to search the directory path specified in File Name.
!
Search Depth Enter how deep into subdirectories the search should look. A depth of 1 searches only the root directory, a depth of 2 searches the root directory and any subdirectories in it, and so on. A depth of 0 searches the entire drive. Use this field cautiously when searching large network volumes. A search depth over 3 or 4 can result in a long wait. Alternatively, prompt the end user to manually locate the directory containing the file. See Browse for Directory on page 88.
!
Remove File Name Mark this to remove a file name from the end of a returned pathname, leaving only the directory name. This does not apply to the Default Value field.
To read about a script that uses this action, see Creating a Connection Between a Database Client and Oracle Server on page 177.
Select Components This action displays up to 10 checkboxes for optional installation components to end users. The checkboxes marked by the end user are returned as a series of letters: A for the first checkbox, B for the second, and so on. This action is included to provide backward compatibility for older WiseScripts. In new scripts, a wizard dialog performs the same function. !
Title Enter the title for the dialog.
126
!
Dest. Variable Enter a variable to store the letters returned from the end user choice (COMPONENTS is used in the standard script). If the script sets this variable to a series of letters before displaying the dialog, the buttons that correspond to those letters are selected by default.
!
Disk Variable (Optional) Select or enter a variable to store the pathname where your application will be installed (MAINDIR is used in the standard script). If this field is filled in, the free space on this drive is displayed on the dialog.
!
Sub-Components Enter a list of sub-components. These sub-components are incorporated in the disk space calculations if the main component is selected.
!
Description Enter explanatory text to be displayed above the radio buttons. Press Shift-Enter for a carriage return.
!
Component List Enter the choices, one on each line, pressing Enter after each.
Self-Register OCXs/DLLs Use this action to self-register all queued .OCX, .DLL, and .EXE files or to add an existing file to the queue. !
Description/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 disabled if you mark this option.
•
If you mark Queue existing file for self-registration below, specify a full pathname of the file to register.
!
Register all pending OCXs/DLLs/EXEs Mark this to register all queued .OCX, .DLL, and .EXE files. In the Install File(s) and Copy Local Files(s) actions, there is an option to queue files for self-registration. See Install File(s) on page 116 and Copy Local File(s) on page 98.
!
Queue existing file for self-registration Mark this to queue the file listed in Pathname for later self-registration.
Set Control Attributes This action shows, hides, enables, or disables a control in a dialog. To access this action: 1.
Double-click a “Custom Dialog” line in the script. The dialog appears in Custom Dialog Editor.
2.
Select View > Dialog Setup 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. Select a control. Use the Dialog Editor view (which shows the dialog) to see or change the name of controls. To name a control, right-click the control, select Control Properties, and, in the dialog that appears, enter a name in the Control Name field.
127
• Operation Select how to manipulate the control. To read about a script that uses this action, see Configuring a Dialog to Handle Mouse Events on page 179.
Set Control Text This action changes the text associated with a control in a dialog. To access this action: 1.
Double-click a “Custom Dialog” line in the script. The dialog appears in Custom Dialog Editor.
2.
Select View > Dialog Setup Editor. A smaller list of actions appears in the Actions list, including this action.
3.
Double-click Set Control Text. • Control Name This contains all controls in the current dialog. Select a control. Use the Dialog Editor view (which shows the dialog) to see or change the name of controls. To name a control, right-click the control, select Control Properties, and, in the dialog that appears, enter a name in the Control Name field. • Control Text Enter new text to associate with the control.
To read about a script that uses this action, see Configuring a Dialog to Handle Mouse Events on page 179.
Set Current Control This action sets a control to be the current control in a dialog. The current control is the one to which keyboard operations apply. Example: If the OK button is the current control, and you press the Return key, the OK button is activated. To access this action: 1.
Double-click a “Custom Dialog” line in the script. The dialog appears in Custom Dialog Editor.
2.
Select View > Dialog Setup 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. Select a control to set as current. Use the Dialog Editor view (which shows the dialog) to see or change the name of controls. To name a control, right-click the control, select Control Properties, and, in the dialog that appears, enter a name in the Control Name field.
To read about a script that uses this action, see Configuring a Dialog to Handle Mouse Events on page 179.
Set File Attributes This action sets the attributes of one file or a group of files. !
File Pathname Specify a file to change (example: %MAINDIR%\Acrobat.pdf). You can use wildcards to specify multiple files (example: %MAINDIR%\*.pdf).
128
!
Read Only / Hidden / System Mark the attributes to set.
!
Scan 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.
!
Archive Mark this to set the archive attribute, which is used by some backup programs.
Set Files/Buffers This action sets the FILES= and BUFFERS= lines in Config.sys. If either is currently lower than the minimum specified in this action, it is increased to the specified value. If either is already greater than the minimum specified in this action, it is not changed. !
Minimum 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.
!
Minimum Buffers The minimum number of buffers to be specified by BUFFERS= in Config.sys. 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. !
Variable Select or enter a variable. Variable names 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.
!
New Value Enter the new value of the variable. If you enter a variable, enclose it in % signs. The value of a variable can be up to 32K in size. The new value is also affected by the option set in Operation.
!
Operation 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 pathname to its equivalent long or short pathname if the installation runs on Windows 95 or NT. For this to work, the specified directory or file must exist. • Convert to uppercase or lowercase All alphabetical characters are converted to the case you select.
129
• Evaluate Expression The expression in New Value is evaluated according to the rules outlined in Variables and Expressions on page 79. !
Append to Existing Value Mark this to add the variable’s new value to the end of its original value instead of replacing it.
!
Remove File Name Mark this to remove a file name from the end of a returned pathname, leaving only the directory name.
!
Read Variable From Values File Mark this to read the variable from the values file 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 value is used; otherwise, its value is unchanged. It can be up to 32K in size.
To read about a script that uses this action, see Performing Calculations on Integer Values on page 178.
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. !
Property Name Enter the name of a Windows Installer property. This can be either an existing Windows Installer property, or a new property name. Entering a new property name creates the property in Windows Installer.
!
Property Value Enter the value to assign to the Windows Installer property. You can either hard-code a value or enter a WiseScript variable enclosed in percent signs.
Also see: Get Windows Installer Property on page 114 Evaluate Windows Installer Condition on page 108
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. After you attempt 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. !
Service Name Enter the name of the service. This is not necessarily the same name you see in the Services control panel, but is the services internal name. If you used the Create Service action to create the service, this is the same name you entered in the Create Service Settings dialog.
!
Operation Select to start or stop the service.
130
Example: Suppose a service must be stopped before it can be updated. Use this action to first stop the service, then update its files. Also see Create Service on page 100.
While Statement This action begins a loop. An End statement must end the loop. As long as the condition specified in the While Statement Settings dialog is true, the script lines inside the loop execute repeatedly. If the condition specified is not true, then the While loop is exited, and the next script line is executed. !
While 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 79. The variable is ignored and can be left blank. The result is considered true if it evaluates to a nonzero result. Valid Password and Invalid Password evaluate according to the password entered on the Passwords page in Installation Expert.
!
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 checkbox is cleared, the loop is executed if the condition is true, but is not executed if the condition is false.
To read about a script that uses this action, see Error Checking User Input on page 178 or Killing an Application Using Windows .DLL Calls on page 184.
Win32 System Directory This action puts the path to the operating system directory into a variable. On Windows 9x, this is %WIN%\System. On NT-based systems, this is %WIN%\System32. Alternatively, use the predefined variables %SYS% or %SYS32% to access the system directory. This action is included to provide backward compatibility for older WiseScripts. !
Variable Name Enter a variable to store the result.
Wizard Loop This action precedes dialogs that make up the majority of the installation’s end user interface. End users can move forward and backward through these dialogs. The script continues executing inside the wizard loop until the last dialog has been filled out and accepted. Installation Expert creates default Wizard Loop and Custom Dialog actions for you.You can also build them yourself, or use Setup Editor to customize the existing structure. !
Dialog Boxes Displays a list of the Custom Dialog actions inside the wizard loop structure. Select a dialog to edit its setting in the bottom part of the Wizard Loop Settings dialog.
131
!
Skip Dialog This lets you set a condition under which a dialog is skipped. You can set different Skip settings for each dialog. Example: If one dialog 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 to skip it if the DOBACKUP variable, which is set by the first dialog, 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 79. 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 entered on the Passwords page in Installation Expert. • 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.
!
Direction Variable Select or enter the variable to store the direction the Wizard is currently heading. When Next is clicked, the value N is stored in the direction variable. When Back is clicked, B is stored. If you create custom Wizard dialogs, follow this convention. By default, DIRECTION is used for this variable, which you can use in Skip Dialog conditions to set dialogs to be displayed when the direction is forward but skipped when going backward.
!
Display Variable Select or enter the variable to store the name of the dialog that is being displayed this time through the loop. This variable is used in the Dialog Set Properties dialog in Custom Dialog Editor. By default, DISPLAY is used for this variable.
!
Pathname Specify the full pathname to a bitmap file on your computer to be displayed in the wizard dialogs. Do not use variables (except compiler variables) in the pathname. The file is copied into your installation when you compile. You can turn off this graphic for selected wizard dialogs using the Dialog Box Properties dialog. See Setting Dialog Properties on page 137.
!
X-Pos, Y-Pos Determines the relative placement of the graphic in the dialog, using X and Y coordinates.
!
Do not resize bitmap Mark this to ensure the image is displayed at the same size at all resolutions. Normally, bitmaps are automatically resized based on the destination computer’s resolution. The image is displayed at actual size on a 640x480 monitor, and is enlarged if the destination computer is set to a higher resolution.
!
3D Border Mark this to add a 3-dimensional border to the image.
132
!
Bitmap Filler Color This color is displayed around the edges of the bitmap if it does not fill the image area in the dialog. When the destination computer is set to display large fonts, the dialog automatically increases in size, and the bitmap might not fill the image area.
Note The dimensions of the first Wizard dialog set the dimensions for all the dialogs in the wizard loop.
To read about a script that uses this action, see Showing or Skipping Dialogs Based on End User Input on page 181.
133
Chapter 6
Creating Custom Dialogs Use the Custom Dialog Editor to change the appearance of installation dialogs and to create new dialogs. You can also edit and create default dialog templates, add interactivity to dialogs, and work with dialog sets. Topics include: !
About the Custom Dialog Editor.
!
About Dialog Controls.
!
Solutions for Dialog Problems.
!
About Custom Dialog Sets.
!
About the Dialog Script Editor.
134
About the Custom Dialog Editor
About the Custom Dialog Editor The Custom Dialog Editor is a built-in utility.
Use it to: !
Create new dialogs. See Adding a Dialog to the Installation on page 135.
!
Edit dialogs. See Editing Dialogs on page 136.
!
Create and edit default dialog templates. See Editing Dialog Templates on page 136.
!
Set dialog properties. See Setting Dialog Properties on page 137.
!
Create a dialog set. See About Custom Dialog Sets on page 157.
!
Add interactivity to dialogs. See About the Dialog Script Editor on page 159.
Access it from: !
Installation Expert by clicking the Edit or Add button on the Dialogs page.
!
Setup Editor by double-clicking the Custom Dialog script action or a Custom Dialog script line.
!
The Edit Menu by selecting Dialog Templates, and then selecting a dialog name and clicking OK.
Adding a Dialog to the Installation Two options for adding dialogs: !
If you add a dialog from the Dialogs page, the dialog is created with the same size and shape as the other wizard dialogs, it is added to the wizard loop, and it has correctly configured Next, Back, and Cancel buttons.
!
If you add a dialog from Setup Editor, the dialog is empty, and nothing is preconfigured. You must design and configure it yourself.
Therefore, to add a dialog to the installation wizard, add the dialog from the Dialogs page. To add a dialog that’s not part of the installation wizard (and therefore doesn’t need Next and Back buttons), add it from Setup Editor.
To create a new dialog: 1.
Do one of the following: •
On the Dialogs page in Installation Expert, select a dialog name and click Add. The dialog you add is placed before the dialog that you selected.
•
In Setup Editor, double-click the Custom Dialog script action in the Actions list.
The Dialog Box Properties dialog appears. 2.
On the Dialog Box Properties dialog, enter a title for the dialog in Dialog Title and click OK. Do not give it the same name as an existing dialog. See Setting Dialog Properties on page 137. The new dialog opens in the Custom Dialog Editor.
3.
4.
Add and configure controls on the new dialog. •
See About Dialog Controls on page 138.
•
See Adding and Editing Dialog Controls on page 138.
Save the changes by selecting File menu > Save Changes and Exit.
135
About the Custom Dialog Editor
Note To use this dialog in other installation scripts, select File menu > Save As and save the dialog as a .DLG file in the \Dialogs\Template directory in the WiseScript Editor application directory. This does not affect the current installation. You can add a saved dialog to another installation by selecting File menu > Open in Custom Dialog Editor.
Editing Dialogs Whenever you edit a dialog from the Dialogs Page in Installation Expert or by doubleclicking the Custom Dialog script line in Setup Editor, you are editing the dialog for the current installation only. However, if you save the dialog and overwrite the .DLG template file, then the dialog is changed for all future installations. 1.
To open the dialog, do one of the following: •
•
Select Installation Expert > Dialogs page. "
Select the dialog and mark its corresponding checkbox.
"
Click Edit.
In Setup Editor, locate and double-click the Custom Dialog script line that calls the dialog.
The dialog opens in Custom Dialog Editor. 2.
3.
Make changes to the dialog by adding, editing, or removing controls. •
See Adding and Editing Dialog Controls on page 138.
•
See Aligning and Spacing Dialog Controls on page 152.
Save the changes by selecting File menu > Save Changes and Exit.
Editing Dialog Templates To edit dialogs so that all future installations contain the changes, edit the dialog templates. Dialog templates include other dialogs in addition to those shown on the Dialogs page of Installation Expert (example: the Insert New Disk dialog). Before you edit dialog templates, make a backup of the \Dialogs\Template directory, which is in the WiseScript Editor application directory. When you edit a dialog template and save the changes, the dialog is permanently changed. 1.
Select Edit menu > Dialog Templates. The Select Dialog to Edit dialog appears.
2.
Select the dialog to edit and click OK. The dialog opens in Custom Dialog Editor.
3.
Make changes to the dialog by adding, editing, or removing controls. •
See Adding and Editing Dialog Controls on page 138.
•
See Aligning and Spacing Dialog Controls on page 152.
136
About the Custom Dialog Editor
4.
Save the changes by selecting File menu > Save Changes and Exit. A dialog asks you to confirm your choice, because the dialog will be used in all future installations.
Setting Dialog Properties You can change the properties of a dialog including its title, default font, dimensions, and positions. 1.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Select Edit menu > Dialog Box Properties. The Dialog Box Properties dialog appears.
3.
Complete the dialog: • Dialog Title Enter the title for the dialog’s title bar. • 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 you 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 point sizes of the dialog. All dialogs in a wizard loop must have the same size as the first dialog or screen refresh problems occur. Note You can also resize the dialog 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. If you choose Default, the dialog is centered on the screen. • Do not display wizard graphic on this dialog. Mark this to turn off the wizard graphic on this dialog. The wizard graphic is set in the Wizard Loop script action, and applies to all dialogs in the wizard loop unless you mark this checkbox. 4.
Click OK.
Using the Right-Click Menu in the Dialog Editor Use the right-click menu to simplify editing in the Custom Dialog Editor. It contains the same commands that are in the Layout and Add menus and on the Control Palette.
137
About Dialog Controls
About Dialog Controls Controls are items on a dialog. Everything you see on a dialog is some type of control. Most text is comprised of static text controls, editable text is an edit text control, and graphics are placed in static graphic controls. Each item on a dialog is an individual control, with the exception of radio buttons, which are created as a group. You can add the following types of controls to dialogs: !
Text Control. Adds non-editable text. See Adding Text Controls on page 139.
!
Edit Text. Adds an editable text field, such as a field where the end user enters information. The field can show single or multiple lines. You can also use this type of control to display a text file. See Adding Edit Text Controls on page 140.
!
Push Button. Adds a clickable button. Generally you must configure buttons to perform an action, such as displaying another dialog. Buttons can also close a dialog, set script variables, and take other actions. Every dialog must contain at least one button. See Adding Push Button Controls on page 141.
!
Radio Button. Adds a radio button group. Use a radio button group when the end user can make only one selection from a group of options. See Adding Radio Button Controls on page 143.
!
Checkbox. Adds a checkbox. Use checkboxes when the end user can make multiple selections from a group of options. See Adding Checkbox Controls on page 144.
!
Combo Box. Adds a drop-down list or a multi-line list box. You can configure the drop-down list to either allow the end user to enter a non-listed option, or constrict the end user to the listed choices. See Adding Combo Box Controls on page 145.
!
List Box. Adds a scrolling list of items from which the end user can select one or more options. See Adding List Box Controls on page 146.
!
Group Box. Adds a box that encloses a group of related controls with a rectangle. See Adding Group Box Controls on page 148.
!
Graphic. Adds a non-editable bitmap graphic. See Adding Graphic Controls on page 148.
!
Hot Text. Adds hot text that you can link to actions or a Web page. See Adding Hot Text Controls on page 149.
!
Rectangle. Adds a box. See Adding Rectangle Control on page 150.
!
Play AVI. Adds a movie but no controls to play, stop, rewind, or fast forward the movie. See Adding Play AVI Control on page 151.
Adding and Editing Dialog Controls The process of adding and configuring a control on a dialog is similar for each type of control. When you add a control to a dialog, its corresponding settings dialog opens so you can configure the control’s appearance and behavior. 1. 2.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136. Select the control by doing one of the following: •
Click the control in the Control Palette.
•
Choose from the right-click menu’s Add submenu.
•
Use the Add menu on the main menu bar.
The settings dialog for the control opens. 3.
Complete the dialog. For information about the settings dialog for each control, see About Dialog Controls on page 138.
138
About Dialog Controls
4.
Click OK to add the new control to the dialog.
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 view its settings dialog. Note When you place a combo box field, 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 you run the installation.
For information about scripting dialogs to handle mouse events, see Configuring a Dialog to Handle Mouse Events on page 179.
Adding Text Controls Use text controls to display information on a dialog. Text controls are static controls, which means that the end user cannot change them. 1.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Select Add menu > Text Control. The Text Control Settings dialog appears.
3.
Complete the dialog: • Text Enter the text, up to a maximum of 511 characters. To start a new line, press Ctrl+Enter. Enter variable names surrounded by percent signs to display the application’s name or other information. See Variables and Expressions on page 79. • Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • Text Alignment Select how to align the text in the field: left, centered, or right. • Fit pathname to field width If the control displays a pathname, mark this checkbox to cause the pathname to be shortened, if necessary, to allow it to fit in the allotted space. It then places “\…\” in the pathname to indicate omitted directories. • No Wrap Mark this to not wrap the text if it is too long to display on a single line. • No Prefix Normally, the ampersand character (&) in static text indicates that the next character should be underlined and used as a shortcut to that control. If you mark this checkbox, the “&” is displayed literally and no underlining is performed. • Set Font Normally, all controls use the default font, which you set on the Dialog Box Properties dialog. Click this to override the default font for this control. If the font you choose is not available on this computer, the system font is used. • Default Font Click this to use the font specified on the Dialog Box Properties dialog. • Transparent background Mark this to make the background for this control transparent.
139
About Dialog Controls
• Calculated Value The Calculated Value section is used primarily for component installations to display the space requirements for the selected components. Example: When a component installation is run, the Select Component Dialog screen shows the Disk Space Required and the Disk Space Remaining fields. That information is provided by the following fields: "
Components This variable represents the Disk Space Required by the selected component set. Select the COMPONENTS variable, as it calculates the total space requirements for the currently-selected component set.
"
Disk This variable represents the Disk Space Remaining on the installation drive. Select the MAINDIR variable, as it keeps track of free space in the installation directory.
• X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • Width / Height Specify the exact dimensions of the control in dialog units. You can also resize controls by dragging their handles, though this is not as precise. 4.
Click OK.
Adding Edit Text Controls The 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 in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Select Add menu > Edit Text. The Edit Text Control Settings dialog appears.
3.
Complete the dialog: • Default The text you enter appears in the Edit Text control by default. To start a new line, press Ctrl+Enter and then mark Multi-line. • Variable Enter or select the name of the script variable that stores the return value of this dialog control. • Alignment Select how the text is aligned in the edit field: left-justified, centered, or rightjustified. This is enabled only when Multi-line is marked. • Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • Horiz. Scroll / Vert. Scroll Mark this to add a horizontal or vertical scroll bar to the field. • Auto HScroll / Auto VScroll Mark this to scroll the text if it extends past the right edge or bottom of the edit field. • Multi-line Mark this to allow multiple lines of text to be entered into the edit field.
140
About Dialog Controls
• Password Mark this if entered text should display as asterisks (*), providing password security. • No Hide Sel Normally, text highlighting is hidden when the dialog loses focus. Mark this checkbox to suppress the hiding of highlighting. • Want Return Mark this to let the end 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 field. • Uppercase / Lowercase Mark this 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 to enable the text box 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 pathname of a text file. The file contents are displayed in this field. This path should be relative. Use variable substitution (example: %MAINDIR% to refer to the destination directory) to begin the path. • Min. Length / Max. Length Enter the minimum or maximum allowed number of characters for text entered 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. • Confirm If Exists Mark this to prompt for confirmation if the pathname the end user entered already exists on the destination computer. Clear this checkbox if you do not want the “This directory already exists” message to appear. • X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • Width / Height Specify the exact dimensions of the control in dialog units. You can also resize controls by dragging their handles, though this is not as precise. 4.
Click OK.
Adding Push Button Controls Push buttons are simply buttons, like an OK or Cancel button. When clicked, they perform an action, such as saving the dialog data, closing the dialog, or advancing to the
141
About Dialog Controls
next dialog. Each dialog must have at least one button that allows the end user to get out of the dialog. 1.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Select Add menu > Push Button. The Push Button Control Settings dialog appears.
3.
Complete the dialog: • Label Enter the name of the push button. To create a keyboard shortcut for the button, enter an ampersand (&) immediately before a letter. For example, “< &Back” would display the label “< Back” and set the keyboard shortcut to Alt+B. • Variable Enter or select the name of the script variable that stores the return value of this dialog control. • Value Enter the value that gets assigned to the variable. This can be useful in a script when more than one button can dismiss a dialog and you need to know which one the end user clicked. • Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • Action Choose an action for the button. "
Return to Previous Dialog Displays the previously-displayed dialog in the dialog set. (Exception: The Back buttons on wizard dialogs do not use this option. They are controlled by the Wizard Loop script action.) If this is the first dialog displayed from the set, it returns to the installation script.
"
Return to Script Returns to the installation script, even if this dialog was called from another dialog in the dialog set.
"
Display Dialog Displays the selected dialog from the current set.
"
Abort Installation The end user is asked to confirm that the installation should be aborted. If the end user confirms, the installation is exited.
"
Display Help Context If the HELPFILE variable points to a valid copy of a Windows help file, the specified numeric help context is displayed.
"
Execute Program Launches another application or links to a Web page. Click Edit to specify and configure the application to be launched. See Specifying Execute Program Settings on page 152.
"
Execute Named Event Passes a named event to the dialog script. The DLG_EVENT_TYPE variable is set to the entered text. See About the Dialog Script Editor on page 159.
• X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152.
142
About Dialog Controls
• 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. • Default Button Mark this to make this the default button, that is, the one that is selected if the end user presses the Enter key. Only one button should be set to the default per dialog. • Do Not Check Fields Mark this to suppress directory confirmation and field validity checking (useful for Browse buttons). 4.
Click OK.
For information about scripting buttons to handle mouse events, see Configuring a Dialog to Handle Mouse Events on page 179.
Adding Radio Button Controls A group of radio buttons is considered a single control. The end user can select only one button from the group. Alignment and spacing between the individual buttons is maintained by the Custom Dialog Editor. 1. 2.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136. Select Add menu > Radio Button. The Radio Button Control Settings dialog appears.
3.
Complete the dialog: • Radio Button Text Enter the text options for the radio buttons, one on each line. If the end user selects the first radio button, the letter A will be put into the variable that stores the return value. If the end user selects the second radio button, the letter B is returned, and so on. • Retain Disabled If you set the radio button variable so that some of its options are disabled, those options become enabled if the end user proceeds to the next dialog and uses the Back button to backtrack (see Note below). Mark this checkbox to make disabled radio button options retain their disabled state, even if end users go backward and forward on dialogs. This checkbox causes any lowercase letters in the variable to stay in the variable, even after the end user navigates between dialogs. If this checkbox is cleared, the variable takes on the value of the option that was selected, and the lowercase information is lost. • Variable Enter or select the name of the script variable that stores the return value of this dialog control. Note If you set the variable to a string containing one or more lowercase letters, the corresponding options will be disabled in the radio button control when it displays on the dialog. Example: A radio button with four options whose variable is set to “ABcd” would have the last two options disabled.
• Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script.
143
About Dialog Controls
• X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • Width / Height Specify the exact dimensions of the control in dialog units. You can also resize controls by dragging their handles, though this is not as precise. 4.
Click OK.
For information about scripting radio buttons to handle mouse events, see Configuring a Dialog to Handle Mouse Events on page 179.
Adding Checkbox Controls Like radio buttons, a group of checkboxes is considered a single control. Unlike radio buttons, however, the end user can select multiple boxes. Alignment and spacing between the individual checkboxes is maintained by the Custom Dialog Editor. Checkboxes are often used to control the installation of components or sub-components. 1.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Select Add menu > Checkbox. The Checkbox Control Settings dialog appears.
3.
Complete the dialog: • Checkbox Text Enter the text options for the checkboxes, one on each line. If the end user selects the first checkbox, the letter A will be appended to the variable that stores the return value. If the end user selects the second checkbox, the letter B is appended, and so on. The variable stores all letters of checkboxes that are selected. For instance, if the end user picks the first, third, and fourth checkboxes, the variable is “ABD.” • Variable Enter or select the name of the script variable that stores the return value of this dialog control. Note If you set the variable to a string containing one or more lowercase letters, the corresponding options will be disabled in the checkbox control when it displays on the dialog. Example: A checkbox with four options whose variable is set to “ABcd” would have the last two options disabled.
• Sub-Components If the checkbox 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 plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152.
144
About Dialog Controls
• 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 checkboxes. Normally, you mark this checkbox only if you are selecting components and have specified the COMPONENTS variable. • Retain Disabled If you set the checkbox variable so that some of its options are disabled, those options become enabled if the end user proceeds to the next dialog and uses the Back button to backtrack. Mark this checkbox to make disabled radio button options retain their disabled state, even if end users go backward and forward on dialogs. This checkbox causes any lowercase letters in the variable to stay in the variable, even after the end user navigates between dialogs. If this checkbox is cleared, the variable takes on the value of the option that was selected, and the lowercase information is lost. 4.
Click OK.
For information about scripting checkboxes to handle mouse events, see Enabling, Disabling, and Marking Controls in a Dialog on page 181.
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 also accept text entry. In the text entry drop-down list, end users can enter text or choose a value from the list. The size of a combo box determines where the dropdown 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 you run the installation.
1. 2.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136. Select Add menu > Combo Box. The Combo Box Control Settings dialog appears.
3.
Complete the dialog: • 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 scroll the text entry field horizontally if more text is entered than fits.
145
About Dialog Controls
• ProgMan Groups Mark this to have the items in the Programs group of the Windows Start menu appear in the combo box. If the installer runs on Windows 3.1, the Program Manager groups appear in the combo box. • Drive List Mark this to display the end user’s available drives in the combo box. The value returned is a letter and a colon (such as “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 pathname the end user entered already exists on the destination computer. Clear this checkbox if you do not want the “This directory already exists” message to appear. • Variable Enter or select the name of the script variable that stores the return value of this dialog control. Note To 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 choose that variable in the Variable field.
• Combo Box Type Select the combo box type: "
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 a selection from the list.
• Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • 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 When setting the width for a combo box field, make sure it is at least as wide as the longest option in the list.
Adding List Box Controls A list box is simply a list of values from which the end user can choose. The control can return either the actual string the end user selected, or its position in the list as a letter. If it returns letters, it returns A if the first item is selected, B if the second item is selected, and so on. You can set a list box to let the end user select multiple values by marking its Multi-Select option.
146
About Dialog Controls
1.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Select Add menu > List Box. The List Box Control Settings dialog appears.
3.
Complete the dialog: • List Box Text Each line of this text is displayed as a separate item in the list box. Press the Enter key between selections so there is only one item per line. • Variable Enter or select the name of the script variable that stores the return value of this dialog control. • Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • List Box Type Select the list box type: "
Normal. A simple list.
"
Program Manager Groups. A list of the items in the Programs group of the Start menu. If the installer runs on Windows 3.1, the Program Manager groups appear in the list box.
"
Directory Tree Browse. A directory tree browser including an edit field, directory tree, and disk drive list.
"
List Box with Checkboxes. A list containing a checkbox for each item, allowing multiple items to be selected simultaneously.
• Components If this list box control is being used to specify the components to be installed, and if the components have sub-components, enter the names of subcomponent variables separated by commas. • Sort Mark this to sort the list box items in ascending order. • Vert. Scroll / Horiz. Scroll Mark this to add a vertical or horizontal scroll bar to the field. • Disable No Scroll Mark this to display a vertical scrollbar even if one is not needed. • Multi-Select Mark this to allow the end user to select multiple items from the list. • Return Letters Mark this to cause the control to return a list of letters representing the item selected (that is, A for the first, B for the second, etc.) rather than the item text itself. • Don’t Append Mark this to not append the “Program Files” directory name onto the Destination Directory selected by the end user.
147
About Dialog Controls
• Confirm If Exists Mark this to prompt for confirmation if the pathname the end user entered already exists on the destination computer. Clear this checkbox if you do not want the “This directory already exists” message to appear. • Components Populate the Components field above and mark this checkbox to create named components. • Store Position Mark this to store the position of the last selected item. The position is stored as a zero-padded, two-digit decimal number at the beginning of the variable. Example: If the end user selects the first, the third, then the fourth item, this control returns a value of 04ACD. • X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • Width / Height Specify the exact dimensions of the control in dialog units. You can also resize controls by dragging their handles, though this is not as precise. 4.
Click OK.
Adding Group Box Controls A group box encloses a group of related controls with a rectangle. Example: The Placement section on the Group Box Control Settings dialog is a group box. 1. 2.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136. Select Add menu > Group Box. The Group Box Control Settings dialog appears.
3.
Complete the dialog: • Group Box Text Enter a name to appear at the top of the group box. Example: On the Group Box Control Settings dialog, “Placement” is the group box text. • Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • Transparent Background. Mark this to make the background for this control transparent. • X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • Width / Height Specify the exact dimensions of the control in dialog units. You can also resize controls by dragging their handles, though this is not as precise.
4.
Click OK.
Adding Graphic Controls You can add graphics to be displayed on a dialog. Graphic controls are static controls, which means that the end user cannot make changes to them.
148
About Dialog Controls
1.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Select Add menu > Graphic in Custom Dialog Editor. The Graphic Control Settings dialog appears.
3.
Complete the dialog: • Graphic Pathname Specify the pathname for the bitmap graphic to add to the dialog. • Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • Do not resize bitmap graphic Normally, graphics are resized if the dialog needs to be made larger (example: if the destination computer uses a larger font size). Mark this checkbox to keep the graphic at the same size, regardless of the system settings. Because this option may cause the graphic to appear in a different place on the dialog, test the installation thoroughly. • X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • Width / Height Specify the exact dimensions of the control in dialog units. You can also resize controls by dragging their handles, though this is not as precise.
4.
Click OK.
Adding Hot Text Controls Use the Hot Text control to link an action to specific text. (Example: Add hot text with a link to a Web page or to a different dialog.) Hot text changes color and might also become underlined as the mouse pointer passes over it. 1. 2.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136. Select Add menu > Hot Text. The Hot Text Control Settings dialog appears.
3.
Complete the dialog: • Label Enter the text to use as hot text. • Variable Enter or select the name of the script variable that stores the return value of this dialog control. • Value Enter the value that gets assigned to the variable. This can be useful in a script when you need to know which hot text the end user clicked. • Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • Action Choose an action for the button. "
Return to Previous Dialog Displays the previously-displayed dialog in the dialog set. (Exception: The Back buttons on wizard dialogs do not use this option. They are controlled by
149
About Dialog Controls
the Wizard Loop script action.) If this is the first dialog displayed from the set, it returns to the installation script. "
Return to Script Returns to the installation script, even if this dialog was called from another dialog in the dialog set.
"
Display Dialog Displays the selected dialog from the current set.
"
Abort Installation The end user is asked to confirm that the installation should be aborted. If the end user confirms, the installation is exited.
"
Display Help Context If the HELPFILE variable points to a valid copy of a Windows help file, the specified numeric help context is displayed.
"
Execute Program Launches another application or links to a Web page. Click Edit to specify and configure the application to be launched. See Specifying Execute Program Settings on page 152.
"
Execute Named Event Passes a named event to the dialog script. The DLG_EVENT_TYPE variable is set to the entered text. See About the Dialog Script Editor on page 159.
• Set Font Normally, all controls use the default font, which you set on the Dialog Box Properties dialog. Click this to override the default font for this control. If the font you choose is not available on this computer, the system font is used. • Default Font Click this to use the font specified on the Dialog Box Properties dialog. • Disabled Color / Enabled Color Click Color to choose from the palette or to define custom colors. Enabled Color is the color in which the hot text appears when the end user moves the mouse pointer moves over the text. • Underline Enabled Text Mark this to underline the hot text when the end user moves the mouse pointer over the text. • X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • 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. • Do Not Check Fields Mark this to suppress directory confirmation and field validity checking. 4.
Click OK.
Adding Rectangle Control Use the Rectangle dialog control to draw a box on the dialog. Rectangle controls are static controls, which means that the end user cannot make changes to them. 1.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Select Add menu > Rectangle.
150
About Dialog Controls
The Frame/Rectangle Control Settings dialog appears. 3.
Complete the dialog: • Type Select Frame or Rectangle. On older operating systems, such as Windows NT 3.51 or Windows 3.1, rectangles are filled and frames are not. Newer operating systems do not distinguish between rectangles and frames. • Bevel Specify the 3D appearance of the frames or rectangles: "
Inset. Frame/rectangle appears to sink into the dialog.
"
Flush. Frame/rectangle appears at the same level with the dialog.
"
Outset. Frame/rectangle appears to pop out of the dialog.
• Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • Width / Height Specify the exact dimensions of the control in dialog units. You can also resize controls by dragging their handles, though this is not as precise. 4.
Click OK.
Adding Play AVI Control You can play an animation on any of the installation dialogs by adding a Play AVI dialog control. (Example: You might want to provide marketing information or offer animated help on how to install your application.) The .AVI will play once or loop continuously. 1. 2.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136 Select Add menu > Play AVI. The Play AVI Control Settings dialog appears.
3.
Complete the dialog: • .AVI Pathname Specify the pathname for the movie (.AVI file) to play on the dialog. • Control Name Enter the name by which you plan to refer to this control in the dialog script. Leave this blank if you do not plan to manipulate this control with a script. • X-Position / Y-Position Specify the exact location of the control on the dialog in dialog units. You can also use the alignment commands to precisely arrange controls on the dialog. See Aligning and Spacing Dialog Controls on page 152. • 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. • Loop Continuously Mark this to repeatedly start the movie from the beginning.
4.
Click OK.
151
About Dialog Controls
Specifying Execute Program Settings When you place a Hot Text control or a Push Button control on a dialog, you can execute a program or link to a Web page when the hot text or button is clicked. 1.
Open the Hot Text or Push Button Control Settings dialog. See Adding Hot Text Controls on page 149 or Adding Push Button Controls on page 141.
2.
Choose the Execute Program action and click Edit. The Execute Program Settings dialog appears.
3.
Complete the dialog: • EXE Path Specify the path to the application to be executed, including the application executable. Use variable substitution (example: %MAINDIR% to refer to the application directory) to ensure a valid path regardless the installation location. Enter only the filename if you set the path in the Default Directory field below. • Command Line Enter the command line options for the application (example: /S /Q). To link to a Web page, type the URL for the Web page (example: http://www.wise.com). • Default Directory Specify the directory where the application looks first when looking for a file. If you entered only the file name in the EXE Path field, the file must exist in this directory. You can also use variable substitution. • Variables Added Any script variables that were added by the executable program using a DDE link. Note Variables Added retained for backward compatibility only.
• Window Size You can force the application to run in a maximized or minimized window, or allow it to run in its default (normal) window. • Wait for Program to Exit If this is marked, the installation does not continue until the application has exited. 4.
Click OK.
Aligning and Spacing Dialog Controls The alignment and spacing commands help you align and space controls in relation to one another. 1.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Use Shift+click to select multiple items.
3.
Select one of the following commands from the Layout menu: • Align Controls Left Lines up the left edge of the selected controls with the left edge of the leftmost control. • Align Controls Right Lines up the right edge of the selected controls with the right edge of the rightmost control.
152
About Dialog Controls
• Align Controls Top Lines up the top edge of the selected controls with the top edge of the topmost control. • Align Controls Bottom Lines up the bottom edge of the selected controls with the bottom edge of the bottommost control. • Space Evenly Down Distributes the selected controls vertically between the topmost and bottommost controls. Their horizontal position is not changed. Use an Align Controls Left or Align Controls Right command to move them into a column. • Space Evenly Across Distributes the selected controls horizontally between the topmost and bottommost controls. Their vertical position is not changed. Use an Align Controls Top or Align Controls Bottom command to move them into a row.
Setting Tab Order of Dialog Controls Tab order refers to the sequence in which controls are selected when the end user presses the Tab key. By default, the tab order is the order in which the dialog controls were created. 1. 2.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136. Select Layout menu > Tab Order. A blue number appears next to each dialog control, showing the current tab sequence. The first control in the tab order has the focus when a dialog is first displayed.
3.
Specify the new tab order by clicking the controls in the desired order. •
As you click each control, its number turns black.
•
When you have clicked the last control, the numbers disappear and the new tab order is applied.
153
About Dialog Controls
•
To exit the tab order view, press the Esc key.
Note Although static controls such as graphics, text messages, divider lines and so on are included in the tab order, they are ignored when the end user presses the Tab key. Thus, their actual tab order is irrelevant.
154
Solutions for Dialog Problems
Solutions for Dialog Problems For solutions to some of the most common dialog editing problems, see: Changing the Default Graphic on Wizard Dialogs on page 155 Disabling the Appending of the Program Files Directory on page 155 Disabling the Directory Already Exists Message on page 156 Keeping Disabled Controls From Reactivating on page 156 Dialogs and End User Input on page 156 Creating Custom Dialogs on page 134
Changing the Default Graphic on Wizard Dialogs By default, wizard dialogs contain a graphic that is not part of the individual dialogs. It is specified on the Wizard Loop Settings dialog, where you configure the Wizard Loop script action. You can change this graphic and turn it off for selected dialogs.
To change the bitmap that applies to all wizard dialogs: 1.
In Setup Editor, double-click the Wizard Loop script line. There are two Wizard Loop script lines: one for the main installation and one that contains the Finish dialog. Change both of these to have the same graphic on all dialogs. The Wizard Loop Settings dialog appears. See Wizard Loop on page 131.
2.
In the Wizard Bitmap section, in Pathname, specify a pathname for a new graphic. This changes the graphic for all dialogs in the loop sequence.
3.
Click OK.
To turn off the Wizard Bitmap on selected wizard dialogs: 1.
In Setup Editor, double-click the Custom Dialog script line for the dialog. The Custom Dialog Editor opens.
2.
Select Edit menu > Dialog Box Properties. The Dialog Box Properties dialog appears. For information on this dialog, see Setting Dialog Properties on page 137.
3.
Towards the bottom of the dialog, mark Do not display wizard graphic on this dialog.
4.
Click OK.
Disabling the Appending of the Program Files Directory If you do not populate the Default Directory field on the Product Details page, and the end user changes the default directory using the Browse button on the Select Destination Directory dialog, a Program Files directory is appended to the selected directory. To prevent this, either populate the Default Directory field or disable the appending of Program Files. 1.
From Setup Editor, double-click the following line in the script: Custom Dialog “Select Destination Directory” The dialog opens in Custom Dialog Editor.
2.
Select Window menu > Select Destination Directory. The Select Destination Directory dialog appears.
3.
Double-click the list box control.
155
Solutions for Dialog Problems
The List Box Control Settings dialog appears. 4.
Mark Don’t Append and click OK.
5.
Select File menu > Save Changes and Exit.
Disabling the Directory Already Exists Message When an end user runs the installer and selects an existing directory as the destination directory, a warning message informs the end user that the directory already exists. This helps prevent the end user from installing to the wrong directory. 1.
From Setup Editor, double-click the following line in the script: Custom Dialog “Select Destination Directory” The dialog opens in Custom Dialog Editor.
2.
Select Window menu > Select Destination Directory. The Select Destination Directory dialog opens.
3.
Double-click the list box control. The List Box Control Settings dialog appears.
4.
Clear Confirm if Exists and click OK.
5.
Select File menu > Save Changes and Exit.
Keeping Disabled Controls From Reactivating This problem affects radio buttons and checkboxes. Example: You have a dialog in a wizard loop that has a radio button with four options. You disable several options by setting the variable associated with the radio button to “ABcd.” The lowercase “c” and “d” disable the third and fourth options. The dialog works fine if the end user selects an option and continues through the wizard dialogs. However, if the end user clicks the Back button to return to the dialog that contains the radio button, then all four of the button’s options are now enabled. To correct this problem, mark the Retain Disabled checkbox on the settings dialog for radio buttons and checkboxes. This causes any lowercase letters in the variable to stay in the variable, even after the end user selects a radio button and proceeds to the next wizard dialog. In the example above, if Retain Disabled is marked and an end user selects the first option in the radio button, the value of the variable is set to “cdA” (uppercase “A” because the user selected the first option.) If Retain Disabled is not marked, the radio button's variable is set only to “A.” That is why all four radio buttons are enabled when the end user backtracks, because the variable does not contain “a,” “b,” “c,” or “d.”
Dialogs and End User Input Dialogs can exhibit different behaviors based on end user input. For details, see the sample scripts discussed in the topics below. These scripts are located in the Samples directory in the WiseScript Editor application directory. Understanding Sample Scripts on page 175 Configuring a Dialog to Handle Mouse Events on page 179 Enabling, Disabling, and Marking Controls in a Dialog on page 181 Displaying a License Agreement Dialog on page 183 Showing or Skipping Dialogs Based on End User Input on page 181 Letting the End User Select Components and Subcomponents on page 182
156
About Custom Dialog Sets
About Custom Dialog Sets A single Custom Dialog script action can display a set of related dialogs. You do this by using a button on one dialog as a gateway to another dialog. This secondary dialog can link to another dialog, back to the master dialog, or return to the installation script. A single dialog set can contain up to 256 separate dialogs. The Select Destination Directory and Backup Replaced Files dialogs on the Dialogs page in Installation Expert are a dialog set. Note Generally dialog sets are comprised of one dialog and the other dialogs that it calls. Example: A dialog might have an Options and Browse buttons, each of which brings up a dialog. The three dialogs together comprise a dialog set. The main dialogs that you see during installation are not a dialog set, but are controlled by a Wizard Loop action in the script.
Creating a Dialog Set 1.
Create the master dialog. See Adding a Dialog to the Installation on page 135. The master dialog is the first dialog displayed when the associated Custom Dialog script action is executed.
2.
In Custom Dialog Editor, select File menu > New Dialog to add another dialog to the set. The Dialog Box Properties dialog appears.
3.
Complete the dialog and click OK. See Setting Dialog Properties on page 137.
4.
Configure the new dialog. See Adding and Editing Dialog Controls on page 138.
5.
Link the set of dialogs together using push button controls. For information on the various actions you can assign to a button, see Adding Push Button Controls on page 141. You can link to another dialog, back to the master dialog, or return to the installation script. To switch between dialogs in the set, select the dialogs from the Window menu. (You can also delete the current dialog using the Delete Dialog command on this menu.)
6.
When you have finished creating the dialog set, choose File menu > Save Changes and Exit. This saves all the dialogs in the set simultaneously.
Configuring Dialog Set Properties On the Dialog Set Properties dialog, you name the dialog set and specify the variable on which to base the display of this set. 1. 2.
Open a dialog from the set in Custom Dialog Editor. See Editing Dialogs on page 136. Select Edit menu > Dialog Set Properties. The Dialog Set Properties dialog appears.
3.
Complete the dialog: • Dialog Set Name Enter the name of this dialog set. If this dialog set is comprised of only one dialog, then this is usually the same name as the dialog. The name must be unique within a wizard loop. This value is displayed in the installation script.
157
About Custom Dialog Sets
• Display Variable The display variable determines which dialog in the wizard loop to present to the end user the next time the wizard loop is executed. When this dialog is presented to the end user, the display variable is set to this dialog set name. If this field is not blank, the dialog is only displayed if the variable holds the same value as the Dialog Set Name field. • Called Dialogs Float If you are displaying a dialog outside a wizard loop, mark this checkbox to have called dialogs appear over the calling dialog. (Example: suppose you display a Select Destination Directory dialog that contains a Browse button. If this checkbox is marked, and the end user clicks Browse, the Browse dialog appears on top of the Select Destination Directory dialog instead of replacing it.) This behavior is built into the wizard loop dialogs by default. 4.
Click OK.
158
About the Dialog Script Editor
About the Dialog Script Editor Each dialog can include an attached WiseScript that lets you perform script actions in response to events inside a dialog. You create this WiseScript in the Dialog Script Editor, which is a scaled-down version of Setup Editor. It contains only those script actions that can be used in dialog scripts. It lets you script dialogs to handle mouse movements, gather user input, and branch according to end user choices. Events are generated as the end user works with the dialog on the destination computer. Built-in dialog events include first-time display of the dialog (INIT), updating of information displayed on the dialog (UPDATE), and verification of the validity of the contents of the dialog (VERIFY). Additional events, whose names you define, can be generated by choosing Execute Named Event on the settings dialog of push button or hot text controls. To handle the generated events, you create a conditional structure in the dialog script that tests the variable DLG_EVENT_TYPE for the appropriate value. (Example: If DLG_EVENT_TYPE is equal to INIT, the INIT event is being called.) The script actions between the If statement that tests for this value and the End statement that goes with it should handle that event. The script can handle multiple events in different ways by including multiple conditional blocks, one after the other.
Creating a Custom Dialog Script Note Before attempting to write a custom dialog script, review the introductory material in Setup Editor on page 62. Also see Conditionals and Loops on page 78 and Variables and Expressions on page 79.
1.
Open the dialog in Custom Dialog Editor. See Editing Dialogs on page 136.
2.
Select View menu > Dialog Script Editor. The Dialog Script Editor opens.
3.
Create the script as you would in Setup Editor.
For information about scripting a dialog to handle mouse events, see Configuring a Dialog to Handle Mouse Events on page 179.
Dialog Script Actions The script actions available in the Dialog Script Editor are a subset of the actions in Setup Editor, with the addition of 3 script actions: Set Control Attributes, Set Control Text, and Set Current Control. These 3 actions manipulate controls on the dialog programmatically. Controls without names cannot be manipulated with these 3 actions. The available script actions are: !
Call DLL Function Calls an external program in a dynamically linked library. See Call DLL Function on page 88.
!
Check Configuration Tests aspects of the computer’s configuration (examples: amount of memory, OS type, and display depth). See Check Configuration on page 93.
159
About the Dialog Script Editor
!
Check If File/Dir Exists Determines if a particular file or directory exists on the destination computer or whether a particular directory is writable on the destination computer. See Check If File/Dir Exists on page 95.
!
Display Message Displays a message box on the screen, which is useful for error messages or alerts. See Display Message on page 103.
!
Edit INI File Edits the program’s private .INI files as well as the WIN.INI and System.ini files. This script action does not force Windows to restart, and might corrupt the file. See Edit INI File on page 105.
!
Edit Registry Adds, edits, or deletes keys or values in the registry. See Edit Registry on page 105.
!
Else Statement Marks the beginning of a section of instructions. See Else Statement on page 107.
!
ElseIf Statement Marks the beginning of a block of code that is only executed if the condition checked by the If is false, all previous ElseIfs are false, and this ElseIf is true. See ElseIf Statement on page 107.
!
End Statement Marks the end of an If block or a While loop. See End Statement on page 108.
!
Get Registry Key Value Gets the value of a registry key and stores it in the specified script variable. See Get Registry Key Value on page 111.
!
Get System Info Retrieves system info (examples: date and time, Windows version, available RAM, owner name, and company name). See Get System Information on page 112.
!
If Statement Marks the beginning of a conditional block of script. See If Statement on page 114.
!
Parse String Splits or edits a piece of text (any of which can be obtained from a variable) and places the results in two new variables. Also splits a string at any arbitrary character position. See Parse String on page 120.
!
Prompt for Filename Asks the end user for a path for opening or saving a file. See Prompt for Filename on page 122.
!
Read INI Value Reads an entry from an existing .INI file into a script variable. (Example: to obtain the pathname to an existing version of a program or other file.) See Read INI Value on page 123.
!
Remark Use to document the purpose of script sections. See Remark on page 125.
!
Set Control Attributes Show and enable, disable, or hide a control on the current dialog. See Set Control Attributes on page 127.
!
Set Control Text Set the text of any static text control or input field. Variable substitution is permitted to include the values of variables. See Set Control Text on page 128.
160
About the Dialog Script Editor
!
Set Current Control Moves the input focus to the specified control. See Set Current Control on page 128.
!
Set Variable Sets script variables to particular values and performs operations and calculations. See Set Variable on page 129.
!
While Statement Marks the beginning of a loop. See While Statement on page 131.
Dialog Script Examples To see an example of a dialog script: 1. 2.
Open the sample script Event Handler.wse in the Samples directory in the WiseScript Editor application directory. In Setup Editor, double-click the Custom Dialog “Event Handler” script line. The dialog opens in the Custom Dialog Editor.
3.
Select View menu > Dialog Script Editor. The script for the dialog appears in the Dialog Script Editor.
How you might use a dialog script: !
Have the INIT event enable buttons on the current dialog if the end user answered a previous dialog in a certain way. Check the variable containing the value returned from the previous dialog, then use one or more Set Control Attributes script actions to enable buttons.
!
Have the INIT event disable certain buttons if they are not valid based on previous chosen options.
!
Have the INIT event store the current amount of free memory in a static text control, then set the dialog to display the current amount of free memory in the lower left corner.
!
Have the UPDATE event enable the Next button on a wizard dialog when a password field contains the correct value. The UPDATE event is called whenever any field or control is changed, and the variable associated with each field or control contains its current value, suitable for testing in a script.
!
Have the VERIFY event check the contents of one or more fields on the dialog and reject the end user’s entry if it is invalid. VERIFY is called when the end user attempts to exit the dialog. Set the DLG_EVENT_TYPE variable to an empty string within the handler to prevent the dialog from closing. If all fields are correct, do not change DLG_EVENT_TYPE.
!
Create a button on the dialog that generates a custom event. Example: Create an event called DISKSPACE, and set it’s handler to show the amount of free disk space using a Display Message event.
161
Chapter 7
Creating Custom Billboards Billboards are a series of one or more graphics that present a slide show to the end user while files are being installed on the destination computer. These are typically used to encourage the end user to register the product, to promote related products, or to provide other useful information. Topics include: !
Accessing the Custom Billboard Editor.
!
About the Custom Billboard Editor.
!
Opening and Saving Custom Billboards.
!
Adding Objects to a Billboard.
162
Accessing the Custom Billboard Editor
Accessing the Custom Billboard Editor 1.
Select Setup Editor.
2.
At the bottom of the Actions List, click the Standard tab.
3.
Double-click the Custom Billboard action. The Custom Billboard Editor window opens.
The tools you need to work in the Custom Billboard Editor are accessible from its menu bar or the icons on the toolbar.
163
About the Custom Billboard Editor
About the Custom Billboard Editor The Custom Billboard Editor provides a basic set of drawing tools for creating billboards. You can create scalable, vector-based artwork that can be added to the billboards and displayed during installation. Although you can import graphics created in other drawing programs, there are advantages to using the Custom Billboard Editor. Example: The Scale to Screen option can resize native billboard objects so they look the same regardless of the resolution the end user is running. Editing graphics in the Custom Billboard Editor is easy because you can move, rearrange, recolor, or resize all objects. (Example: Text remains editable once it has been added, making it easy to translate your billboards into multiple languages.) If you import bitmaps created in other programs, you can still use the Custom Billboard Editor to place other objects (example: editable text) over them. The Custom Billboard Editor includes a blue work area with black lines marking the boundaries of a monitor set for 640 x 480 resolution. The blue work area indicates that the background is transparent, so any objects you place here appear over whatever background is displayed by the installer. You can specify the background that displays during the installation on the Screen page of Installation Expert. When you save a billboard from the Custom Billboard Editor, you are saving the entire blue screen area, including the text, lines, shapes, and graphics that are on the screen. Billboards are assigned a .GRF file extension when saved as a separate file.
164
Opening and Saving Custom Billboards
Opening and Saving Custom Billboards You can access the commands for creating, saving, exporting, and importing billboards from the File menu in the Custom Billboard Editor. There is no New command on the File menu because a new blank billboard screen displays when you open the Custom Billboard Editor. The commands on the File menu are: !
Open Opens a billboard from a .GRF file on disk, importing it to the current installation.
!
Save As Saves a billboard to a .GRF file on disk. You can then share the file with others, or reuse it on future projects by selecting it using the Open command.
!
Exit Without Saving Returns to Setup Editor without saving any of the changes made to the billboard.
!
Save Changes and Exit Saves the changes you made to the billboard and returns to Setup Editor. If you choose this command, the graphic is saved as part of the installation. It is only saved as a separate file if you use the Save As command.
165
Adding Objects to a Billboard
Adding Objects to a Billboard The Custom Billboard Editor is object-based and lets you add different types of objects. 1.
Access the Custom Billboard Editor. See Accessing the Custom Billboard Editor on page 163.
2.
Select the Add menu and choose the object.
3.
Drag in the work area to create the object. (The polygon tool requires that you click at each point of the polygon, then double-click at the last point.) After you place the object in the work area, a settings dialog appears.
4.
Complete the dialog: •
For text objects, see Editing Billboard Text Objects.
•
For line objects, see Editing Billboard Line Objects on page 167.
•
For rectangles, rounded rectangles, and ellipses, see Editing Billboard Rectangles and Ellipses on page 167.
•
For polygons, see Editing Billboard Polygon Objects on page 168.
•
For bitmaps, see Editing Billboard Bitmap Objects on page 168.
5.
Click OK.
6.
Position the object on the billboard. See Resizing, Moving, and Aligning Billboard Objects on page 169.
Editing Billboard Text Objects Text you place on a billboard using the Text tool remains editable and can be changed at any time. Each text object can use only one font, size, and style. 1.
Access the Custom Billboard Editor. See Accessing the Custom Billboard Editor on page 163.
2.
Select Add menu > Text and drag the dimensions of the object in the billboard editor. When you release the mouse button, the Text Settings dialog opens.
3.
Complete the dialog: • Text Enter the text to display. No variables can be referenced here, except compiler variables. • Extra Bold Mark this to display text in an extremely bold version of the typeface. • Shadow Mark this to display text using a 3D effect. • Alignment Specify the alignment of the text within its bounding rectangle: left, center, or right. • Text Angle Specify the angle at which text should be displayed. If a non-zero text angle is used, the text is centered regardless of the alignment setting. This feature is available only if you have selected a TrueType font. • Font Style Click Set Font to choose the font, size, and style for this object.
166
Adding Objects to a Billboard
• Text Color Click Pick to choose a color for the text using the standard Windows color picker. • Placement Specify the size and location of the object in pixels. The upper left corner is 0,0. The black rectangle on the billboard editor defines an area of 640 x 480 pixels. 4.
Click OK.
Editing Billboard Line Objects When you draw a line on a billboard, you define a box in which the line will fit. The line is drawn from one corner of the box (either the upper left or the lower left) to its opposite. 1.
Access the Custom Billboard Editor. See Accessing the Custom Billboard Editor on page 163.
2.
Select Add menu > Line and drag the dimensions of the object in the billboard editor. When you release the mouse button, the Line Settings dialog opens.
3.
Complete the dialog: • Line Style Choose the texture for the line. • Line Arrows Determines which ends of the line will have arrowheads, if any. • Line Direction Determines whether the line should connect the lower left corner of the bounding rectangle to the upper right corner, or the upper left to the lower right. • Line Width The width of the line in pixels. • Line Color Click Pick to choose a color for the line using the standard Windows color picker. • Placement Specify the size and location of the object in pixels. The upper left corner is 0,0. The black rectangle on the billboard editor defines an area of 640 x 480 pixels.
4.
Click OK.
Editing Billboard Rectangles and Ellipses The procedure for editing rectangles, rounded rectangles, and ellipses is the same, except that rectangles also have a 3D option. 1.
Access the Custom Billboard Editor. See Accessing the Custom Billboard Editor on page 163.
2.
Select Add menu > Rectangle or Rounded Rectangle or Ellipse and drag the dimensions of the object in the billboard editor. When you release the mouse button, the Object Settings dialog opens.
3.
Complete the dialog: • Line Style Choose the texture for the line that outlines the shape. • Fill Style Choose from No Fill (line only), Solid Color, or a variety of crosshatch styles.
167
Adding Objects to a Billboard
• 3D (Rectangle only) Each option from this list gives the rectangle a different 3D effect. • Line Width The width of the object’s outline in pixels. • Line Color / Fill Color Click Pick to choose a color for the line and fill using the standard Windows color picker. • Placement Specify the size and location of the object in pixels. The upper left corner is 0,0. The black rectangle on the billboard editor defines an area of 640 x 480 pixels. 4.
Click OK.
Editing Billboard Polygon Objects The polygon object consists of a series of points that are connected by lines. 1.
Access the Custom Billboard Editor. See Accessing the Custom Billboard Editor on page 163.
2.
Select Add menu > Polygon, click where the points should be located, and close the polygon’s path by double-clicking on the starting point.
Closing the polygon.
When you double-click the mouse button, the Polygon Settings dialog opens. 3.
Complete the dialog: • Line Style Choose the texture for the line that outlines the polygon. • Fill Style Choose from No Fill (line only), Solid Color, or a variety of crosshatch styles. • Line Width The width of the object’s outline in pixels. • Polygon Points The list of points that define the polygon’s vertices. Click Delete to delete a selected point, or use the X and Y fields to move the selected point to new coordinates. • Line Color / Fill Color Click Pick to choose a color for the line and fill using the standard Windows color picker.
4.
Click OK.
Editing Billboard Bitmap Objects Use the Bitmap object to import bitmap graphics created in other applications into your Custom Billboards. Use the text tool in the Custom Billboard Editor to add captions and
168
Adding Objects to a Billboard
content to the graphics, rather than making the text part of the bitmap. You can then easily change the text if you need to translate it into a different language or update it. The Custom Billboard Editor supports 256-color and true-color bitmap (.BMP) files. When using multiple bitmaps, it is important that they all be created using the same graphics editor so the files share a common color palette. Otherwise, the colors can shift when the bitmaps display on-screen. Note Imported bitmap objects can appear distorted when the billboard is run with the Scale to Screen option enabled on the Billboard Settings dialog. This is not true of objects created in the Custom Billboard Editor.
1.
Access the Custom Billboard Editor. See Accessing the Custom Billboard Editor on page 163.
2.
Select Add menu > Bitmap and drag the dimensions of the bitmap frame in the billboard editor. When you release the mouse button, the Bitmap Settings dialog opens.
3.
Complete the dialog: • Pathname Enter the pathname to the graphic on your computer. • Transparent Mark this to make the color chosen below transparent. • Transparent Color Click Pick to choose the transparent color using the standard Windows color picker. Every pixel in the image with this color becomes invisible on the billboard, meaning you can see everything behind it. • Placement Specify the size and location of the object. For best results, make the width and height equal to the actual width and height of the image.
Resizing, Moving, and Aligning Billboard Objects You resize an object in the Custom Billboard Editor by clicking the object and dragging one of the eight handles that appear around the perimeter of the object. You move objects on the Custom Billboard Editor by clicking and dragging them. For fine placement of objects, use the arrow keys on the keyboard to nudge the currently selected object 1 pixel in the direction of the arrow. Example: To nudge the object vertically by 1 pixel, click the object and press the Up Arrow key once. When two or more objects overlap, you can choose which one appears in front (or on top) by selecting Bring to Front or Send to Back from the Edit menu.
To align billboard objects: The alignment and spacing commands help you align and space objects in relation to one another. 1.
Open the billboard in the Custom Billboard Editor by double-clicking its custom action in Setup Editor.
2.
Use Shift+click to select multiple objects.
3.
Select one of the following commands from the Layout menu:
169
Adding Objects to a Billboard
• Align Left Lines up the left edge of the selected object with the left edge of the leftmost object. • Align Right Lines up the right edge of the selected object with the right edge of the rightmost object. • Align Top Lines up the top edge of the selected object with the top edge of the topmost object. • Align Bottom Lines up the bottom edge of the selected object with the bottom edge of the bottommost object. • Space Evenly Down Distributes the selected objects vertically between the topmost and bottommost objects. Their horizontal position is not changed. Use Align Left or Align Right to move them into a column. • Space Evenly Across Distributes the selected objects horizontally between the topmost and bottommost objects. Their vertical position is not changed. Use Align Top or Align Bottom to move them into a row.
Setting Billboard Properties When you are done creating a billboard, use the Billboard Settings dialog to set the behavior of the billboard as a whole. Besides being able to specify where the billboard appears on the screen, you can control how it interacts with other billboards and choose from several fade-in or slide in effects. 1.
Open the billboard in the Custom Billboard Editor by double-clicking its custom action in Setup Editor.
2.
Select Edit menu > Graphic Properties. The Billboard Settings dialog appears. The options on this dialog are a subset of the settings for the Display Billboard script action.
3.
Complete the dialog: • X Position, Y Position Indicate the location on a 640 x 480 screen to place images. On larger screens, the billboard is placed proportionately based on the 640 x 480 location. • Erase Num Specify how many previously displayed graphics are erased before this image is displayed. To display one image at a time, set to 1. To display all images simultaneously, set to 0. The oldest image is removed first. • Build Effect Specify a transition effect. • Center Horizontal • Place at Right • Scale to Screen Mark this for the image to cover the same percentage of the screen regardless of screen size. • Hide Progress Bar Mark this to hide the progress bar during image display.
170
Adding Objects to a Billboard
• Center Vertical • Place at Bottom • Tile Background Mark this checkbox to repeat the graphic edge-to-edge to fill the entire screen. • Erase All Mark this checkbox to remove all previous graphics from the screen before displaying the new one. • Timed Display Mark this checkbox 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. 4.
Click OK.
171
Chapter 8
Advanced Scripting Use the advanced scripting topics to automate the build process, create an installation that uses AutoPlay, and acquire an advanced understanding of Setup Editor scripts. Topics include: !
Automating the Build Process.
!
AutoPlay.
!
About Sample Scripts.
!
Using Sample Scripts.
!
Sample Scripts That Perform Tasks.
!
Sample Scripts That Restart the Destination Computer.
!
Sample Scripts That Use Expression Operators.
!
Sample Scripts That Use Complex Dialogs.
!
Sample Scripts That Perform Web and FTP Transactions.
!
Sample Scripts That Call .DLLs
!
Sample Scripts That Check System Configuration
172
Automating the Build Process
Automating the Build Process You can use command line options in conjunction with other processes to create an automated build process. Command line options let you compile as well as set properties. 1.
Enter the following command line statement into a batch file or program that has the ability to run command line statements: “C:\Program Files\Wise Package Studio\WiseScript Editor\Wise32.exe” /c /s “C:\Development\Application.wse” where “C:\Program Files\Wise Package Studio\WiseScript Editor\Wise32.exe” is the path to the WiseScript Editor executable, and “C:\Development\Application.wse” is the pathname for the script to be compiled.
2.
Use Scheduled Tasks to schedule the running of the batch file. Scheduled Tasks is in the Control Panel or My Computer, and is not available on some older operating systems.
Note To test the options without the scheduling program, open a command line window and type a command line statement. Select Windows Start menu > Run, type command (Windows 9x) or cmd (Windows 2000 or NT), and click OK.
173
AutoPlay
AutoPlay The Windows operating system has the ability to automatically open a file on a compact disc (CD) when it is inserted into the computer. This feature is referred to as AutoPlay. When Windows detects that a CD drive has been accessed, it scans the root directory of the CD drive for a text file called AutoRun.inf. You can create this file in any text editor. The AutoRun.inf file must have an [autorun] section, which identifies the lines that follow as AutoPlay commands. The [autorun] section contains an open statement that specifies the path of the file that should start when the CD is inserted. The icon statement specifies the file name that contains the icon. If the files are in the same directory as the AutoRun.inf file, enter just the file names. If the files are located inside a directory on the CD, enter a relative pathname. For more information about AutoPlay, go to msdn.microsoft.com and search for “AutoRun” or “AutoPlay”. Following is an example of an AutoRun.inf File: [autorun] open=Program.exe icon=filename.ico Where Program.exe is any Windows program. The sample script AutoPlay.wse, which presents the end user with choices, is the type of dialog you might display using the AutoPlay feature. For information on AutoPlay.wse, see Handling Mouse Events Without Scripting on page 180.
174
About Sample Scripts
About Sample Scripts The Samples directory in the WiseScript Editor application directory contains an assortment of WiseScripts (.WSE files) that perform complex actions and provide interactivity to the end user. Use these to further your knowledge of WiseScript Editor. These sample scripts do not provide step-by-step instructions for solving a particular problem, but provide an example that you can study and use as a basis for your own script. Some of these scripts run as stand-alone scripts while others contain only sections of code that you can copy and paste into your own script to achieve the desired effects. For details, see Understanding Sample Scripts.
Using Sample Scripts 1.
In Setup Editor, select File menu > Open and specify a sample script. Sample scripts are in the Samples directory in the WiseScript Editor application directory.
2.
To see what the script does, click Test. If you see an error message that warns of a missing file, or a file that could not be opened, see Troubleshooting Sample Scripts on page 176.
3.
To understand what the script does, read the remark script lines (Rem) throughout the script. See Understanding Sample Scripts on page 175.
4.
If the script has a Custom Dialog script line, double-click it to open the dialog in Custom Dialog Editor. Do the following to see relevant settings:
5.
•
To open a control’s settings dialog, double-click the control.
•
To see if a dialog has its own script and to view the script, select View menu > Dialog Script Editor.
•
To view another dialog of a dialog set (if the dialog is part of a dialog set), select the dialog from the Window menu.
Determine how you can use the script. For information on the different types of sample scripts and how they can be used, see Understanding Sample Scripts.
Understanding Sample Scripts You can learn most of what you need to know about a sample script by reading its remark (Rem) script lines. The header remarks follow this format: !
Rem Script Name Contains the file name of the current script.
!
Rem Author Contains internal WiseScript information for tracking scripts.
!
Rem Creation Date Contains the creation date of the script.
!
Rem Last Modified Contains the date the script was last modified by Wise Solutions personnel.
!
Rem VALID USE Tells you how the script can be used:
175
About Sample Scripts
• “Stand Alone Script Indicates that the script has all the elements necessary for an installation. You only need to customize it for your purposes. This might include substituting your own bitmaps, adding billboards, and installing your own files. When a sample script contains an Install File(s) script line, it usually references a file inside the WiseScript Editor application directory to ensure that the file exists. • Cut/Paste Script Indicates that this script has only a few lines of code that perform a specialized function. If you want to add the functionality to your installation script, copy the designated lines from this script and paste them into your own script. You might need to edit the lines to fix hard-coded pathnames, use different graphics, and so on. • Demonstration Indicates that this script is used to demonstrate a specific concept. It may not compile correctly, but it demonstrates the concept described in its remark script lines. These scripts are intended primarily as a learning tool. !
Rem Purpose Tells you what this script does.
!
Rem ACTIONS DEMONSTRATED Lists the script actions that are demonstrated within this script. This remark is only in some of the sample scripts.
There are other remarks placed at various locations within the body of the script. Often these script lines describe the next section of code or tell you what you need to know to get the lines to work in your own script.
Troubleshooting Sample Scripts Messages About Converting the Script When you open a sample script and try to go to Installation Expert, a message might appear warning you that the script is not compatible with Installation Expert. If you get messages about converting the script, you should choose not to convert the script. To safely view Installation Expert without converting your script, select Setup Editor > Edit menu > Installation Properties, or press Ctrl+Z. This takes you to Installation Expert, but only shows you pages that do not affect the installation script. For details, see Navigating Between Views on page 13.
Messages About Missing Files Sometimes when you try to run or test a sample script, messages appear about files that cannot be opened. The most likely cause of these messages are invalid pathnames. The compiler displays error messages such as: !
Cannot open file. Please check spelling and try again.
!
The file C:\Wise\WISE.HLP could not be opened. Please check the spelling of the filename and that the file is accessible.
In general, sample scripts only reference files that are located within the WiseScript Editor application directory. However, sometimes the pathnames for these files are different on your computer than on the computer where the script was developed. You can resolve this problem by using the Source Directories menu command described in Changing Source Directories on page 18, or by redefining compiler variable paths on the Compiler Variables page in Installation Expert.
176
About Sample Scripts
Sample Scripts That Perform Tasks Several sample scripts perform tasks that you might want to add to your script. These scripts perform the following tasks: Creating an Installer That Can Be Customized During Compile on page 177 Manipulating a Text File on page 177 Placing Shortcuts in Subfolders on page 177 Prompting the End User to Insert a Floppy Disk on page 177 Creating a Connection Between a Database Client and Oracle Server on page 177
Creating an Installer That Can Be Customized During Compile You can use compiler variables to customize an installer at compile time. See Compiler Variables on page 30. The sample script Compvar.wse, which is in the Samples directory in the WiseScript Editor application directory, uses the Compiler Variable If action. To see the compiler variable settings for _GRAPHIC_ and _OPTIONS_, go to the Compiler Variables page in Installation Expert. When the script runs, the first dialog asks if you want Sample Files and .DLL Source Code to be part of the installer and the second dialog asks you for the path to a bitmap file to be used as part of the installer.
Manipulating a Text File The sample script TextFile.wse, which is in the Samples directory in the WiseScript Editor application directory, demonstrates how to insert lines, convert case, comment out lines, and delete lines in a text file.
Placing Shortcuts in Subfolders The sample Shortcuts in Subfolders.wse, which is in the Samples directory in the WiseScript Editor application directory, demonstrates how to install shortcuts inside hierarchical menus within the Programs folder in the Windows Start menu. If you use the Shortcuts page in Installation Expert to add shortcuts, you can only place them one folder deep, (example: Programs\WidgetWare\Readme). This script puts additional subfolders inside the main shortcut folder, so you can have shortcuts located in subfolders (example: Programs\WidgetWare\Documentation\ReadMe).
Prompting the End User to Insert a Floppy Disk The sample script Newdisk.wse, which is in the Samples directory in the WiseScript Editor application directory, contains script lines that display a dialog prompting the end user to insert another floppy disk. You can edit this script so it prompts the end user for other removable media (example: zip disk).
Creating a Connection Between a Database Client and Oracle Server The sample script Add Tnsnames entry.wse, which is in the Samples directory in the WiseScript Editor application directory, adds an entry to the tnsnames.ora file, which enables a connection from a database client to an Oracle server.
177
About Sample Scripts
Sample Script That Searches for Files or Applications The sample script Search.wse, which is in the Samples directory in the WiseScript Editor application directory, uses the Search for File, Find File in Path, and Get Registry Key Value script actions. It uses these script actions to search for: !
A file with a given name on all local drives or on the network of the destination computer.
!
A file with a given name in the PATH environment variable or in specified directories of the destination computer.
!
An application on the destination computer that’s associated with a particular file extension.
Sample Scripts That Restart the Destination Computer The sample scripts are in the Samples directory in the WiseScript Editor application directory.
Running a Program Once After Computer Restart The sample script Runonce.wse causes an application to run once after the destination computer has been restarted. Example: Your installation script moves some in-use files to the Temp directory, replaces them with updated files, then forces a restart of the computer. You develop a script to remove the files that you moved to the Temp directory. However, because the files are in use, the script cannot run until after restart. You could use the script lines in Runonce.wse to run the remove script after the computer restarts.
Forcing the Destination Computer to Restart The sample script restart.wse forces the destination computer to restart after installation is complete. It works by setting the variable RESTART to “S.”
Sample Scripts That Use Expression Operators You can use expression operators to parse strings and to perform calculations, such as addition. The sample scripts demonstrate the use of many of the expression operators. The sample scripts are in the Samples directory in the WiseScript Editor application directory.
Performing Calculations on Integer Values The sample scripts Adding.wse and Division.wse contains scripts that perform calculations on integer values. The scripts first prompt the end user to enter two numerical values, then they perform the calculation and display the result.
Error Checking User Input The sample script Division.wse checks end user input to see if the divisor is zero. If it is zero, the prompt continues to appear until the user enters a non-zero integer. If it is not zero, it performs a division calculation. The error checking takes advantage of a While Loop that continually checks the information entered by the end user.
178
About Sample Scripts
Parsing Strings The following sample scripts demonstrate how to manipulate text strings using expression operators. See Expression Operators on page 195 for a complete list and usage. !
Before$.wse To return the characters in a string that occur before another string.
!
After$.wse To returns the characters in a string that occur after another string.
!
Concat$.wse To concatenate one string with another string.
!
Instr.wse To determine if one string is present inside another string.
!
Lcase$.wse To change all characters in a string to lowercase.
!
Left$.wse To get the left portion of a string.
!
Rtrim$.wse To remove all spaces at the end of a string.
!
Ltrim$.wse To remove all spaces at the beginning of a string.
!
Len.wse To determine the length of a string.
Converting a String to Lowercase or Uppercase The sample script Lcase$.wse converts a string to all lowercase. You can easily change it to convert to all uppercase by using the expression operator Ucase$() instead of Lcase$().
Putting User Input Into Variables The sample scripts Adding.wse, Division.wse, Concat$.wse, Instr.wse, Left$.wse, and Len.wse prompt the end user for information and put the input into variables. Most then perform calculations on the input or manipulate it in some way and then display the result.
Sample Scripts That Use Complex Dialogs Some sample scripts come with complex dialogs built into them. These scripts demonstrate how to set up dialogs to do the following: Configuring a Dialog to Handle Mouse Events on page 179 Enabling, Disabling, and Marking Controls in a Dialog on page 181 Showing or Skipping Dialogs Based on End User Input on page 181 Letting the End User Select Components and Subcomponents on page 182 Displaying a License Agreement Dialog on page 183
Configuring a Dialog to Handle Mouse Events The sample scripts Event Handler.wse, License Agreement.wse, and AutoPlay.wse contain dialogs that exhibit different behavior based on end user input. Event Handler.wse and License Agreement.wse handle mouse events with scripted dialogs. Using scripting to handle mouse events provides more control over what happens in
179
About Sample Scripts
dialogs, but you can also handle mouse events without scripting. The script AutoPlay.wse handles mouse events without scripting. Sample scripts are in the Samples directory in the WiseScript Editor application directory.
Handling Mouse Events Without Scripting To see how AutoPlay.wse handles mouse events without scripting: 1.
In Setup Editor, open AutoPlay.wse.
2.
In the installation script, double-click the Custom Dialog script line. The dialog opens in Custom Dialog Editor.
3.
Double-click the text “Launch Application.” The Hot Text Control Settings dialog opens. Note that in the Action section of the dialog, the Execute Program option is marked. When the end user clicks the text, the program specified in the Execute Program field is executed.
Each of the hot text options in the dialog have similar settings to initiate actions based on mouse clicks.
Handling Mouse Events With Scripting To see how License Agreement.wse handles mouse events with a dialog script: 1.
In Setup Editor, open License Agreement.wse.
2.
In the installation script, double-click the Custom Dialog script line. The dialog opens in Custom Dialog Editor.
3.
Double-click the radio button control. The Radio Button Control Settings dialog appears. Note that the variable is AGREEMENT. If the end user clicks the first radio button (I Agree), the letter “A” is put into the variable AGREEMENT. If the end user clicks the second radio button (I Disagree), the letter “B” is put into the variable AGREEMENT.
4. 5.
Click Cancel on the Radio Button Control Settings dialog. Now double-click the Next button. The Push Button Control Settings dialog appears. Note that the value of the Control Name field is AGREE.
6. 7.
Click Cancel on the Push Button Control Settings dialog. Select View menu > Dialog Script Editor. The following script appears: Disable Control AGREE If AGREEMENT Equals “A” then Enable Control AGREE End In this script the control AGREE (the Next button) is first set to disabled. When the end user clicks the first radio button (I Agree) the letter “A” is put into the variable AGREEMENT. When AGREEMENT equals “A,” the AGREE control (the Next button) is enabled.
8.
Close the Dialog Script Editor.
The script for the dialog in License Agreement.wse contains only 4 lines of code. To see a more complex dialog script, open Event Handler.wse, double click the Custom Dialog script line, and select View menu > Dialog Script Editor. This script handles several different mouse events.
180
About Sample Scripts
Enabling, Disabling, and Marking Controls in a Dialog The sample scripts Event Handler.wse and License Agreement.wse enable or disable controls by using dialog scripts. See Configuring a Dialog to Handle Mouse Events on page 179. The sample script Subcomp.wse sets checkboxes to be initially marked or unmarked by initializing the variables COMPONENTS, SAMPLE_SUB, and DLL_SUB, which are variables that are associated with specific controls in dialogs.
To see how this is accomplished: 1.
In Setup Editor, open Subcomp.wse. Sample scripts are in the Samples directory in the WiseScript Editor application directory.
2.
In the installation script, find the script line: Set Variable COMPONENTS to AB The variable COMPONENTS determines the state of a control in the Select Components dialog.
3.
In the installation script, double-click the script line: Custom Dialog “Select Components” The Select Components dialog opens.
4.
Double-click the checkbox control. The Checkbox Control Settings dialog appears. Note that the variable associated with this checkbox control is COMPONENTS, which was initialized as “AB” earlier in the script. A value of “A” in COMPONENTS means the first checkbox is marked and a value of “B” in COMPONENTS means the second checkbox is marked. Thus, when this dialog is first displayed to the end user, both checkboxes are marked by default because “A” and “B” are in the variable COMPONENTS. If the script did not initialize COMPONENTS, then neither of these checkboxes would be marked. Conversely, if the end user, when presented with the dialog, clears the first checkbox, the value of COMPONENTS changes to “B.”
5.
Click Cancel in the Checkbox Control Settings dialog and then select File menu > Exit Without Saving.
Showing or Skipping Dialogs Based on End User Input The sample script Skipdialog.wse presents the end user with a dialog containing three options and either skips or displays subsequent dialogs based on the options the end user chose. When an end user selects an option on this dialog, it puts letters into the variable COMPONENTS. The contents of the COMPONENTS variable is used in the Wizard Loop statement to either skip or display dialogs.
To see how this is accomplished: 1.
In Setup Editor, open Skipdialog.wse. Sample scripts are in the Samples directory in the WiseScript Editor application directory.
2.
In the installation script, double-click the script line: Custom Dialog “WidgetWare” The dialog opens in Custom Dialog Editor.
3.
Double-click the radio buttons.
181
About Sample Scripts
The Radio Button Control Settings dialog appears. Note that the variable in the Variable drop-down list is COMPONENTS. When the end user marks a radio button, the following is put into the variable COMPONENTS: •
A capital “A” if the end user marks the first radio button.
•
A capital “B” if the end user marks the second radio button.
•
A capital “C” if the end user marks the third radio button.
4.
Click Cancel in the Radio Button Control Settings dialog, then select File menu > Exit Without Saving.
5.
In the installation script, double-click the script line: Wizard Loop The Wizard Loop Settings dialog opens.
6.
In the dialogs list, click “Install2” and note its Skip Dialog settings. The dialog “Install2” is skipped if COMPONENTS is not set to “B,” that is, if the end user didn’t mark the second radio button. Likewise, the dialog “Install1” is skipped if COMPONENTS is not set to “A.”
Letting the End User Select Components and Subcomponents The sample script Subcomp.wse gives the end user the ability to choose the components and subcomponents to install. End users are presented with a dialog where they can mark the checkboxes for two components. Each component also has an Options button that displays a dialog with the subcomponents that make up the component.
To see how this is accomplished: 1.
In Setup Editor, open Subcomp.wse. Sample scripts are in the Samples directory in the WiseScript Editor application directory.
2.
Double-click the script line: Custom Dialog “Select Components” The dialog set opens and displays the Select Components dialog.
3.
Double-click the checkboxes. The Checkbox Control Settings dialog appears. Note that the variable in the Variable drop-down list is COMPONENTS. When the end user marks a checkbox, the following is put into the variable COMPONENTS: •
A capital “A” if the end user marks the first checkbox
•
A capital “B” if the end user marks the second checkbox.
If there was a third checkbox, a capital “C” would be placed into COMPONENTS, and so on. 4.
Click Cancel in the Checkbox Control Settings dialog.
5.
Select Window menu > Sample Files Components. The Sample Files Components dialog appears. This is the dialog that appears to end users if they click the Options button next to the Sample Files checkbox in the previous dialog. It is part of the Select Components dialog set.
6.
Double-click the checkboxes. The Checkbox Control Settings dialog appears. Note that the variable in the Variable drop-down list is SAMPLE_SUB. When end users marks a checkbox, the
182
About Sample Scripts
results are put into the variable SAMPLE_SUB. A capital “A” is added to SAMPLE_SUB if the end user marks the first checkbox and a capital “B” if the end user marks the second checkbox. 7.
Click Cancel in the Checkbox Control Settings dialog and select File menu > Exit Without Saving. This returns you to Setup Editor.
8.
Scroll down in the script until you see the script lines: If COMPONENTS Contains Any Letters in “A” then If SAMPLE_SUB Contains Any Letters in “A” then The first If statement checks if “A” is in COMPONENTS, which would be true if the end user marked the Sample Files checkbox in the Select Components dialog. The second checks if “A” is in SAMPLE_SUB, which would be true if the end user marked the DLL Samples checkbox in the Sample Files Components dialog. If the end user marked both, then both variables contain the letter “A,” and the Install File(s) script lines after the second If statement are executed.
For information on how the Subcomp.wse script sets checkboxes to be initially marked or unmarked, see Enabling, Disabling, and Marking Controls in a Dialog on page 181.
Displaying a License Agreement Dialog The sample script License Agreement.wse, which is in the Samples directory in the WiseScript Editor application directory, displays a license agreement dialog during installation. For details, see Handling Mouse Events With Scripting on page 180.
Sample Scripts That Perform Web and FTP Transactions Sample scripts are in the Samples directory in the WiseScript Editor application directory.
Checking an FTP Site for Newer Files The sample script Wiseup.wse checks an FTP site for newer files before performing the installation. If it finds newer files, it downloads and runs them to provide the end user with the latest version. If it does not, it displays a message that the current installation files comprise the latest version.
Downloading a File From a Web Site During Installation The sample script Ftpcopy.wse uses Copy Local File(s) script lines to copy files from an FTP site during installation. It shows how to download and run a .TXT file from an FTP site.
Launching a Web Page From an Installer The sample script Url.wse launches a Web page from an installer. It first determines the default browser, then opens the URL specified in the Execute Program statement.
Using WebDeploy Through a Proxy Server The sample script Proxy.wse contains the script lines necessary to get WebDeploy to work through a proxy server on the destination computer. A proxy server is a firewall that, for security purposes, limits certain kinds of communications between a client residing inside a company and the Internet. This script contains a Proxy Settings Dialog that makes it possible for end users to enter proxy server information during installation.
183
About Sample Scripts
Sample Scripts That Call .DLLs The Call DLL Function script action lets you call a .DLL during installation to perform specialized functionality. See Call DLL Function on page 88. The following sample scripts use the Call DLL Function Script action. For other sample scripts that call a .DLL, see Sample Scripts That Check System Configuration on page 184. Sample scripts are in the Samples directory in the WiseScript Editor application directory.
Branching a Script Based on the .DLL Return Value The sample script Prompt.wse demonstrates how you can use Call DLL script lines to branch based on the value returned to the installer from the .DLL. It calls a WiseScriptspecific .DLL. It also demonstrates how you can set a Call DLL script line to function like an If statement, where it executes a block of code based on the value returned from the .DLL.
Killing an Application Using Windows .DLL Calls The sample script Application Kill.wse forces an application to quit from within the installer. The Application Kill.wse kills the application Microsoft Word by using information obtained from executing Windows system .DLLs.
Sample Scripts That Check System Configuration Sample scripts are in the Samples directory in the WiseScript Editor application directory.
Checking for 256 Color Display The sample script Checkvga.wse checks the color depth of the destination computer.
Determining the Destination Computer’s Color Palette The sample script Colors.wse checks the color palette on the destination computer. It calls Windows system .DLLs and puts the resulting return value in a WiseScript variable that you can use in conditional statements. Note The Display control panel Settings tab indicates what color palette is set on the computer.
Checking Disk Space by Calling a Windows .DLL The sample script CheckDiskSpace.wse checks disk space on the destination computer. While you can use a Check Disk Space script action to see if adequate disk space exists, it does not put the information in a variable that you can display to the end user. By using the sample script CheckDiskSpace.wse, you can put this information into a variable and gather more detailed information about the free space.
Detecting the Presence of Internet Explorer The sample script DetectIE4or5.wse detects the registry key values that are normally present when Microsoft Internet Explorer 4.0 is installed.
184
About Sample Scripts
Detecting QuickTime Version The sample Detect QuickTime Version.wse checks the version of QuickTime installed on a machine. It searches for a QuickTime file, gets the version of the file, and puts the version number in a variable.
185
Chapter 9
Troubleshooting Installations You have several options for debugging an installation. You can use: !
The installation log to determine what is happening during the installation, including what fails.
!
The built-in debugger, as described in Using the Debug Commands on page 75.
!
Compiler variables to build a debug version of your installer .EXE that displays values of variables and other useful information while it is executing. The compiler itself helps ensure stability because it checks that all required information is present before it builds an installer .EXE. See Compiler Variables on page 30.
Topics include: !
Using the Installation Log.
!
File Replacement Problems in System32.
186
Using the Installation Log
Using the Installation Log The installation log is a text file that helps you debug your script. The log is the most complete record you have of exactly what the installation is doing. As your script runs on the destination computer, each action it performs is logged in Install.log. This includes: failures of actions to execute, the reasons for the failure, and what changes on your system. Use the installation log to determine where problems occur and why. Your testing group can use it to check the accuracy of the entire installation. It also helps with your technical support efforts because end users who have problems installing can simply email you the installation log. Use the Add Text to Install.log script action to add your own commands to the log. You can use it to comment the install log or to customize your uninstall. See Add Text to INSTALL.LOG on page 85. On the Installation Log page in Installation Expert, you can enable or disable the installation log and choose its location. See Installation Log on page 42.
187
File Replacement Problems in System32
File Replacement Problems in System32 Following are file replacement problems you might encounter: !
Files you assign to the application directory or to the Windows directory incorrectly install to the System or System32 directory.
!
A later version of a system file does not replace an earlier version.
Both of these symptoms can be caused by version checking code, which is executed if a file is set to be replaced based on version number. The code that does version checking also checks such things as operating system (OS) type and language, and it won’t replace files if the OS or language does not match, regardless of version. To check if a file is replaced based on version, double-click the file on the Files page in Installation Expert, or double-click its Install File(s) script line. In the Install File Settings dialog that appears, if Check File is selected from the Replace Existing File dropdown list, then version checking occurs for the file. To troubleshoot file replacement problems, you can do one of the following: !
If the problem occurs because your file coincidentally has the same name as an already existing system file, rename your file.
!
If the problem occurs because your file is a later version of a system file, but you are trying to install it to a different location than the existing system file, consider installing it to the existing location and changing your application to look for it in the existing location.
!
You can turn off version checking for the file (not recommended). Do this by selecting an option from the Replace Existing File drop-down list other than Check File.
!
Bypass the default version checking code. By default, WiseScript calls a Microsoft .DLL for version checking. You can use WiseScript Editor’s version checking method instead of Microsoft’s. To change the version checking method to the WiseScript Editor method, set the variable VER_CHECK_TYPE to 1 directly before the Install File(s) line that exhibits the problem. Then reset VER_CHECK_TYPE to null after the line, which re-enables Microsoft version checking. Example: Set Variable VER_CHECK_TYPE to 1 Install File C:\Program Files\Application\country.sys Set Variable VER_CHECK_TYPE to
188
Chapter 10
Quick Reference Use the following reference material when developing installations. !
Standard Variables.
!
Expression Operators.
!
Windows Language Codes.
!
Command Line Options.
189
Standard Variables
Standard Variables The following variables are set by WiseScript Editor or by the script generated by Installation Expert. Many of these variables can be modified by a script, but their initial values are set before the script executes.
Automatic Compiler Variables Compiler variables are set before the installation is built and cannot be changed by an installation script. Pathnames are relative to the build machine, not the destination computer. Compiler variables can be created and initialized by adding an entry to the Compiler Variables page in Installation Expert. See Compiler Variables on page 30.
Variable
Description
_WIN_
Windows directory (on build machine).
_WISE_
The directory containing WiseScript Editor.
_LOGFILE_PATH_
Path to the Install.log file.
_SYS_
The Windows system directory (on build machine).
_VAR_LIST_
Contains all the variables defined in this installation file (does not contain compiler variables).
Automatic Runtime Variables These variables are set on the destination computer just before the script executes.
Variable
Description
BACKUPDIR
If this is set to a path, any files that are replaced during installation are backed up. This variable is set by the end user on the Backup Replaced Files dialog.
CMDLINE
The command line options passed to the installation .EXE.
CRLF
Holds a carriage return/linefeed character for use in making lists and separating items in lists.
DISK_NUMBER (readonly)
The number of the disk currently being used by the installation. We recommend that you do not change this variable.
DLG_EVENT_TYPE
Used for custom dialog scripts. Built-in dialog events are INIT, UPDATE, VERIFY (see About the Dialog Script Editor on page 159).
FONTS
Pathname to directory where fonts should be installed.
HELPFILE
Used by custom dialogs to display a help context. Set to full pathname of help file. We recommend that you do not modify this variable.
INST
Pathname to directory containing installation .EXE. We recommend that you do not change this variable.
190
Standard Variables
Variable
Description
INST_LOG_PATH
Full path to place Install.log at end of installation.
INSTALL_RESULT (read-only)
Holds the result of the last action performed for Install File(s), Copy Local File(s), Edit INI, and Execute Program actions. (This variable is similar to PROCEXITCODE.) Install File(s) and Copy Local File(s) return: V = Version. Replacement option was set to check version, and the version being installed was not newer. ! D = Date. Replacement option was set to check Date/ Time and the condition was not met. ! E = Exists. Replacement option was Never, and the file exists. ! I = Install on reboot. The file was in use and will be installed on reboot. (RESTART variable also set to “S”) ! A null value signals success. If the file specification is a wildcard, the value represents the last file copied or installed. !
Edit INI File returns: “E” if the file could not be written, or null if the edit was successful. Execute Program returns: the numeric exit code (return code) from the called application. LANG
The language the end user selects in a multi-language installation. We recommend that you do not change this variable.
PASSWORD
Set to the password to be used for password-protected files. Setting this variable disables the password prompt. Set this for distributions that do not use prompting.
PROCEXITCODE (readonly)
Holds the result of the last Execute Program action. (This variable is similar to INSTALL_RESULT.) After an Execute Program script action, this returns the exit code (return code) from the called application.
191
Standard Variables
Variable
Description
RESTART
At the end of the script, set this variable to S to perform a full system boot at script completion. On Windows NT/ 2000/XP, if the current end user does not have administrator privileges, “S” only logs the user out. On Window 9x or 3.1, or on Windows NT/2000/XP with administrator privileges, “S” performs a full system reboot at completion of the script. See Sample Scripts That Restart the Destination Computer on page 178. Set to W to restart Windows on Windows 9x or 3.1. On Windows NT/2000/XP, “W” logs the user out. If you set this variable to E and follow it with a DOS command, Windows restarts and executes the command in a DOS shell during boot. This only works under Windows 3.1. When left blank, it turns off the RESTART function.
SYS
Windows System directory pathname. We recommend that you do not modify this variable.
SYS32
Pathname to the system directory for Win32 files under Windows NT/2000/XP. We recommend that you do not modify this variable.
TEMP
Windows temporary directory pathname. We recommend that you do not modify this variable.
UNINSTALL_LANG
Language information to make the UNWISE.EXE language match the installation language.
UNINSTALL_PATH
Location to place UNWISE.EXE.
WIN
Pathname to the Windows directory. We recommend that you do not modify this variable.
Runtime Variables The following runtime variables might be set or used by script actions generated by Installation Expert. Some variables might not have values assigned, depending on settings you chose in Installation Expert.
Variable
Description
APPTITLE
The title of the installation as entered in Installation Expert.
BACKUP
Pathname to the end user’s selected backup directory on the destination computer.
BRANDING
If set to 1, user information is written to CUSTDATA.INI in the directory containing the installation .EXE.
CDESKTOPDIR
Common desktop directory for adding shortcuts to desktop.
192
Standard Variables
Variable
Description
CGROUPDIR
Path to the directory where shortcuts for all end users are stored on Windows NT/2000/XP operating systems.
COMMON
Common files directory.
COMPONENTS
A list of the components the end user selects for installation on the destination computer (A for first component, B for second, etc.).
CSTARTMENUDIR
Common Start menu directory for adding shortcuts to Start menu.
CSTARTUPDIR
Common StartUp directory for adding shortcuts to StartUp group.
DESKTOPDIR
Desktop directory for adding shortcuts to desktop.
DIRECTION
Used by Wizard Loop action to control direction of motion through dialogs.
DISPLAY
Holds the name of the current wizard dialog (read-only).
DOBACKUP
Holds the end user’s choice as to whether to back up replaced files.
DOBRAND
If set to 1, this is the first time the installation has been branded and user information is written to CUSTDATA.INI.
EXPLORER
If set to 1, the end user has a Windows 95-style user interface on the destination computer (95/98, NT 4 or later).
GROUP
Default group (or Start menu Programs group) for application shortcuts.
GROUPDIR
Path to directory where application shortcuts should be created (corresponds to GROUP variable).
MAINDIR
Directory for application files.
NAME
Used for branding and registration.
PROCEXITCODE
Lets you add your own error codes to the built-in error codes that are returned from an installation. Check for an error condition and, if the error condition is true, put your own error text into PROCEXITCODE. If, at the end of the installation, PROCEXITCODE is not blank, the return code from the installation is set to the contents of PROCEXITCODE. This lets you write conditional code based on the results of an external program. Be sure to: ! Mark the Wait for Program to Exit checkbox on the Execute Program Settings dialog for the Execute Program action. ! Select True Win32 from the Destination Platforms drop-down list on the Build Settings page. (This variable is the same as WISE_ERROR_RTN.)
PROGRAM_FILES
Windows Program Files directory.
STARTMENUDIR
Directory of the Start menu for adding shortcuts.
193
Standard Variables
Variable
Description
STARTUPDIR
Directory of the StartUp group for adding shortcuts.
VER_CHECK_TYPE
Set this to 1 to cause the installation to use Wise’s simple version checking method instead of the standard Microsoft version checking method. This can fix problems when files are not being replaced as you expect. Set it to 1 before the Install File(s) script line that exhibits the problem. See File Replacement Problems in System32 on page 188.
WISE_ERROR_RTN
Lets you add your own error codes to the built-in error codes that are returned from an installation. Check for an error condition and, if the error condition is true, put your own error text into WISE_ERROR_RTN. If, at the end of the installation, WISE_ERROR_RTN is not blank, the contents of WISE_ERROR_RTN are written to the installation log.
194
Expression Operators
Expression Operators In conditionals, loops, and Set Variable commands, you can use symbols (examples: + and –) for addition and subtraction, functions (example: Left$) to work with bits of text, and logical (Boolean) operators (examples: AND, OR) to combine several conditions into one. Operators can operate on a variable or a constant. There are 2 types of constants: numeric and string. Numeric constants must be a positive or negative integer (example: 234 or -100). Strings must be enclosed in quotation marks. If you enter a variable name instead of a number or string in any of the functions below, do not enter % around the variable name. Variables must follow the standard naming conventions, described in Variables and Expressions on page 79. To read about scripts that demonstrate using expression operators, see Sample Scripts That Use Expression Operators on page 178.
Operator
Description
+
Addition
–
Subtraction
*
Multiplication
/
Division
Left$(str, position)
Returns left portion of string, where str is the string, and position is number of characters from the left to return. Example: Left$(“windows”,3) returns “win.”
Right$(str,position)
Returns right portion of string, where str is the string, and position is the number of characters from the right to return. Example: Right$(“windows”,3) returns “ows.”
Mid$(str,position, length)
Returns middle portion of string, where str is the string, position is the number of characters from the left to start, and length is the number of characters to return. Example: Mid$(“windows”,2,3) returns “ind.”
Concat$(str1,str2)
For appending 2 strings together.
Instr(str1,str2)
Determines if a substring (str2) is present within an original string (str1). Do not include the $ character because this operator does not return a string.
Before$(str1,str2)
Returns the portion of a string (str1) before the indicated substring (str2). Example: Before$(“windows”,“d”) returns “win.”
After$(str1,str2)
Returns the portion of a string (str1) after the indicated substring (str2). Example: After$(“windows”,“d”) returns “ows.”
Len(str)
Returns the length of a given string. Do not include the $ character because this operator does not return a string.
Lcase$(str)
Converts all characters in a string to lowercase.
Ucase$(str)
Converts all characters in a string to uppercase.
195
Expression Operators
Operator
Description
Ltrim$(str)
Deletes all leading spaces.
Rtrim$(str)
Deletes all trailing spaces.
Logical Operator
Example
Description
And
A And B
True only if expression A and B are both true.
Or
A Or B
True if either expression, A or B, is true, or if both A and B are true.
Not
A Not B
True only if one expression is true. Example: A but not B.
>
X>Y
True if expression X is numerically greater than Y.
<
X
True if expression X is numerically less than Y.
>=
X>=Y
True if expression X is numerically greater than or equal to Y.
<=
X<=Y
True if expression X is numerically less than or equal to Y.
=
X=Y
True if expression X is numerically equal to Y.
<>
X<>Y
True if expression X is not numerically equal to Y.
196
Windows Language Codes
Windows Language Codes Language
Code
Script
Greek
ELL
Other
Russian
RUS
Cyrillic
Turkish
TRK
Latin 2
Polish
PLK
Latin 2
Czech
CSY
Latin 2
Slovak
SKY
Latin 2
Hungarian
HUN
Latin 2
Danish
DAN
Latin 1
Dutch (Standard)
NLD
Latin 1
Belgian (Flemish)
NLB
Latin 1
English (American)
ENU
Latin 1
English (British)
ENG
Latin 1
English (Australian)
ENA
Latin 1
English (Canadian)
ENC
Latin 1
English (New Zealand)
ENZ
Latin 1
English (Ireland)
ENI
Latin 1
Finnish
FIN
Latin 1
French (Standard)
FRA
Latin 1
French (Belgian)
FRB
Latin 1
French (Canadian)
FRC
Latin 1
French (Swiss)
FRS
Latin 1
German (Standard)
DEU
Latin 1
German (Swiss)
DES
Latin 1
German (Austrian)
DEA
Latin 1
Icelandic
ISL
Latin 1
Italian (Standard)
ITA
Latin 1
Italian (Swiss)
ITS
Latin 1
Norwegian (Bokmal)
NOR
Latin 1
Norwegian (Nynorsk)
NON
Latin 1
Portuguese (Brazilian)
PTB
Latin 1
Portuguese (Standard)
PTG
Latin 1
Swedish
SVE
Latin 1
Spanish (Standard/Traditional)
ESP
Latin 1
197
Windows Language Codes
Spanish (Mexican)
ESM
Latin 1
Spanish (Modern)
ESN
Latin 1
198
Command Line Options
Command Line Options You can set command line options when you run WiseScript Editor, the installer executable, and the uninstaller executable. These are especially useful for running an installer as part of a batch file or other automated installation system. If you compile from the command line, compile errors generate return codes. To see the error message associated with the return code, run the compile directly from WiseScript Editor. When compile errors occur, a dialog appears during compile with a specific error message. See: WiseScript Editor (Wise32.EXE) on page 199 WiseScript Installations (Setup.EXE) on page 199 Uninstall (Unwise.EXE, Unwise32.EXE) on page 200
WiseScript Editor (Wise32.EXE) You can apply the following command line options to the WiseScript Editor executable file.
Option
Function
/c file.wse
Compiles the installation script.
/c /s file.wse
Compiles the installation script silently. You can use this option with the /d option.
/c /d_VAR_=value
Defines one compiler variable for this run only. Additional compiler variables require additional /d switches. Do not put a space between the /d and the compiler variable name.
/c /d=file.txt
Defines compiler variables from a text file for this run only. The format for the text file is _VAR_=value, with one entry per line. You can use the /s option with this option.
Examples: !
Compiling a .WSE file while defining a compiler variable named _PATH_: "C:\Program Files\Wise Package Studio\WiseScript Editor\Wise32.exe" / d_PATH_=C:\TEST /c "C:\Development\Application.wse"
!
Compiling a .WSE file while setting compiler variables defined in a text file named Compile.txt: “C:\Program Files\Wise Package Studio\WiseScript Editor\Wise32.exe” /c / d=C:\Development\Compile.txt “C:\Development\Application.wse”
WiseScript Installations (Setup.EXE) You can apply the following command line options to .EXE files that you compile from WiseScript Editor projects.
199
Command Line Options
Option
Function
/T
Installs in Test mode.
/X pathname
Extracts files to pathname.
/Z pathname
Extracts files to pathname, then reboots.
/M
Runs the installation in manual mode, prompting for system directories (examples: Windows, System).
/M=filename
Specifies a value file for installation. For information on reading variables, see Set Variable on page 129.
/M1
Displays the name of each self-registering .OCX or .DLL as it is registered.
/M2
Reserved for internal use by WiseScript Editor during debugging sessions.
/M5=dir_name
During installation, temporary files are written to the hard drive. On some locked-down machines with restricted privileges, these temporary files might fail to write, resulting in a failed installation. Use this command line option to specify a directory name for which the end user has write privileges.
/S
Installs in silent (automatic) mode with no end user choices.
Uninstall (Unwise.EXE, Unwise32.EXE) You can apply the following command line options to the WiseScript Editor uninstall executable file, which is named unwise.exe or unwise32.exe.
Option
Function
/Z
Remove empty directories, including the one with Unwise itself.
/A
Automatic mode. The Wise splash screen appears on the destination computer, and the uninstall proceeds immediately with no end user choices, except for questions about uninstalling shared files.
/S
Silent mode. The uninstall proceeds silently with no splash screen, no dialogs, and no end user choices.
/R
Rollback mode.
/U
This option removes the Select Uninstall Method dialog, which means the end user does not see options for a custom, automatic, or repair uninstall.
When you use command line options for the uninstall program, you must send it the path to the log file as a parameter. It must be the log file that is in the same folder as unwise.exe. If the path to the log file contains spaces, it must be surrounded by quotation marks. Example:
200
Command Line Options
"C:\Program Files\Application\UNWISE.EXE" /A "C:\Program Files\Application\INSTALL.LOG" Application Uninstall You can specify the title of the Uninstall dialog that appears. Type the title at the end of the command line after all other options. In the example above, the title would be “Application Uninstall.”
201
Index Symbols % sign with compiler variable 80 _LOGFILE_PATH_ 42, 190 _SYS_ 190 _VAR_LIST_ 190 _WIN_ 190 _WISE_ 190
Numerics
Application Kill.wse 184 APPTITLE 192 ASP 121 association See file association authenticode 34
3D-style dialogs 29
Autoexec.bat adding command 27, 28 backing up before editing 29, 87 editing 86 PATH variable 84
4-digit year 113
Autoexec.bat page 27
A
automated build process 30, 173
action adding to script 67 creating 70 custom list 69 list 64 repeating 78 user-defined, See user-defined action
automatic self-repair 20, 39, 117
386 33 386Enh 33, 88
Active Directory page 26 Add BDE Alias 83 Add Directory to Path 84 Add ProgMan Icons 84 Add Text to Install.log 85 Add to Autoexec.bat 86 Add to Config.sys 87 Add to System.ini 87 Add/Remove control panel 27 Add/Remove Programs page 27 Adding.wse 178 administrator rights, checking 93 After$ 179, 195 After$.wse 179 All view 21 Allow Floppy Disk Change 88 animated help 151 append data to registry key 49, 107 application executing 108 exit code 109 in Add/Remove Programs 27 killing with .DLL 184 name 45 Program Files directory 155 repairing 20
moving object 169 object, adding 166 opening 165 overlapping object 169 polygon, adding 168 properties 170 rectangle, adding 167 resizing object 169 saving 165 scalable 164 scaling to screen 170 settings 170 slowing down 171 timing the display 171 transition 170 working with 164
running after restart 178 searching for by association 178
automatic runtime variable 190 AutoPlay 174, 174 AutoPlay.wse 174, 180 AutoRun.inf 174, 174, 174 AVI, playing during installation 120
B back up replaced file on destination computer 34 background of installer displaying images in 102 setting 49
binary file reading from 124 writing to 124 bitmap adding to billboard 168 displaying in background 102, 162 Bitmap Settings dialog 169 blank line in edit text control 140 in script 125 in text control 139 blank script 14, 14, 21, 63 branching script 184
background processing 24
BRANDING 192
BACKUP 192
branding/registration 33
backup copy during save 24
Browse for Directory 88
BACKUPDIR 190, 190
BUFFERS 129
batch file scheduling to run 173
Build Settings page 29
beep for next disk 29
building installation 14
Before$ 179, 195
built-in dialog event 159
Before.wse 179
button adding 141 enabling 156
Belgian language code 197 billboard about 164 adding to script 102 arranging object 169 bitmap, adding 168 determine how many display 170 editing text 166 ellipse, adding 167 exporting 165 importing 165 line, adding 167 location 170
build, automated 30, 173
C C language variable 80 calculation, performing 178, 178 Call DLL Function example using structure 91 script action 88 cancel script 65 carriage return in edit text control 140
202
Index
in text control 139 CD copying files from 29, 98 storing installation 43 CDESKTOPDIR 192 CD-ROM drive, getting 113 CGI 121 CGROUPDIR 193 Check Configuration 93 Check Disk Space 94 Check HTTP Connection 94 Check If File/Dir Exists 95 Check In-use File 96 Check Service 96 checkbox about 144 adding 144 control 144 disabling 156, 179 enabling 156, 179 marking initially 181 unmarking initially 181 CheckDiskSpace.wse 184 Checkvga.wse 184 Chinese installation 43 CMDLINE 190 color depth checking with .DLL 184 color palette finding with .DLL 184 color, in script 24, 64 Colors.wse 184 combo box about 145 adding 145 pre-selected option 146 size 146 command line option automated build 173 WiseScript Editor uninstall executable 200 command line options about 199 compile 199 silent compile 199 silent installation 200 silent uninstall 200 test mode 200 uninstall 200 WiseScript Editor executable 199 WiseScript Editor project 199 commenting out lines 66 comments in scripts 125 COMMON 193 company name, getting 112 compile automated 30, 173
errors 199 from command line 199 in background 24 installation 17 options 29 silently 199 speeding 24 stopping 114 compiler variable about 80 data entry options 31 default value 31 description 190 disabling prompt 31 entering into an expression 80 example 76, 177 list of 190 naming 31 percent sign 80 prompting for value 30, 31 properties 31 referenced in script 30 sample script 30 setting 30 underscore 80 Compiler Variable If/Else/End 97 Compiler Variables page 30 complex structure 91 component adding to installation 31 conditional statement with 32 disk space for 140 installed by default 32 list box for 147 naming 32 optional 34, 81 program file for 32 selecting for installation 34, 126
adding 138 aligning 152 attributes 127 blank line in text 139 changing text 128 checkbox, See checkbox combo box, See combo box configuring 138 disabling 159, 181 drop-down editing 138 enabling 159, 181 frame 150 graphic 148 group box 148 hot text, See hot text list box, See list box location 152 manipulating 181 marking by default 156 option pre-selected 146 play AVI 151 property 138 push button 141 radio button, See radio button rectangle 150 setting to current 128 size 152 spacing 152 static 139, 148 tab order, setting 153 text 139, 140 user text 140 convert path to relative 19 UNC-based 18 convert script message 13, 13 Copy Local File(s) 98
component size, modify 119
CRC 29
component-based installation 31, 140, 182
Create Directory 100 Create Service 100
COMPONENTS 81, 94, 119, 181, 193
Create Shortcut 101
Components page 31
CRLF 190
Compvar.wse 177
CSTARTMENUDIR 193
Concat$ 179, 195
CSTARTUPDIR 193
Concat$.wse 179
custom action list 69
conditional loop 78
Custom Billboard 102
Config ODBC Data Source 97
Custom Billboard Editor about 162 accessing 163 window 163
Config.sys adding command 32, 32 backing up before editing 33, 87 editing 87 Config.sys page 32
custom dialog 102 Also see dialog
Contained within structure 92
Custom Dialog Editor about 135 accessing 135 toolbar 138
control about 138
custom dialog script about 159
Configure BDE 84 connection line 66
203
Index
examples for 161 custom dialog set See dialog set custom installation template 21 custom script code, incompatible 13 custom splash screen 46 Custom tab 64, 69 customizing development environment 21, 69 page group 22 CUT/PASTE 176 cyclic redundancy check 29 Czech language code 197
D Danish language code 197 database client, connecting 177 date/time file modified getting 112 getting 4-digit year 113 date/time, current getting 112 getting 4-digit year 113 debug version, building 76 debugging commenting out script lines 66 script 75, 75 default directory 45, 155 default script changing 21 Delete File(s) 102 dependency, service 51, 100 Desktop icon 51 DESKTOPDIR 193 destination computer searching for file on 178 destination directory append directory problem 155 default, setting 45 dir exists message 156 user-select 34 destination platform 30 Detect QuickTime Version.wse 185 DetectIE4or5.wse 184 development environment 21, 69 development process, streamlining 21, 70 device 87 device driver adding to System.ini 33 defining 33 Devices page 33 dialog adding 34 aligning 152 Also see dialog set
Also see dialog, adding Also see dialog, displaying appearance 137 calling dialogs 157 changing control text 128 common problems 155 creating 102, 135 default image, changing 155 disabling control 159, 181 dismissing 141 display to user 103 displaying text file 104 editing, See dialog, editing enabling control 159, 181 event, built-in 159 executing program from 152 floating 158 font problems 43 handling mouse event 156, 179 installation wizard 33 license agreement 183 list box 140 listing Program groups 147 manipulating control 181 movie 151 properties 137 push button 141 saving 136 script 159 scripting 127, 128, 156, 180 selecting 136 settings 137 showing 181 size 137 skipping 181 spacing 152 stop "dir exists" message 156 stop appending to path 155 tab order, setting 153 text box 140 text field, editing 140 title 137 to get filename 122 to get text input 122 to let user browse 88 toolbar 138 Web link 150 wizard loop dialogs 131
checkbox, See checkbox combo box, See combo box control 138 control, See control drop-down 145 frame 150 graphic control 148 group box control 148 hot text control, See hot text list box 146 movie 151 radio button, See radio button rectangle control 150 text 140 text control 139 to script 135 dialog, displaying rich text 140 dialog, editing about 136 control 138 from Dialogs page 136 from Setup Editor 136 template 136 Dialogs page 33 Digital Signature page 34 DIRECTION 193 directory appended 155 changing 18 check if exists 95 contents, adding 38 creating empty 100 default, setting 45 in installation 18 renaming 125 disabling checkbox 156, 179 control 159, 181 radio button 179 script lines 66 disk space checking 94 checking with .DLL 184 getting 113
dialog set creating 157, 157 custom 157 defined 157 editing 157 example 157 floating dialog 158 master dialog 157 naming 157 properties 157 sample script for 179
DISK_NUMBER 190
dialog template, editing 136
DLG 136
dialog, adding button 141
DLG_EVENT_TYPE 190
DISPLAY 193 Display Billboard 102 Display Message example 76 script action 103 Display Progress Message 104 Display Text File 104 dividing numbers 178 Division.wse 178, 178
DLL
204
Index
call function 88, 184 check if loaded 95 excluding with ApplicationWatch 25 excluding with Import VB Project 25 self-registering 99, 117, 127 sending parameters 90 shared 39 using to find color 184 using to kill application 184 DOBACKUP 193
evaluate expression 130 Evaluate Windows Installer Condition 108 Event Handler.wse 179, 181 event script area 65 cancel 65 choosing 65 exit script 65 mainline 65 EXE compiling 17 getting pathname 113 location after compile 30 naming 30 running silently 109 self-registering 99, 117, 127 version resource 41
DOBRAND 193 document type 35 documentation, Wise 9 DOS version, getting 112 double-byte language 43 download installation 58, 183 drive CD-ROM, getting 113 getting first network drive 113 type, getting 112
execute installation 17 execute program from dialog 152 script action 108
driver defining device driver 33 ODBC 118
exit code 109
DRV 33
Exit Without Saving 165
duplicate files in script 68
EXPLORER 193
Dutch language code 197
expression about 79 evaluating 130 example 178
dword 90 dword pointer 91
E Edit INI File 105 Edit Registry 105 ellipse in billboard 167 Else Statement 107 ElseIf Statement 107 empty project 14, 14, 21, 63 empty registry key 47 enabling checkbox 156, 179 control 159, 181 radio button 156, 179
Exit Installation 109 exit script 65
expression operator about 195 example 179 list of 195 Expression True 108, 114, 131, 132 extension, finding application for 178 extensions See the first letter see the first letter
F
converting short to long 129 copying from CD-ROM 29 copying to destination computer 116 date/time modified 112 deleting 102 downloading from Web 98, 183 duplicate file 36 error during compile 18 extension, See file association finding on destination computer 178 FTP from Web 98, 183 in use 96 installation settings 38 long filename 129 not opening 18 open automatically 174 removing from installation 37 renaming 125 replacing in System32 188 replacing on destination computer 39, 99, 117 requiring password 39 searching for 126, 178 searching in PATH variable 178 self-repairing 20, 39, 53, 101, 117, 117 short filename 129 size, getting 113 troubleshooting replacement 188 version checking 39, 99, 117 version, getting 112 file association creating 35 editing 36 File Associations page 35 file extensions See the first letter file name prompting for 122 file type Also see file association associating with program 35
fast create 24
Files page 36 Find File in Path 110
End Statement 108
feature See component 31
Finished dialog 34
English language code 197
file
Finnish language code 197
environment variable getting 110 reading 112 error checking user input 178 error message about missing file 176 Also refer to online Knowledgebase changing text for 23 compiler variable 23 for script sample 176 version error 24
4-digit modified date 113 adding particular type 38 adding to installation 36 associating file type with program 35 association, See file association attributes 128 auto-addition of associated 36 backing up replaced file on destination computer 34 check if exists 95 converting path 18, 19
firewall 183 First element of structure 92 floppy disk allowing change 88 configuring installation for 29, 43 prompting user to insert 177 FON 40 font 40, 125 Fonts page 40 FONTS variable 190 free disk space, getting 113
205
Index
copying files via 98 protocol 59
French language code 197, 197 FTP copying files via 98 protocol through proxy server 59 transactions 183 Ftpcopy.wse 183 function DLL function 88, 184 sending parameters 90
G General Information page 41 Get Environment Variable 110 Get Name/Serial Number 111 Get ProgMan Group 111 Get Registry Key Value 111 Get System Information 112 Get Temporary Filename 113 Get Windows Installer Property 114 Getting Started Guide 9
HTTP POST 121 HTTP server, post to 121 Hungarian language code 197
I Icelandic language code 197 icon adding 101 adding automatically 24 Also see shortcut for installation .EXE 30 group name 34 If Statement ending 108 starting 114 image, displaying in background 102, 162 include file tab 24
Greek language code 197
include script about 65, 65 action 115 adding 115 editing 65 saving 65 tab 24, 64, 65 Wise-created 65
GRF file 164
incompatible custom script code 13
GROUP 193
INI file creating 41 editing 105 reading value 123 settings 41 updating on destination computer 41
global options, setting 23 graphics checking support 93 displaying in background 102, 162 in wizard dialog 155
group box control 148 group for service 51, 100 group name for icon on destination computer 34 GROUPDIR 193
INI Files page 41
H Halt Compilation 114 hardware, checking 93 header remark CUT/PASTE 176 format 175 stand-alone script 176 help about 9 using 10 HELPFILE 190 hot text about 149 adding 149 control 149 link to Web 150 properties 149 hot text control See hot text HTTP checking connection 94
initialization splash screen 46 Insert Line into Text File 115 INST 190 INST_LOG_PATH 191 Install DirectX 84 Install File(s) 116 Install ODBC Driver 118 Install WinCE Component 84 Install WiseUpdate Client 84 Install.log 42, 187 adding text 85 open/close 119 INSTALL_RESULT 108, 191 installation Also see installation, adding background 49 beep for next disk 29 billboard, displaying 102 blank script 14 building 14, 17, 30
compiling 17 compiling, See compile component-based 31, 182 copying from 98 creating new 14, 14 creation options 14 customizing during compile 177, 177 debugging 76 default directory 45 destination platform 30 detecting previous 55 distributing 60 fast create 24 file error during compile 18 getting started 14 icon for 30 Internet-based 39, 58, 60, 183 language 23, 30 log file 42 maintaining 18 managing 14 manual mode 24 media 43 message, changing 23 naming 30 optional items 31 patching 39 pausing 120 progress bar 45 prompt, changing 23 prompting to save 23 rebuilding automatically 24 recording activity 187 reducing traffic 29 removing file from 37 repair option 19 saving automatically 23 script, See script self-repairing 20, 39, 117 serial number 44 shortcut 51 single-file 17, 43 temp directory 30 template, See installation template testing 17 title 45 troubleshooting 186 upgrade 53 verify authenticity 34 version 30, 41 Web page, launching from 183 wizard dialog 33 Zip format-compatible 29 Installation Expert about 15 customizing page group 22 customizing view 21 defined 13 getting help 15 navigating to 13
206
Index
page navigation 15 Pages menu 21 relation to Setup Editor 63 resetting page 15 undoing page entry 15 installation file information 41 installation from Internet 183 Web 183 installation log adding text 85 creating 42 default location 42 for uninstall 57 open/close 119 using 187 Installation Log page 42 installation template about 14 creating 21 editing 21 installation, adding entire directory 38 file 36 font 40 particular file type 38 registry entries 46 script 16 WiseScript instructions 16 installer Also see installation icon 30 naming 30 opening automatically 174 installer .EXE adapting to destination computer 79 building 17 pathname 113 prompting for file location 24 rebuilding automatically 24 installer message changing 23 editing 23 language 23 Instr$ 179, 195 Instr.wse 179 integer, calculation on 178 international installation 43 Internet check 94 Internet Explorer, presence of 184 Internet transactions 183 Internet-based installation creating 58 download option 39 FTP protocol 59 HTTP protocol 59 proxy server, working through 183
WebDeploy process 60 with WebDeploy 60 intranet installation 58, 183
Ltrim$ 179, 196 Ltrim$.wse 179
in-use file, forced replacement 29
M
IPF file, opening 15
main installation script 65
Italian language code 197
MAINDIR 193 mainline script 64, 65
J
managing installation 18
Japanese, font for 43
L LANG 191 language adding 43 code 197 copying text between dialogs 43 defining 43 directory for 23 font problems 43 message 23 selecting for installation 23 specifying 64 using another .INI for 30 Windows codes 197 Language directory 23 Languages page 43
manual accessing online 9 manual mode 24 master dialog 157 maximum compression 29 Media page 43 media-based installation 44 memory checking 93 finding 112 message changing text for 23 displaying to user 103 Microsoft Active Directory 26 Microsoft SMS page 44 Mid$ 195
Lcase$ 179, 195
MIF file creating 44 opening 15
Lcase$() 179
Modify Component Size 119
Lcase$.wse 179, 179
mouse event 156, 179, 180
Left$ 179, 195
movie on dialog 151
Left$.wse 179
multimedia file, playing 120
Len$ 179, 195
multiple instances of same file 36
Len.wse 179
multiple scripts 66
launch WiseScript Editor 14
license agreement 183 License Agreement.wse 180, 181, 183
N
line
NAME 193 adding to billboard 167 in edit text control 140 in text control 139 number 66
list box control 146 misinterpreted item 24 problem selecting item from 24 with checkboxes 147 log file See installation log logging 42, 57, 187 logon name, getting 113
name script 64 navigating between views 13 network drive, getting 113 installation 29 traffic, reducing 29 new features Refer to Release Notes Newdisk.wse 177 newsgroups 10 non-English dialog 23 non-properties view 13
long 90
Norwegian language code 197
long pointer 90
O
loop beginning 131 ending 108 lowercase, converting 129, 179
OCX excluding with ApplicationWatch 25
207
Index
exluding with Import VB Project 25 self-registering 99, 117, 127 ODBC data source, installing 97 driver, installing 118 Open Software Description 101 Open/Close Install.log 119 operating system checking 93 requirements 54 operators 195 optional installation item See component options for command line 199 Oracle Server 177 OSD 101 owner name, getting 112
P
previous version, searching for 55, 55 processor, checking 93 PROCEXITCODE 108, 193
Reboot System 125
Product Details page 45
rebuild installation after changes 24
ProgMan 51, 84
rectangle control 150 in billboard 167
ProgMan group, getting 111 program executing 108, 152 running silently 109 Program Files directory 155 Program Manager adding icon 84 adding shortcut 51 hiding 49
Progress Bar page 45 Prompt for Filename 122 Prompt for Text 122
Pages menu 21
prompt, changing text for 23
paging 93
Prompt.wse 184
Parameter Type 90
prompting user for information 179 installation directory selection 34
PASSWORD 191 Password page 44 password, requiring 39, 39, 44, 44, 98, 117 patch installation 39, 40, 53, 118 PATH variable 27, 84, 110 pathname changing directory 18 relative path 19 UNC path 18
properties getting 114 setting 130 Properties view 21 Proxy.wse 183 push button control 141
Q QuickTime, checking version 185
R
percent sign with compiler variable 80
radio button about 143 adding 143 control 143 disabling 179 enabling 179
play AVI control 151
Radio Button Dialog 123
Play Multimedia File 120
Read INI Value 123
Polish language code 197
Read/Update Text File 124
polygon in billboard 168
Read/Write Binary File 124
Portuguese language code 197
ReadMe for application 33
Pause 120 PDF (Package Definition File) 44
Post to HTTP Server 121 preferences, setting 23 preprocessor variable 80 Previous Version page See System Search page
register .OCX/.DLL/.EXE/.TLB 39 Register Font 125
page, resetting 15
passive FTP transfer 58
REG_EXPAND_SZ 112
progress bar calculation 45 placement 45 suppressing 39 progress message 104
parsing text 178, 179
REG file adding 46 importing 46, 47, 105
register files 99, 117
page group, customizing 22
Parse String 120
reference manual See manual
PROGRAM_FILES 193
Package Definition File (PDF) 44
parameters passing to function 91
message, turning off 29 running program after 178
readme See release notes reboot at script completion 125, 192 forcing 178
registry adding automatically 24 Also see REG file Also see registry key editing 105 importing file 47 keys 47 specifying entries on destination computer 46 registry file See REG file registry key adding 47 appending to 49, 107 creating 47 editing 47, 47 getting value 111, 160 removing from destination computer 48, 106 removing from installation 47, 105, 106 self-repair 49, 101, 107 settings 47, 106 Registry page 46 registry value See registry key relative path 19 release notes 9 REM statement about 175 Also see header remark Remark 125 remark header, See header remark removable media 43 Rename File/Directory 125 repair about 19 Also see self-repair application 49, 53, 101, 107, 117 during uninstall 19, 57, 60 turning on 53, 101 require password 98, 117
208
Index
resetting page 15 RESTART 192 restart at script completion 125, 192 forcing 178 message, turning off 29 running program after 178 restart.wse 178 return code 199 rich text, displaying in dialog 140 Right$ 195 right-click menu in Dialog Editor 137 rollback, from command line 200 rollback.wse 65, 65 Rtrim$ 179, 196 Rtrim$.wse 179 run installation 17 run program from installation 108 Runonce.wse 178 runtime variable about 80 automatic 190 with script actions 192 Russian language code 197
S sales contact, Wise Solutions 11 sample script dialog built into 179 Samples directory 175 Save Changes and Exit 165, 165 saving installation automatically 23 scheduling task 173 screen color requirements 54 Screen page 49 screen resolution requirements 54 script adding action to 67 basic concepts 78 blank 72 branching 184 colors 24 commenting out lines 66 comments 125 conditional statement for component 32 connection line 66 converting 13 debugging 75, 75 duplicate files in 68 editing 65, 67, 68 event script, See event script explained 81 file copy 81 file name 175 finding text in 67 include script, See include script
initialization 81 line number 66 mainline 64 naming 64 opening multiple 66 performing calculation with 178 placing new lines 24 referencing compiler variable 30 replacing text in 68 saving 65 saving to text file 66 sections 81 selecting for editing 64, 65 stand-alone 176 testing 17 tracking 175 user input 81
Set Current Control 128 Set File Attributes 128 Set Files/Buffers 129 Set Variable 129 Set Windows Installer Property 130 Setup Editor about 16, 63 actions list 64 actions, customizing list 69 creating action 70 defined 13 line color 24, 64 navigating to 13 relation to Installation Expert 63 Setup Editor window 16 working with 63
script actions 83 Also see actions by name colors for 64
setup program, changing 30
script sample documentation 175 missing file message 176 opening 175 REM statement 175 troubleshooting 175, 176 using 175
shared .DLL 39, 39, 99, 117
scripting dialog 180
shell link 51, 101
Search for File 126
short 90
Search.wse 178
short pointer 90
Select Components 126
shortcut adding 51 creating, editing 101 editing 52 in subfolders 177 installation hierarchy 177
self-register files 39, 99, 117 Self-Register OCXs/DLLs 127 self-repair about 19 application 20, 39, 117 automatic 20, 39, 117 file 20, 39, 117 registry value 49, 107 turning on 53, 101 using 20, 39, 117
Setup.EXE command line options 199 shared directory for user-defined action 24, 70 shared file keeping track of 39 shell execute 109
Shortcuts page 51 silent compile 199 silent installation from command line 200 reboot message 29
serial number getting from user 111 specifying 44
silent uninstall 200
server, Internet 58, 183
Skipdialog.wse 181
service adding 50, 100 checking 96 controlling behavior 50, 100 creating 50, 100 dependency 51, 100 group 51, 100 settings 50, 100 starting 51, 101 starting, stopping 130
Slovak language code 197
service pack number, getting 113 Services page 50 Set Control Attributes 127 Set Control Text 128
single installation file 17, 44 size of file, getting 113
smart create 24 SmartPatch 40, 118 SmartPatch page 53 SMS installation 44 opening an SMS installation 15 sound support requirements 54 source directory 18 source file changing location 18 relative path 19 UNC path 18
209
Index
space, checking 94
online support 10
Uninstall page 57
Spanish language code 197
Temp 113
UNINSTALL_LANG 192
splash screen 46
TEMP variable 192
UNINSTALL_PATH 192
stand-alone script 176
template for creating installations 14 for installation 14
uninstaller adding command 57 customizing 57 customizing with log file 119 deleting files 57 deleting registry keys 57 executing programs 58 logged installation 42 using installation log 85
Standard tab 64 Start menu 51, 101, 147 start WiseScript Editor 14 Start/Stop Service 130 STARTMENUDIR 193 STARTUPDIR 194 static control 139, 148 status MIF file 44
temporary file directory 30 temporary filename, getting 113 testing installation 17, 75 from command line 200 text adding to billboards 166 manipulating 120, 178 prompting for 122 reading from file 124 splitting into variables 178 updating in file 124
string buffer 91 parsing 120, 178 pointer 90 structure passing structure example 91 passing to DLL 91 Subcomp.wse 181, 181, 182 Subfolders.wse 177 support, Wise 10 newsgroups 10 online support 10 Swedish language code 197 SYS 33, 192 SYS32 192 system information getting 112 obtaining with sample scripts 184 system requirements checking 93 operating system 54 screen color 54 screen resolution 54 sound support 54 specifying 54 System Requirements page 54 system requirements, Wise product Refer to Getting Started Guide system restore (Windows Me) 29 System Search page 55
text control 140 text file changing 177 displaying in dialog 104 editing 115 manipulating 177 text in script replacing 68 searching 67 Textfile.wse 177 title of installation 45 TLB, self-registering 99, 117 Tools tab 14 training 11 translation See language troubleshooting dialog 155 installations 186 TrueType font 40, 125 TTF file 40, 125 Turkish language code 197 tutorial Refer to Getting Started Guide
System.ini adding device 33
U
System.ini, adding device 87
Ucase$() 179
System32 installing files 188 replacing files 188 Systems Management Server See SMS
T tab order in dialog 153 tabs in Setup Editor 65 technical support, Wise 10 newsgroups 10
Ucase$ 195 UNC path converting to 18 pathname, getting 113 underscore in compiler variable 80 undo page entry 15
uninstaller dialog, text for 23 unwise.exe 20, 57, 200 unwise32.exe 200 upgrading 53, 55 uppercase, converting 129, 179 URL check 94 Url.wse 183 user-defined action about 70 blank script for 72 changing parameter 70 creating 70, 70 dialog for 72 in actions list 71 interacting with developer 72 parameters for action 72 shared directory 24, 70 testing 73 tutorial 71
V values file 130 variable about 79 automatic runtime 190 compiler 80, 190 filling from file 130 incrementing, decrementing 129 list of 190 runtime 80, 192 setting value 129 standard 190 VER_CHECK_TYPE 194 Verisign 34 version checking 24, 39, 99, 117 version number, getting 112 volume label, getting 113 VXD 33
W
uninstal.wse 65
WAV, playing during installation 120
uninstall Also see uninstaller initiating repair 19 repair option 57, 60
Web transactions 183
Web page, launching from installer 183 WebDeploy distributing 60
210
Index
process overview 60 using through proxy 183 WebDeploy page 58 Welcome dialog 33 While Statement beginning 131 ending 108 WIN 192 Win16 SDK 91 Win32 System Directory 131 Win32s version, getting 113 window background 49 Windows logon name, getting 113 version, getting 112 Windows Installer condition, evaluate 108 Windows Installer property getting 114 setting 130
Windows language code 197 Windows service adding 50, 100 checking 96 controlling behavior 50, 100 creating 50, 100 starting, stopping 130 WinSock 59, 94 Wise include script See include script Wise Installation System script actions 83 Wise scripting language 83
WiseScript actions 83 adding to installation 16 WiseScript Editor launching 14 wizard dialog changing image 155 disabling radio button 156 enabling radio button 156 for installation 33 Wizard Loop action 131 adding dialog 102 word 90
Wise Solutions consulting 10 sales contact 11 technical support 10 training 11
Z
WISE_ERROR_RTN 109, 194
ZAP file, creating 26
Wise32.EXE, run from command 199
ZIP format, compatible with 29
word pointer 90 WSE 175
211