There's a couple ways to do that. For simple things, use the Include Script mechanism. For complex things, write your own plug-in in your favorite programming language. Plug-ins participate natively in the MSIcode script, render their own line, and can do anything - they also get access to script variables, can report live progress, participate in the build by adding files to a build, etc. Check out the Delphi plug-in template.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/