Hi,

 

I am trying to pass parameters from WIX to C# code, but I am not able to do
it properly. To code that I have written on WIX side is:

 

<Property Id="teststring">

<![CDATA[Hello world]]>

</Property>

<CustomAction Id="testing" Return="check" BinaryKey="test"
DllEntry="hello"/>

<Binary Id="test" src="test.dll" />

<CustomAction Id="testing.setproperty" Return="check" Property="testing"
Value="[teststring]" />

 

<InstallExecuteSequence>

<Custom Action="testing.setproperty" After="InstallFiles" />

<Custom Action="testing" After="testing.setproperty" />

</InstallExecuteSequence>

 

The code I have written in C# and compiled as a DLL is :

 

using System;

using System.Text;

using System.Runtime.InteropServices;

 

namespace testing

{

public class test{

public static int hello(IntPtr handle)

{

int i;

int ptrcnt = 256;

//System.Windows.Forms.MessageBox.Show( String.Format( "Hello World
{0}",handle) );

StringBuilder sb = new StringBuilder(ptrcnt);

i = MsiGetProperty(handle,"CustomActionData",sb,ref ptrcnt);

System.Windows.Forms.MessageBox.Show( String.Format ( "{0}",sb ) ;

 

return 0;

}

[DllImport("msi.dll", CharSet=CharSet.Unicode)]

static extern int MsiGetProperty(IntPtr hInstall, string szName, [Out]
StringBuilder szValueBuf, ref int pchValueBuf);

 

 

}

}

 

But I am not able to pass the property value to C#. I am compiling the code
as a dll and making necessary modifications in the ilcode to export 

the method test. Can anyone please let me know if I am missing anything. 

 

Thank you,

regards

balaji.


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Pvt. Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Pvt. Ltd. does not accept any liability for virus infected mails.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to