cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pbsdis
Level 6

COM registration error with IS2009

I have problem to call a 3rd party dll (PrimoAPI.dll) function from a CA in InstallShield 2009, with error 0f "80040154" - com server not registered.

Attached (zipped .doc to overcome the max size limit on .doc files) contains the screenshot that shows how I configured the 3rd party dll to make IS to register it (it has been set as key file of the compoment), in a simple testing project (InstallScript MSI).

The CA has been set as 'Deferred Execution in System Context' and is type of "Call a function in a Windows Installer dynamic-link library". It calls a funciton of my own dll (say 'MyDll.dll'). My dll function has following code to call the 3rd party dll function (CreatePrinter()):


...
_DPrimoAPIDLLPtr pPrimoAPI = 0;
....
HRESULT hErr = CoInitialize(0);
hErr = pPrimoAPI.CreateInstance(__uuidof(PrimoAPIDLL));
if (pPrimoAPI) {
pPrimoAPI->UserString = "some_string";
pPrimoAPI->LicenseKey = "some_key";
lErr = pPrimoAPI->CreatePrinter();
...
}
else
{
CatchErr(hErr);
}
...


CatchErr() indicates that the error number is '80040154', which means the com is not registered. If I manually register the 3rd party dll (regsvr32) before installation, the call to 'CreatePrinter()' works.

The similar way works on another product, which is Basic MSI, so the above code should be fine, thus the only problem is that IS failed to register the 3rd party dll. The 3rd party dll needs to be installed under the same drive of Windows, according to the experience of the other product.

Any help is greatly appreciated.


Thanks,
PB
Labels (1)
0 Kudos
(2) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Where is this custom action sequenced? At the very earliest, it should be sequenced some point after PublishProduct.
0 Kudos
pbsdis
Level 6

Josh,

You are right, once puting the CAs after PublishProduct, everything works.

Thanks!
PB
0 Kudos