Salome HOME
Fix a bug of config file for RedHat 9 - correct binaries distribution path
[tools/install.git] / src / SALOME_InstallWizard.cxx
index 156682a04345f090e73fada97185a9f0f1d35858..87fe009202beb1ffcceed957e8ca8b43a18cae7a 100644 (file)
@@ -1052,30 +1052,32 @@ bool SALOME_InstallWizard::acceptData( const QString& pageTitle )
     QString tmpFolder = QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME;
     QString tgtFolder = QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() );
     myThread->clearCommands();
-    for ( unsigned i = 0; i < natives.count(); i++ ) {
-      item = findItem( natives[ i ] );
-      if ( item ) {
-       QString dependOn = productsMap[ item ].getDependancies().join(" ");
-       QString script = "cd ./config_files/;" + item->text(2) + " try_native " +
-               QFileInfo( tmpFolder ).absFilePath() + " " + QDir::currentDirPath() + "/Products " + QFileInfo( tgtFolder ).absFilePath() + " " +
-               QUOTE(dependOn) + " " + item->text(0);
+    if ( natives.count() > 0 ) {
+      for ( unsigned i = 0; i < natives.count(); i++ ) {
+       item = findItem( natives[ i ] );
+       if ( item ) {
+         QString dependOn = productsMap[ item ].getDependancies().join(" ");
+         QString script = "cd ./config_files/;" + item->text(2) + " try_native " +
+                 QFileInfo( tmpFolder ).absFilePath() + " " + QDir::currentDirPath() + "/Products " + QFileInfo( tgtFolder ).absFilePath() + " " +
+                 QUOTE(dependOn) + " " + item->text(0);
 
-       myThread->addCommand( item, script );
-      }
-      else {
-       QMessageBox::warning( this, 
-                             tr( "Warning" ), 
-                             tr( "%The product %1 %2 required for installation.\n"
-                                 "Please, add this product in config.xml file.").arg(item->text(0)).arg(item->text(1)),
-                             QMessageBox::Ok, 
-                             QMessageBox::NoButton, 
-                             QMessageBox::NoButton );
-       return false;
+         myThread->addCommand( item, script );
+       }
+       else {
+         QMessageBox::warning( this, 
+                               tr( "Warning" ), 
+                               tr( "%The product %1 %2 required for installation.\n"
+                                   "Please, add this product in config.xml file.").arg(item->text(0)).arg(item->text(1)),
+                               QMessageBox::Ok, 
+                               QMessageBox::NoButton, 
+                               QMessageBox::NoButton );
+         return false;
+       }
       }
+      WarnDialog::showWarnDlg( this, true );
+      myThread->start();
+      return true; // return in order to avoid default postValidateEvent() action
     }
-    WarnDialog::showWarnDlg( this, true );
-    myThread->start();
-    return true; // return in order to avoid default postValidateEvent() action
   }
   return InstallWizard::acceptData( pageTitle );
 }