diff --git a/plugins/thumbnails/thumbnails.php b/plugins/thumbnails/thumbnails.php index 811c526..fb5c055 100755 --- a/plugins/thumbnails/thumbnails.php +++ b/plugins/thumbnails/thumbnails.php @@ -170,6 +170,11 @@ class thumbnailGenerator extends BaseProcessor $default->log->debug('Thumbnail Generator Plugin: PDF file does not exist, cannot generate a thumbnail'); return false; } + + if (WINDOWS_OS) { + $thumbnailfile = KT_DIR . $thumbnailfile; + } + // if a previous version of the thumbnail exists - delete it if (file_exists($thumbnailfile)) { @unlink($thumbnailfile); @@ -177,7 +182,10 @@ class thumbnailGenerator extends BaseProcessor // do generation // if (extension_loaded('imagick')) { $pathConvert = (!empty($default->convertPath)) ? $default->convertPath : 'convert'; - $result = shell_exec("{$pathConvert} -size 200x200 {$pdfFile}[0] -resize 200x200 $thumbnailfile"); + if (WINDOWS_OS) { + $pathConvert = '"' . $pathConvert . '"'; + } + $result = KTUtil::pexec("{$pathConvert} -size 200x200 {$pdfFile}[0] -resize 200x200 $thumbnailfile"); return true; //}else{ //$default->log->debug('Thumbnail Generator Plugin: Imagemagick not installed, cannot generate a thumbnail'); @@ -212,6 +220,10 @@ class ThumbnailViewlet extends KTDocumentViewlet { global $default; $varDir = $default->internalVarDirectory; $thumbnailfile = $varDir . '/thumbnails/'.$documentId.'.jpg'; + + if (WINDOWS_OS) { + $thumbnailfile = KT_DIR . $thumbnailfile; + } // if the thumbnail doesn't exist try to create it if (!file_exists($thumbnailfile)){ diff --git a/setup/wizard/steps/database.php b/setup/wizard/steps/database.php index a9003d4..2e4d670 100644 --- a/setup/wizard/steps/database.php +++ b/setup/wizard/steps/database.php @@ -781,7 +781,7 @@ class database extends Step if($binaries) { foreach ($binaries as $k=>$bin) { if($k != 1) { - $updateBin = 'UPDATE config_settings c SET c.value = "'.$bin.'" where c.group_name = "externalBinary" and c.display_name = "'.$k.'";'; + $updateBin = 'UPDATE config_settings c SET c.value = "'.str_replace('\\', '\\\\', $bin).'" where c.group_name = "externalBinary" and c.display_name = "'.$k.'";'; $this->util->dbUtilities->query($updateBin); } } @@ -790,6 +790,7 @@ class database extends Step // if Windows, hard code (relative to SYSTEM_ROOT) where we expect the Zend MSI installer to have placed them if (WINDOWS_OS) { $winBinaries = array('php' => 'ZendServer\bin\php.exe', 'python' => 'openoffice\program\python.exe', + 'java' => 'jre\bin\java.exe', // since we don't know where convert is yet, let's just assume somewhere for now (manually test) 'convert' => 'imagick\convert.exe', 'zip' => 'bin\zip\zip.exe', 'unzip' => 'bin\unzip\unzip.exe');