User Guide

457
About Macro Files
Events That Can Trigger a Macro
" Professional and Enterprise Editions only. The Macro Editor is not available
in the Visual Studio integrated editor.
Using the Macro Editor, you can write macros for OLE Automation events. Example: If
you write a macro for the AddFile event, the macro runs every time you add a file to an
installation. See Creating, Editing, and Running a Macro on page 455.
Event What you could do with a macro
AddFile Have each .DLL or .EXE file you add marked Read-only
or have all .DLL files placed into the System directory.
New Have a specific set of files added each time you start a
new installation. You could also add a message box so
you can choose not to have the files added.
Open Have all files you’ve added previously replaced with
any updated files in a certain folder each time you
open an installation.
QueryDisplayValidation
Have Package Validation not display certain ICE error
messages. To do this, set the variable bDisplay to
FALSE for that error.
QueryFixValidation
Have Package Validation determine if an ICE error is
fixable and supply code to fix it. It is first called when
bCheckOnly = TRUE. If bFix is set to TRUE, it
determines that the error is fixable and the Correct
button on the Package Validation View / Correct dialog
is enabled. When the user clicks the Correct button,
the macro is called again with bCheckOnly = FALSE.
The macro should then execute the changes needed to
fix the ICE error.
Run If an installation requires files that are accessed by a
custom action, the macro can ensure that these files
are copied to the proper location before you run the
installation.
Save Run several checks to ensure an installation adheres
to your corporate standards.
Tes t Sa me as R un.
VBImport Have all relevant entries in the database tables
changed to comply with your corporate standards.