cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ashish123
Level 3

To call a custom action in Basic Msi Project of installshield

Hello
I have written a custom action using c# and this dll is also reffering a third party dll in the code when i am trying to excess this logic in installshield it is not implementing the logic while the installer is just intruppting in between can anyone help me.



thanks
Ashish
Labels (1)
0 Kudos
(8) Replies
manomatt
Level 8

Try to get the log for the installer using /L command line argument. By looking at the log, it will give you a better idea of what is going wrong.
0 Kudos
Not applicable

ashish123 wrote:
Hello
I have written a custom action using c# and this dll is also reffering a third party dll in the code when i am trying to excess this logic in installshield it is not implementing the logic while the installer is just intruppting in between can anyone help me.



thanks
Ashish


Insert the C# dll and third party dlls to Support Files view, then call the dll in your installscript custom action with SUPPORTDIR.

Kevin
0 Kudos
ashish123
Level 3

mano.n.s75 wrote:
Try to get the log for the installer using /L command line argument. By looking at the log, it will give you a better idea of what is going wrong.


Hi mano,

Thanks for the reply, I am new with Installshiled setup I am sorry, can you please tell me how see the log for the installer using /L though command line?
0 Kudos
ashish123
Level 3

Kevin.Wan wrote:
Insert the C# dll and third party dlls to Support Files view, then call the dll in your installscript custom action with SUPPORTDIR.

Kevin


Hi Kevin,

Thanks for the reply, I am using Basic MSI project, inside that I have created Custom Action which uses my DLL and in that DLL I have written one function say Test(). This Test() function uses the third party DLL's classes & function. If i add the CA in the sequence then installer wont work and if i remove the refrence of thrid party DLL from Test() then it will work properly. Please let me know if i am missing anything. like keeping the third party DLL at common location? or how to include third party DLL in installers? Please help.

Thanks,

Ashish
0 Kudos
manomatt
Level 8

http://msdn.microsoft.com/en-us/library/aa367988(v=vs.85).aspx Check this for the various logging and other command line options.

As far as your Dll issue is concerned i feel that since you are trying to use a function that is written in a 3rd party DLL, in your DLL you have to register that 3rd party DLL to GAC first and then try to run the CA and see. More information about the failure will always be available if you see the log.

Cheers!!;)
0 Kudos
ashish123
Level 3

Mano,

Thanks for your valuable help :)...

i could able to get the log and looks like the third party DLL is not present so Installshield is thorowing an exception. Please see the below log for more detail.

Will you please advice how could i make available third party DLL while installing / executing my CA?


InstallShield: Attempting to load through CLR 4 APIs...
InstallShield: Getting meta host...
InstallShield: Enumerating available runtimes...
InstallShield: Highest available runtime: v4.0.30319
InstallShield: Trying to use highest runtime...
InstallShield: Using highest version runtime...
InstallShield: Loading assembly Utilities from resource 4097
InstallShield: Calling method with parameters []
InstallShield: Loading Assembly Interop.IWshRuntimeLibrary
InstallShield: Couldn't resolve assembly by name Interop.IWshRuntimeLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
InstallShield: Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Interop.IWshRuntimeLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
0 Kudos
manomatt
Level 8

Before your call your CA Dll, first register the third party dll "Interop.IWshRuntimeLibrary" to GAC and then call your Dll Custom Action. This will solve your issue.
0 Kudos
ashish123
Level 3

Interop.IWshRuntimeLibrary.dll is a third party DLL and I dont have source code of the DLL. so I couldn't register this DLL to GAC. Do we have any alternative solution?
0 Kudos