Re: DLLs in c:\windows\system32



Hi Paul,

Welcome to DLL hell !

On 7/10/06, Paul Breeuwsma <gtkmm paulinternet nl> wrote:

Is it possible that someone changes the software that way that my app
looks in the windows
registry(HKEY_LOCAL_MACHINE\SOFTWARE\gtkmm\2.4\Path) where gtkmm is
installed and uses that dll files, instead of letting windows search for
them? An other advantage of that method is that c:\gtk\bin doesn't need
to be in the windows path variable.

If that is not possible, is there an other solution for my problem?

Yes, there is a solution. Your application installer should lookup the
location of GTK+ and gtkmm (say C:\GTK) from
HKEY_LOCAL_MACHINE\SOFTWARE\gtkmm\2.4\Path and
HKEY_LOCAL_MACHINE\SOFTWARE\GTK\2.0\Path (or DllPath) and create a new
registry entry called DllPath in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App
Paths\TheNameOfYourExeFile.exe. This DllPath should be a list with the
runtime directories for both gtkmm and GTK+ (in this example
C:\GTK+\bin). This way, TheNameOfYourExeFile.exe will first look in
C:\GTK+\bin when loading the GTK+ and gtkmm DLLs, thus bypassing the
directory list stored in the PATH environment variable.

Please note that writing to HKEY_LOCAL_MACHINE requires Admin rights.
Another option is to write to HKEY_CURRENT_USER for "current user
only"-type of installation. This is what the gtkmm installer is doing,
giving you the choice between system-wide or local user installation.

May I suggest NSIS (http://nsis.sourceforge.net) for installer creation ?

Alternatively, you can simply provide a TheNameOfYourExeFile.reg file
that sets the appropriate registry entries.

Cedric



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]