Page 1 of 1

Why does it work differently from different locations? C++

Posted: 2013-05-01T08:14:23-07:00
by mczarnek
When I install ImageMagick and run my code which calls InitializeMagick(NULL), it works fine. However when I copy and paste the contents of the program files folder somewhere else and call InitializeMagick(as well as uninstall it from the normal directory), it crashes. Specifically when trying to draw.

Any idea why? Way to fix it without spending a lot of time messing with ImageMagick source code?

Somehow it finds that directory even if I remove it from the system PATH variable.

Re: Why does it work differently from different locations? C

Posted: 2013-05-01T11:32:32-07:00
by mczarnek
Actually after a couple very frustrating days, I fixed this one on my own. Turns out they store the path to the working library is stored in the registry.

So in case someone comes across this a year from now, here's what I did:
Go into Windows Registry and edit the 'HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/ImageMagick' registry keys so they point to the correct location.

There may be a better solution involving recompiling code or something... it seems like a bug since it is supposed to be able to work from a local directory but this does the trick for my purposes.