cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bezpal
Level 4

Custom Actions/ New Managed Code

In basic MSI project:
I'm trying to create a Managed Code CA.
I've selected "New Managed Code - Stored in Binary table"
I specify Assembly File.
For Method Signature I click [...] and then Browse.
And get error below:
=====================
InstallShield
---------------------------
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
---------------------------
OK
=====================
What may cause it?
and how I retrieve the LoaderExceptions property?


If I manually specify class name MySpace.MyClass and method Boo(), then check Use custom method signature and set ReturnProperty to existing MyTestProperty.
then I build and start MSI debugger and that produces the following error:
=====================
InstallShield DLL Custom Action
---------------------------
The DLL call 'm1' caused a corrupted stack, make sure you have correct number of parameters and the function uses standard calling convention.
---------------------------
OK
======================
what is 'm1'? and why it causes corrupted stack?

Are static classes suppoted by Managed Code custom actions? (I get same error with static and non static classes)


Thanks!
Labels (1)
0 Kudos
(3) Replies
TimStVCS
Level 7

Bezpal, check out the sample project for managed code. When you launch the InstallShield application, click on Browse sample projects in the upper left corner of the interface underneath Project Tasks and then click on the WindowsInstaller folder, then on the Managed Custom Actions folder. You will see an InstallShield project named ManagedCustomActions.ism that should help you out.

Cheers!

Tim
0 Kudos
bezpal
Level 4

That's the problem 😞
I can't see what I'm doing different!
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

There's a conflict between the debugger and the managed-code custom actions (IOC-000076964), but you can probably find what you need by taking and examining a verbose MSI log. For instance, there should be a full stack trace if a .NET exception was thrown.

The original problem you mention with the browse button not working inside the InstallShield IDE sounds like there may be a dependency missing. If you use a tool like Lutz Roeder's .NET Reflector, do all the assembly's references show up correctly?
0 Kudos