diff --git a/html/admin/setup.php b/html/admin/setup.php
index a3d5314d6..8fabcc292 100644
--- a/html/admin/setup.php
+++ b/html/admin/setup.php
@@ -64,14 +64,14 @@ if ( strpos($inc_path,";") != 0 ) {
$os=0; /* $os is 0 for unix */
} else {
$new_path=$inc_path.':../../include:addon';
- $os=1; /* $os is 0 for windos */
+ $os=1; /* $os is 1 for windos */
}
set_include_path($new_path);
require_once('config_file.php');
/* The config file is created here */
if (isset($_POST['save_config'])) {
- $url=config_file_create($_POST);
+ $url=config_file_create($_POST,1,$os);
}
diff --git a/html/backup.php b/html/backup.php
index 8fec18056..0e887e337 100644
--- a/html/backup.php
+++ b/html/backup.php
@@ -39,9 +39,9 @@ if ($User->admin != 1) {
* \brief Make and restore backup
*/
/* For windows we need to set the path correctly */
-if ( isset(PG_PATH)) {
+if ( defined ('PG_PATH') )
putenv("PATH=",PG_PATH);
-}
+
if ( isset ($_REQUEST['sa']) ) {
if ( ! isset ($_REQUEST['d']) ||
! isset($_REQUEST['t']))
diff --git a/include/config_file.php b/include/config_file.php
index 68812db9e..fcdbd65cd 100644
--- a/include/config_file.php
+++ b/include/config_file.php
@@ -88,7 +88,7 @@ function config_file_form($p_array=null)
*\see
*\todo
*/
-function config_file_create($p_array,$from_setup=1) {
+function config_file_create($p_array,$from_setup=1,$os=0) {
extract ($p_array);
$add=($from_setup==1)?'..'.DIRECTORY_SEPARATOR:'';
$hFile= fopen($add.'..'.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'config.inc.php','w');
@@ -100,11 +100,20 @@ function config_file_create($p_array,$from_setup=1) {
fputs($hFile,"\n\r");
fputs($hFile, 'define("PG_PATH","'.$cpath'");');
fputs($hFile,"\n\r");
- fputs($hFile, 'define("PG_RESTORE","'.$cpath.DIRECTORY_SEPARATOR.'pg_restore ");');
- fputs($hFile,"\n\r");
- fputs($hFile, 'define("PG_DUMP","'.$cpath.DIRECTORY_SEPARATOR.'pg_dump ");');
- fputs($hFile,"\n\r");
- fputs($hFile, 'define ("PSQL","'.$cpath.DIRECTORY_SEPARATOR.'psql");');
+ if ( $os == 0 ) {
+ fputs($hFile, 'define("PG_RESTORE","'.$cpath.DIRECTORY_SEPARATOR.'pg_restore ");');
+ fputs($hFile,"\n\r");
+ fputs($hFile, 'define("PG_DUMP","'.$cpath.DIRECTORY_SEPARATOR.'pg_dump ");');
+ fputs($hFile,"\n\r");
+ fputs($hFile, 'define ("PSQL","'.$cpath.DIRECTORY_SEPARATOR.'psql");');
+ }
+ else {
+ fputs($hFile, 'define("PG_RESTORE","pg_restore.exe");');
+ fputs($hFile,"\n\r");
+ fputs($hFile, 'define("PG_DUMP","pg_dump.exe");');
+ fputs($hFile,"\n\r");
+ fputs($hFile, 'define ("PSQL","psql.exe");');
+ }
fputs($hFile,"\n\r");
fputs($hFile, 'define ("phpcompta_user","'.$cuser.'");');
fputs($hFile,"\n\r");