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

How to integrate C# code in InstallaShield 2010

Hi All,

Presently i am working on Installshield 2010. Here i am using InstallScript
in setup.rul file..
Here My question is how to integrate the C# code into this scsript
Please let me know i dont have any idea about the integrating the C# code into InstallShield 2010 version.Any one knows please let me know.

If Any new feature interduced in Installation 2010 ..

Can we write any C# code in installShield 2010 ?
or
Can we integrate C# code in installShield 2010 ?

Please help me


Thanks & Regards,
Venu
Labels (1)
0 Kudos
(4) Replies
IlkkaV
Level 7

One way is to have necessary C# code in a DLL and then call that DLL from your InstallScript with DotNetCoCreateObject. For example


set oObj = DotNetCoCreateObject("MyLibrary.dll", "MyLibrary.MyClass", "");

nRetVal = oObj.MyFunction();
if (nRetVal != 0 ) then
szErrMsg = oObj.GetErrorMessage();
SprintfMsiLog(szErrMsg);
endif;

0 Kudos
karunakar
Level 3

Thank you for replay

We can'nt able to write any C# code instead of Insatllation script in InsatllShield 2010 version ?

Thank you Once again
Venu
0 Kudos
IlkkaV
Level 7

karunakar wrote:

We can'nt able to write any C# code instead of Insatllation script in InsatllShield 2010 version ?


The script editor in IS 2010 supports only InstallScript, but if you wish to use C#, you can use also Managed Code custom actions so that there's no need to use InstallScript to call your .NET assembly. That .NET assembly needs to be written in e.g. Visual Studio, though.
0 Kudos
Christopher_Pai
Level 16

A better way is to write managed custom actions using WiX DTF. You then wire these custom actions us as standard MSI dll's without the need for InstallScript in the middle.
0 Kudos