Windows Installer Basics: Custom Actions |
Windows Installer has native support for installing INI files, registry, files, services and many other things, anything outside of its capabilities are scripted (coded) by you in JSCRIPT, VBSCRIPT or in the form of a compiled EXE or DLL.
Some of the commands MAKEMSI provide for this purpose are (many other commands generate custom actions):
Note that "MSIEXEC.EXE" (version 4+, in Vista) is build with the "NXCOMPAT" option, this will be an issue if any of your code (or the libraries it uses) is not NX compliant. See "KB929710" for more information.
Windows Installer splits the definition of a custom action into two main steps:
When scheduling a custom action you will specify under what conditions it will execute. You should also consider the need for commit and rollback custom actions.
A deferred (in-script) custom action must be sequenced between the "InstallInitialize" and "InstallFinalize" actions (see the "CustomActionData" section to see how data is passed). If it uses or runs files installed by this MSI then the custom action must be run deferred and sequenced after the file installation!
EXE based custom actions have many issues (see the blog "Integration Hurdles for EXE Custom Actions"), for this reason you'd never write one, however sometimes you have to use what is available! If you were starting from scratch then you'd probably write a "DLL" based one instead (perhaps using the "DllCa-C" command).
Windows Installer 4 (Vista) Privileges |
Windows Installer service has the following specific privileges:
Its possible that this list may change but you get the idea... This list is more restrictive than that for previous versions.
As Custom Actions inherit the same privileges from the Windows Installer service, your custom actions will have only these privileges, even when running in an elevated context. If your application installation requires configuration that requires other privileges, it can't be done via a Custom Action.
Links to Custom Action Related Resources |