In managed CAs using DTF you can include unmanaged DLLs in much the same way 
you can include dependent assemblies and they will be extracted alongside your 
CA's main assembly.
 
Blair
 
> From: jacob.hoo...@greenheck.com
> To: wix-users@lists.sourceforge.net
> CC: wix-users@lists.sourceforge.net
> Date: Tue, 2 Jul 2013 04:33:27 +0000
> Subject: Re: [WiX-users] Custom Actions that need to call unmanaged DLL
> 
> 1) yes
> 2) you could
> 3) yes, you could but you would need to manually extract the dll in you 
> managed ca (after embedding it in the msi) and then pinvoke that dll.  Fairly 
> certain .net requires the native libs to exist as its loading your assembly, 
> so you would need to build the reference to the native lib manually.
> 
> If you own this dll, then I'd just expose a ca entry point in it and avoid 
> all the complexities/chances for failure.
> 
> If you need a functional example of a dynamic/runtime pinvoke, look for .net 
> code calling DllRegisterServer.
> 
> Sent from my phone
> 
> On Jul 1, 2013, at 7:12 PM, "George Fleming" <gef...@microsoft.com> wrote:
> 
> > I would like do something like this:
> > 
> > CustomActions.cs:
> > 
> > [CustomAction]
> > Public static ActionResults MyCustomAction(Session session)
> > {
> >                ...
> >                NativeMethod.XYZ xyz = new NativeMethod.XYZ();
> > }
> > 
> > NativeMethods.cs:
> > 
> > internal static class NativeMethods
> > {
> >                Internal class XYZ
> >                {
> >                                XYZ()
> > {
> >                                                ...
> >                                                XYZInternalFunc();
> >                                }
> > 
> >                                [DllImport("XYZ")]
> >                                Static extern private UInt32 
> > XYZInternalFunc();
> >                }
> > }
> > 
> > Questions:
> > 
> > 
> > 1.       Is this possible?
> > 
> > 2.       Do I need to deploy XYZ.dll in same directory as my MSI file?
> > 
> > 3.       Is it possible to bundle the XYZ.dll so that just the MSI is 
> > sufficient to do the installs?
> > 
> > Thanks,
> > 
> > George
> > 
> > 
> > ------------------------------------------------------------------------------
> > This SF.net email is sponsored by Windows:
> > 
> > Build for Windows Store.
> > 
> > http://p.sf.net/sfu/windows-dev2dev
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
> 
> Build for Windows Store.
> 
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
                                          
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to