You cannot access an installer session from a custom action that is not the current installation session. Custom actions are limited to working with only the active database of the session and no other databases. The following Windows Installer Database Functions must not be called from a custom action, because they require a handle to a database that is not the database of the current installation session:
Related topics
Accessing the Current Installer Session from Inside a Custom Action
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
