User Guide
495
Calling WiseScripts with Custom Actions
Examples of WiseScripts You Run From an .MSI
This section provides illustrations of how to use WiseScripts called by a Windows
Installer installation. For information on which WiseScript editing tool comes with your
software, see WiseScript Editing Tools.
For script examples, see:
! Using a WiseScript to Parse a Pathname on page 495
! Using a WiseScript to Install a License File on page 495
! Uninstalling Changes Made by a WiseScript on page 496
Using a WiseScript to Parse a Pathname
Because Microsoft’s Windows Installer technology does not allow for parsing, you cannot
use it to create an installation that extracts a pathname from the registry and then
parses the pathname to isolate the file name into a property. However, you can send the
pathname to a WiseScript executable, do the parsing, then send the file name back in a
Windows Installer property.
Example: You extract the pathname 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.
Do the following:
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 pathname. Put the pathname 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 pathname. 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%
Using a WiseScript to Install a License File
Virtually anyone can open an installation .MSI and see the files and other information it
contains. Usually, this is an advantage, but it can be a disadvantage when you need to
include sensitive information such as passwords or a license file. To hide sensitive files,
install them with a WiseScript and save them within the WiseScript .EXE.
Example: Your application comes in 2 editions: Regular and Super. Serial numbers for
the Regular edition begin with the letter R, and serial numbers for the Super edition