Windows Installer Editor Reference
452
Using MSI Script
This causes the WiseScript to create a log in the installation directory.
4. Add an Install File(s) script action and set the following:
Source Pathname: path to Unwise32.exe
Unwise32.exe is in the WiseScript Editor subdirectory of this product’s
installation directory.
Destination Pathname: %MAINDIR%\Unwise32.exe.
5. Add an Install File(s) script action and set the following:
Source Pathname: path to A.dll
Destination Pathname: %MAINDIR%\A.dll.
Add any other necessary script actions. (Example: You could edit registry entries, check
if a certain file or directory exists, or rename a file or directory.) For this example, the
CorePlus script installs only A.dll. For troubleshooting purposes, you might also want to
add a Display Message script action that shows the value of %MAINDIR%. This lets you
know when the WiseScript runs, and also gives you debugging abilities.
The sample WiseScript looks like this (the script lines are numbered for clarity):
1. Get Windows Installer Property INSTALLDIR into MAINDIR
2. Set Variable MAINDIR to %MAINDIR%
3. Open new installation log file %MAINDIR%\install.log
4. Install File C:\Program Files\Unwise32.exe to
%MAINDIR%\Unwise32.exe
5. Install File C:\Plus\A.dll to %MAINDIR%\A.dll
Troubleshooting: When WiseScript Custom Actions Fail on Windows
Vista or later
The User Account Control (UAC) that was introduced with Windows Vista provides a
temporary privilege-elevation model. When a program requires elevated privileges, an
administrator is prompted for approval and a standard user is prompted to provide
administrator credentials.
Even if you have coded an installation to bypass the UAC prompting, the installation
might fail if it contains WiseScript custom actions. When the Windows Vista or later
operating system encounters a WiseScript .EXE, it interprets that .EXE as an installation
and triggers User Account Control.
To prevent UAC prompting on the WiseScript custom action, add a manifest to the
WiseScript to indicate its run level. In Wise Package Studio 7.0 SP3 or later:
z
If you create the WiseScript in WiseScript Editor, the manifest is added
automatically and the run level is set to asInvoker, which runs the WiseScript as the
user who runs the .MSI.
z
If you create the WiseScript in WiseScript Package Editor, go to Installation Expert >
Build Settings page and set the manifest file option to asInvoker or specify a custom
manifest file.
To update a legacy installation
If you created the Windows Installer installation or the WiseScript in a Wise product
earlier than Wise Package Studio 7.0 SP3: