Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

CAs running DLLs in the Binary Table


4 replies to this topic

Scott Mayham

Scott Mayham
  • Full Members
  • 54 posts

Posted 10 May 2011 - 16:46

Folks,

A very simple question - Can one DLL, set up as a Custom Action and streamed from the Binary Table, access and "call" a method in a second DLL also located in the Binary Table?

The scenarion is MSI > InstallUtilLib.dll > OurDll. The Installer and the CAs are all produced from VisualStudio 2010. InstallUtilLib handles the interfacing between MSI's COM view of the world, and our .NET DLL. It works fine, but VS only knows how to produce Deferred CAs, and while it puts InstallUtilLib in the Binary Table, OurDll is installed along with the rest of our App. To move the Ca to Immediate Mode (pre-file-deployment), OurDll would also need to be in the Binary Table.

Can I even do such a thing?

Regards,
ScottM
T. Scott Mayham
Senior Software Engineer - Innovations
678 319 8384
Scott.Mayham@Infor.com

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 11 May 2011 - 14:45

While I'm not sure that what you want to do will work, if you want your custom action DLL to use another file from the Binary table you'd have to add a custom action that would stream the second file from the Binary table first. See sample "Streaming a File From the Binary Table" at http://www.installsi...s/en/msi/ca.htm

For those using InstallShield: you can simply put the file in the Support Files section. These files get extracted to the temp folder at the beginning of the setup.

Scott Mayham

Scott Mayham
  • Full Members
  • 54 posts

Posted 11 May 2011 - 15:10

Stefan,

Thanks for your answer, and it makes a great deal of sense. (And, yes, how I wish I could use my old InstallShield friend, SUPPORTDIR!)

I have a couple of followup questions:

Assuming that I overcome the sequencing issues you mention, and that the first DLL can find and use the second, I've not begun to address the fact that .NET DLLs are really Assemblies. Wouldn't I have to also provide all our DLL's Assembly "goo" (normally installed Deferred) in order for it to even be usable?

Is it possible that this is the very reason that VS-built CA DLLs are ever only set up to run Deferred, after all of the Assembly stuff has been attended to?

Thanks and Regards,
ScottM
T. Scott Mayham
Senior Software Engineer - Innovations
678 319 8384
Scott.Mayham@Infor.com

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 11 May 2011 - 16:52

QUOTE
Wouldn't I have to also provide all our DLL's Assembly "goo" (normally installed Deferred) in order for it to even be usable?
Frankly, I don't know - sorry, not a .NET expert. (Maybe ask Christopher Painter)

QUOTE
Is it possible that this is the very reason that VS-built CA DLLs are ever only set up to run Deferred
I think the reason for deferred is permissions. Immediate custom actions run with limited permissions (stripped down admin token) thanks to UAC.

Scott Mayham

Scott Mayham
  • Full Members
  • 54 posts

Posted 12 May 2011 - 16:59

Stefan,

QUOTE
Frankly, I don't know - sorry, not a .NET expert. (Maybe ask Christopher Painter)


I did - and he was kind enough to steer me to WIX/DTF.

This tool makes it possible for VS to produce a "hybrid" C# dll, which from inside looks pretty much like any other C# dll, but from the outside, the interfaces are all W32/COM, so it can be Streamed in the Binary table and launched as a Custom Action.

DTF also provides for the construction of a MergeModule in VisualStudio, which consumes the DLL and schedules it to run Immediate. The DLL sets an MSI Property with no issues, and adds it's entries to the MSI log just fine. I had to add the LaunchCondition and Property parts myself using a post-build VbScript, but once I learn more about WIX I'm sure I can put that kind of stuff in the MM.

At any rate the problem is elegantly solved. WIX/DTF and Christopher Painter have both gained a fan!

Regards,
ScottM
T. Scott Mayham
Senior Software Engineer - Innovations
678 319 8384
Scott.Mayham@Infor.com