Speaking of DLLs, where are you placing them upon installation? Specifically in regards to Windows 7. Are you registering the DLL upon installation?

Speaking of DLLs, where are you placing them upon installation? Specifically in regards to Windows 7. Are you registering the DLL upon installation?

I've been placing them in the windows system directory and registering at install.

Comments

  1. IMHO placing anything in windows system directory is bad practice ....

    ReplyDelete
  2. I leave DLLs in my app's folder and register (the ones that require) during installation.

    ReplyDelete
  3. I neglected to mention that the DLLs in my case can be used across a couple of applications. If not in the sysatem directory then should they go in a common directory above the application dir?

    ReplyDelete
  4. Windows Directory is not recommended.  AppData or App Installation directory, combined with registration.  Also - load your DLLs explicitly, instead of implicitly.  Preferably with an explicit path:
    http://www.binaryplanting.com/guidelinesDevelopers.htm

    ReplyDelete
  5. Ive always tried to be tidy, and would put my DLLs with the app. it also means that if they have some old rancid version and a shiney new one, and its still called "Myapp.dll" or whatever it wont matter, it will use the relevant one.

    ReplyDelete
  6. If a COM DLL and you are targeting XP SP 3 and up, place in directory with app and use reg free COM.
    If non-com, use app dir. If common DLL with other apps use program files common dir.

    ReplyDelete
  7. I put DLLs in application directory or in sub-directory for any specific tasks, i.e. plugins in \PLUGINS. If DLL is used for more than one app, csidl_common_programs (Program Files\Common Files) would be nice enough

    ReplyDelete
  8. If you're not specifying the path when loading the DLL, which is very easy to do if they live in the Windows directory, you may introduce a security risk unless you take precautions. See http://support.microsoft.com/kb/2389418

    ReplyDelete
  9. Patrick: Shared 32 bit DLLS go in c:\Program Files (x86)\Common Files\My Company and you add the folder to the path either locally (in your own applications) or globally.  I prefer it if my applications can discover common sub-components without requiring users to modify the environment variables including the PATH, so I make my apps locate shared components and add things to their own paths, to avoid DLL hell and PATH environment variable hell.  

    Delphi's BPL path being a part of the global Windows path, is a common source of PATH hell issues since the PATH can only be up to a certain length before the Windows GUI will refuse to work anymore. I have had 6 versions of Delphi installed, and 10 third party packages, and 100 directories in my path before I started to take manual control over the mess.  

    So adding further to the mess on all my user's systems isn't something I would consider doing.

    ReplyDelete

Post a Comment