Last modified: 2013-10-23 18:17:39 UTC
1) i have a file called convert.exe on my system's PATH. it's a popular name for an executable in the path. even MS have one. 2) if my convert.exe program is being run, it brings up GUI. 3) Installer.php is running the command "convert.exe -version" to check whether imagemagick is on the path. $names = array( wfIsWindows() ? 'convert.exe' : 'convert' ); 4) my convert.exe was activated, but the GUI is not visible since it's running under apache. 5) apache/php is waiting forever for the program to execute (why php max_execution_time was not in effect? i don't know!) 6) results: a) any browser trying to run the installer hangs forever b) several CMD.EXE and CONVERT.EXE processes may be running in the background endlessly. how to recreate (why? this is pretty obvious) - rename a GUI program -> convert.exe, put it in the PATH, and run the installer. how to fix: ask the user for full path for convert.exe don't assume "convert.exe -version" belongs just to imagemagick !!! or any other command line with a common name as "convert", for that matter. au contraire -- imagemagick on windows doesn't necessarily adds itself to the PATH thanks
workaround: find your convert.exe and rename it during installation. the installer might find the correct path anyway. after it's finished, i think it's safe to rename back your own file.
The installer detects convert.exe in includes/installer/Installer.php with envCheckGraphics(). That one will look at some common paths and PATH environment paths (with locateExecutableInDefaultPaths()). One possibility would be to sneak a specific lookup using whatever default path is used ( C:\Program Files\ImageMagick\bin\convert.exe )? I thought about adding a timeout but wfShellExec() does not support it since it uses PHP pass_thru() internally. PHP exec() does support a timeout option, but that was removed by us with r31044 since it « corrupted white spaces ».
Reducing severity to major. This bug does not block development nor crash / destroy any data.
Well, we could read exe's header and determine if it's a console or GUI app:)
(In reply to comment #4) > Well, we could read exe's header and determine if it's a console or GUI app:) A console app can be interactive too.
i think the simplest solution might be 1) either look for imagemagick folder in the standard directories, or 2) ask the user to provide the path.