Windows Installer Editor Reference
485
Macro Editor
About the Macro Editor Window
Warning
You should be familiar with macros and comfortable with Visual Basic to use this feature.
For information on Visual Basic, visit
msdn.microsoft.com/vbasic/
The Macro Editor window with all its functions is very similar to the Microsoft Visual Basic
window.
Buttons
These are unique to the Macro Editor or are in some way different from those in Visual
Basic:
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
Replace all previously-added files 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
box 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.
Test
Same as Run.
VBImport
Have all relevant entries in the database tables
changed to comply with your corporate standards.
Options
Opens the Script Editor Options dialog box, where you
set and change the appearance of a script