We're updating the issue view to help you get more done. 

Automatic detection of utilities in path.

Description

All system utilities used by CA and available in PATH can be automatically located for both Windows and Posix systems using something like this ('where' is available on Windows 2003+; use executable name without extension, and a fully qualified path should be returned for Windows and Posix):

  1. Goes into setup.php
    if (defined('PHP_WINDOWS_VERSION_BUILD')) {
    define('_CA_SYSTEM_WINDOWS_', true);
    }

public static function getExecutable($name) {
if (_CA_SYSTEM_WINDOWS_) {
$cmdWhich = 'where ' . $name;
} else {
$cmdWhich = 'which ' . $name;
}

putenv('Path=' . getenv('Path')); // Somehow, only after this statement is executed, the environment variable PATH is updated with components added by SetEnv in Apache conf files.
$executablePath = shell_exec($cmdWhich);

if ($executablePath) {
$executableCache[$name] = $executablePath;
return $executablePath;
} else {
$executableCache[$name] = false;
return false;
}
}

$tool_name = 'exiftool';
getExecutable($tool_name);

Environment

Windows 7, Bitnami WAMP

Assignee

Seth

Reporter

oper251

Labels

None

Components

Affects versions

Priority

Minor
Configure