User Guide
455
About Macro Files
About Macro Files
"
Professional and Enterprise Editions only. The Macro Editor is not available
in the Visual Studio integrated editor.
Use the Macro Editor to create and edit macro files. The default macro file in the
Templates folder (Macros.wbs) contains sample macros. These samples are commented
out, which means that you can view the script in the Macro Editor but you can’t run the
macros unless you uncomment the script. You can add macros to Macros.wbs, and edit
and delete its macros.
Each new file you start in Wise for Windows Installer has Macros.wbs attached. When
you open the Macro dialog, you can attach a different macro file.
You can create two types of macros:
! Event macros that run when you fire the corresponding event.
! Macros that you run manually.
If your .WBS files include event macros, you might encounter a situation in which you
want to create a new project that doesn’t run these macros. Example: You might have a
macro that runs on the New event and adds a specific set of files to a specific set of
directories every time you start a new project. To start a new project that does not
include these files and directories, you can create a new .WBS file that doesn’t contain
any macros. Then, attach this macro file to your project.
The Macro Editor doesn’t let you save a .WBS file under a different name. To rename a
macro file, change the file name in Windows Explorer.
Also see:
Creating, Editing, and Running a Macro
About the Macro Editor Window on page 458
Creating, Editing, and Running a Macro
" Professional and Enterprise Editions only. The Macro Editor is not available
in the Visual Studio integrated editor.
The Macro Editor is similar to Microsoft’s Visual Basic Editor. For information on Visual
Basic, visit
msdn.microsoft.com/vbasic/.
To create a macro:
1. Select Edit menu > Macros.
The Macro dialog appears.
2. Complete the dialog:
•Macro Is Run
Select:
# Manually to create a manually-run macro.
# On WFWI Event to create a macro that runs on an event.
• Event Name
For a manually-run macro, enter a name for the new macro. Do not include
spaces in the name. For an event macro, select an event.