done
 }
 
+update_win32()
+{
+   if [ -d $cwd/build/src/win32/release32   \
+     -a -d $cwd/build/src/win32/release64 ] \
+   || [ -d $cwd/release32 -a -f $cwd/release64 ]
+   then
+       echo "Try to upgrade the FileDaemon"
+       wget -qO - "$WIN32_ADDR:8091/install" | grep OK >/dev/null
+   fi
+}
+
 debug_wait()
 {
   if test "x${REGRESS_WAIT}" = "x1"; then
 
 #     to run and connect to it.
 # * Create c:\regress\test on the Windows machine
 # * Allow ports through the Win firewall for perl 8091 and bacula-fd 9102
+# * If you put bacula binaries in release32 and release64, the script will
+#   update binaries
 # * Run win32-fd-test regression
 #
 TestName="win32-fd-test"
 wget -qO $tmp/init1.log "$URL/init_attrib_test?source=$WIN32_FILE"
 wget -qO $tmp/init2.log "$URL/init_weird_runscript_test?source=$WIN32_FILE"
 wget -qO $tmp/clean.log "$URL/cleandir?source=$WIN32_FILE/restore"
-echo "Done wgets ..."
 
+# try to upgrade win32 binaries
+update_win32
       
 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
 @output