IM limitation and the Windows registry

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
donovaly
Posts: 43
Joined: 2004-10-04T16:24:55-07:00

IM limitation and the Windows registry

Post by donovaly »

Dear developers,

I use IM for an open source programs on Windows (namely for LyX). I have an installer that installs the whole bundle of LyX, Ghostscript and IM. It works fine so war, but only if the installation is done with admin permissions. But for none of the programs admin permissions are really necessary, only IM requires settings in

HKLM/Software/ImageMagick

I tried to just copy the IM files to a folder without setting any registry settings but that is not possible. I also tried to write the registry settings to HKCU instead of HKLM, but that also doesn't work.
It would be very, very useful, if IM does not require a registry key in HKLM. If registry keys are really necessary, it should allow to write them in HKCU.

Can this be implemented and/or is there any workaround?

thanks and regards
Uwe
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM limitation and the Windows registry

Post by magick »

Both methods should be supported (HKLM & HKCU) but we don't have the time to handle both right now. Look for HKCU in the next release of the ImageMagick binaries in about a week.
User avatar
whugemann
Posts: 289
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

Re: IM limitation and the Windows registry

Post by whugemann »

Right now, IM's Windows setup programm seems to write registry keys exclusively to HKCU instead of HKLM (at least version 6.7.4-2 on my Vista computer). This breaks code like presented in http://www.imagemagick.org/Usage/windows/#debugging, where the installation path is read from the registry. Is this intended to stay this way in the future?

I object to this change: Settings that affect every user should be stored in HKEY_LOCAL_MACHINE (HKLM), whereas HKEY_CURRENT_USER (HKCU) is intended for user-specific settings. Do you really think, the current version of IM should be a user-specific setting? How would you handle a situation where on user installed IM and another user installs a newer one? I think that this change will lead to trouble on the long run (not only with my code).

If you take a look in the registry, you will find that almost any program (including Gnu, Cygwin and Ghostscript) write part of their keys into the HKLM section of the registry. This means that you need adminstrator rights in order to run their installations. If you are not logged on as the local adminstrator (I bet that 99% of all users, including me, are), you can easily run the installation in adminstrator mode and thereby allow it to set HKLM keys.

I think that we should have discussed the implications of this change before you actually made it.
Wolfgang Hugemann
User avatar
whugemann
Posts: 289
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

Re: IM limitation and the Windows registry

Post by whugemann »

I think the viewtopic.php?f=1&t=20201 demonstrates the possible problems that can arise from this change.
Wolfgang Hugemann
Post Reply