diff --git a/addons/report/models/report.py b/addons/report/models/report.py
index 55edb06fa6f0bad2efb15b4ad68e750b0d64a532..0233af6312e82f842263a174a1c90f54c933cac0 100644
--- a/addons/report/models/report.py
+++ b/addons/report/models/report.py
@@ -23,7 +23,8 @@ from openerp import api
 from openerp import SUPERUSER_ID
 from openerp.exceptions import AccessError
 from openerp.osv import osv
-from openerp.tools import config, which
+from openerp.tools import config
+from openerp.tools.misc import find_in_path
 from openerp.tools.translate import _
 from openerp.addons.web.http import request
 from openerp.tools.safe_eval import safe_eval as eval
@@ -48,8 +49,7 @@ from pyPdf import PdfFileWriter, PdfFileReader
 _logger = logging.getLogger(__name__)
 
 def _get_wkhtmltopdf_bin():
-    defpath = os.environ.get('PATH', os.defpath).split(os.pathsep)
-    return which('wkhtmltopdf', path=os.pathsep.join(defpath))
+    return find_in_path('wkhtmltopdf')
 
 
 #--------------------------------------------------------------------------
@@ -60,7 +60,7 @@ try:
     process = subprocess.Popen(
         [_get_wkhtmltopdf_bin(), '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE
     )
-except (OSError, IOError):
+except (OSError, IOError, ValueError):
     _logger.info('You need Wkhtmltopdf to print a pdf version of the reports.')
 else:
     _logger.info('Will use the Wkhtmltopdf binary at %s' % _get_wkhtmltopdf_bin())
diff --git a/openerp/tools/misc.py b/openerp/tools/misc.py
index 1f90207341f36f107895006ecd1b442adb34e403..c3f3b8ba3f3e3b8debc91211e194364ab2f0016c 100644
--- a/openerp/tools/misc.py
+++ b/openerp/tools/misc.py
@@ -65,9 +65,13 @@ _logger = logging.getLogger(__name__)
 # We include the *Base ones just in case, currently they seem to be subclasses of the _* ones.
 SKIPPED_ELEMENT_TYPES = (etree._Comment, etree._ProcessingInstruction, etree.CommentBase, etree.PIBase)
 
+DEFAULT_PATH = os.environ.get('PATH', os.defpath).split(os.pathsep)
+if config.get('bin_path'):
+    DEFAULT_PATH.append(config['bin_path'])
+
 def find_in_path(name):
     try:
-        return which(name)
+        return which(name, path=os.pathsep.join(DEFAULT_PATH))
     except IOError:
         return None
 
diff --git a/setup/win32/setup.nsi b/setup/win32/setup.nsi
index 73def65df5993b8d9f403d6b904e53bc9fa531c4..992f9215f952fa34d4f219919cf3a83b396d031a 100755
--- a/setup/win32/setup.nsi
+++ b/setup/win32/setup.nsi
@@ -249,6 +249,7 @@ Section $(TITLE_OpenERP_Server) SectionOpenERP_Server
     WriteIniStr "$INSTDIR\server\openerp-server.conf" "options" "db_port" $TextPostgreSQLPort
     # Fix the addons path
     WriteIniStr "$INSTDIR\server\openerp-server.conf" "options" "addons_path" "$INSTDIR\server\openerp\addons"
+    WriteIniStr "$INSTDIR\server\openerp-server.conf" "options" "bin_path" "$INSTDIR\thirdparty"
 
     # if we're going to install postgresql force it's path,
     # otherwise we consider it's always done and/or correctly tune by users