Windows Installer: MsiDoAction() returns ERROR_FUNCTION_NOT_CALLED -


i writing bootstrapper product several prerequisites. determine prereqs install, use msi appsearch.

the bootstrapper opens myproduct.msi package ::msiopenpackageex(), calls ::msidoaction("appsearch") load properties, , fetches properties of interest determine prereqs need loading. close prereqs session (::msiclosehandle()) won't interfere msi sessions used prereqs installers. (after prereqs installed) bootstrapper runs msiexec /i myproduct.msi.

i want extend calling custom action ::msidoaction("myextendedappsearch") populate additional msi properties during prereqs session, using wmi searches msi appsearch cannot do. however, when call action, returns error_function_not_called. same action, when called in real install session, works fine.

i have tried both c .dll , vbscript (embedded, binary table, doesn't matter). apparently there sort of initialization done in real install not doing. or alternatively, i'm not setting right flag bits on action, or should scheduling in installexecutesequence (or not, or something).

your guidance appreciated. in advance.

@cosmin pirvu: it's not scheduled @ all, nor in sequence table. exists in customaction table, , called explicitly chainer program.

never mind, folks. false alarm/sloppy programmer.

meta-solution: read predecessor's code carefully, , read docs more carefully.

solution: ::msiopenpackageex() being called msiopenpackageflags_ignoremachinestate flag. per msi documentation, using flag returns restricted session handle cannot call .dll, .exe or script custom actions.

not passing flag -- or, equivalently, calling ::msiopenpackage() (no ex) -- returns unrestricted handle can .dll, .exe or script custom actions.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -