John,
> I would like to be able to embed a .dll into a binary package. Can this be
> done?
Probably, though some might (probably will<g>) argue that it's not a good
idea.
You could load the bytes (use a binary file stream to read it, of course)
into a global in the package, and then write the file to disk, possibly when
the package is loaded - one of the install scripts might be able to do it.
Things to watch for include versioning and whether or not an existing copy
of the DLL is in use. You'd also have to write the file to the correct
directory, paying particular attention to the file's time stamps and
possibly other attributes. If you do this, you'll probably want to use ZLib
to compress the byte array holding the "file" - see my web site for small
boost in the right direction re ZLib.
You might also be able to drive the Windows Installer to do the job, though
you'd still have a problem with "getting the file". Instead of a DLL, you'd
be writing an msi file somewhere (though that's safer to do because the msi
file can go "anywhere") and then triggering an installation. Also, I must
say that my first collision with the Windows Installer left me somewhat
bearish. Among other concerns, it's sufficiently complicated that I fear
misusing it is a real risk for all but the most immersed gurus. In
fairness, I was working from the SDK, but I had very modest goals. In the
end, problems wouldn't stay fixed and I decided that the risks outweighed
the benefits. It was a good exercise though, because my rearranged Wise
installer projects are better organized, in part due to recompiling DLLs for
limited dependency rather than size.
Finally, don't forget the ClickTeam install maker that Ian brought to our
attention. While I prefer Wise (still using v5 to good advantage), the
price comparison is very much in ClickTeam's favor.
Have a good one,
Bill
--
Wilhelm K. Schwab, Ph.D.
[hidden email]