Hi Greg,

I had one other idea, you might be able to include your unmanaged dll as an 
embedded resource and have the CA copy it to a temp directory, then reference 
it from there.  It's a quick and dirty way to get it done, but it should work.  
Basically it would look like this:

 private void CopyResource(string resourceName, string file)
{
    using (Stream resource = 
GetType().Assembly.GetManifestResourceStream(resourceName))
    {
        if (resource == null)
        {
            throw new ArgumentException("No such resource", "resourceName");
        }
        using (Stream output = File.OpenWrite(file))
        {
            resource.CopyTo(output);
        }
    }
}


-----Original Message-----
From: GregS [mailto:gsh...@actuate.com] 
Sent: Wednesday, April 24, 2013 5:50 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] Including "third party" DLLs for installer to use

Nick, thanks for the reply.

I'm importing the old DLL into my custom action DLL using DllImport(), because 
Visual Studio won't allow me to add it as a reference to the project. I'm not 
entirely sure why, but I suspect it is because the old DLL is unmanaged code 
(written in Delphi 2007). I'm pretty sure my problem would disappear if I could 
add it as a reference as you suggest, but it doesn't seem possible.

The second suggestion might work. I suppose I could install the DLL as a 
component, run the custom actions, and then delete the DLL. However, some of 
the custom actions that use this DLL really should run before anything gets 
installed (for example validating that the user's license file is valid).

On the surface it seems it should be simple. I just need a way to have the old 
DLL bundled into the MSI and to be unpacked into the temporary installation 
folder along with the custom action DLL. If it's there, then the custom action 
DLL will be able to find it. 

I thought of another possible solution. Can someone point me to documentation 
about writing custom actions in unmanaged code? Specifically, about how to pass 
parameters from WiX to unmanaged code? I'm thinking that maybe I could take the 
old Delphi code that's in that DLL and redo the interfaces so they're in the 
format for custom actions. Then I could use the Delphi DLL as a custom action 
DLL directly and the problem would disappear.
I have access to Delphi for doing this and have time to write new interfaces.



--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Including-third-party-DLLs-for-installer-to-use-tp7585415p7585419.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only 
SaaS-based application performance monitoring service that delivers powerful 
full stack analytics. Optimize and monitor your browser, app, & servers with 
just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! 
http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to