Re: Static or Shared MFC DLLs?
David Ching wrote:
Nothing beats static linking for ease of deployment. Nothing. You
don't have to worry about DLL's, and your app is xcopy deployable.
For initial deployment, I have no argument at all. Absolutely much
easier to install one big file instead of running an installer or
copying folders.
But when Microsoft finds bugs in their software -- and you know that
happens -- and they release a fix, static-linked programs will not use
the fix. The publisher of the program must himself rebuild the app with
the fix, and redeploy it to all users himself, rather than letting MS
deploy the fix via the DLL -- nothing beats that maintenance model --
nothing.
App-local deployment gives you the same easy of deployment and is xcopy
deployable (except now you have to xcopy a folder containing
redistributable DLL's and your .exe/.dll's), while offering the benefit
of sharing one instance of the CRT and MFC DLL's between several .exe's
and .dll's, if that is the makeup of your application. It also lets you
create MFC Extension DLL's, which is not possible with static linking.
Another thing MS likes to tout (but which I question whether is really a
big benefit) is that it lets user's independently update the CRT and MFC
DLL's (say for security fixes), and then Windows will load your app with
those updated DLL's instead of the ones your app-locally deploy. (To
me, this potentially can break your app, since your app is now running
with untested DLL's. However, MS would rather break your app than have
it use DLL's they deem insecure.)
If you have done an app-local deployment of the VC++ DLLs, the ones
released in the WinSxS are not used, even if they are updated. So, you
have the same lack of maintenance from Microsoft. But MS doesn't break
your app either.
VC_Redist deployment is something I've never done. As Scot says, a
killer disadvantage is that user can uninstall it separately, rendering
your app useless.
If a user chooses to uninstall something, he is shooting himself in the
foot if he doesn't understand the consequences. He could just as easily
delete or uninstall your application or replace the files it uses
under it. Users have the power to bring pain upon themselves, but that
doesn't discount the benefit of VC Redist. Of course, if you've never
done it, you don't know how easy it is -- except that it uses the
Windows Installer, which you strongly dislike.
I have no argument to your criticisms of the Windows Installer. It
needs some serious improvement work.