Windows Installer Editor Reference
448
Using MSI Script
Troubleshooting: When WiseScript Custom Actions Fail on Windows Vista or later
on
page 452
Run WiseScript From Destination
on page 483
Run WiseScript From Installation
on page 483
Run WiseScript From Installed Files
on page 485
About Script Editor in the WiseScript Editor Help
Examples of WiseScripts You Run From an .MSI
This section provides examples of how to use WiseScripts that are called by a Windows
Installer installation.
For script examples, see:
z
Using a WiseScript to Parse a Path
on page 448
z
Using a WiseScript to Install a License File
on page 449
z
Uninstalling Changes Made by a WiseScript
on page 450
Using a WiseScript to Parse a Path
Because the Microsoft Windows Installer technology does not allow for parsing, you
cannot use it to create an installation that extracts a path from the registry and then
parses the path to isolate the file name into a property. However, you can send the path
to a WiseScript executable, do the parsing, then send the file name back in a Windows
Installer property.
Example: You extract the path C:\Program Files\Application\Application.exe, use
WiseScript to parse the file name, Application.exe, and send the file name back in a
Windows Installer property.
To use a WiseScript to parse a path
1. Write a WiseScript that uses:
Get Windows Installer Property script action to get the property named
APPLICATION_PATH into a temporary variable.
Parse String script action on the temporary variable to put the file name into
another temporary variable.
Set Windows Installer Property script action to put the file name back into the
Windows Installer property APPLICATION_PATH.
2. In Installation Expert, use the System Search page to get a registry entry that
consists of a full path. Put the path into a property named APPLICATION_PATH.
3. In MSI Script, add a custom action to Run a WiseScript from Installation and specify
the WiseScript you wrote.
4. When an end user runs the Windows Installer installation, it calls the WiseScript,
which parses the path. When the Windows Installer installation continues running,
APPLICATION_PATH contains Application.exe.
The sample WiseScript looks like this (the script lines are numbered for clarity):
1. Get Windows Installer Property APPLICATION_PATH into TEMP
2. Parse String "%TEMP%" into PATH and FILE
3. Set Windows Installer Property APPLICATION_PATH to %PATH%