Salome HOME
Remove build directory
[tools/install.git] / src / SALOME_InstallWizard.cxx
index 8f40f0393a261e1290ce82d48d0f18a03491a3f4..ba1c90a10e1d84049901c33a371b4e92e1bb7309 100644 (file)
@@ -3,7 +3,7 @@
 //  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
 //  Project   : SALOME
 //  Module    : Installation Wizard
-//  Copyright : 2002-2009 CEA
+//  Copyright : 2002-2010 CEA
 
 #include "globals.h"
 
@@ -61,6 +61,9 @@
 QString tmpDirName() { return QString(  "/INSTALLWORK" ) + QString::number( getpid() ); }
 #define TEMPDIRNAME tmpDirName()
 
+// uncomment next line to redirect all shell output (usually for errors) to /dev/null device
+// #define USE_DEV_NULL
+
 // ================================================================
 /*!
  *  Script
@@ -313,8 +316,15 @@ static bool makeDir( const QString& theDir, QString& theCreated )
       if ( !fi.exists() ) {
        // VSR: Create directory and set permissions to allow other users to remove it
        Script script;
-       script << "mkdir"     << QUOTE( fi.absFilePath() ) << ">& /dev/null" << "&&";
-       script << "chmod 777" << QUOTE( fi.absFilePath() ) << ">& /dev/null";
+       script << "mkdir" << QUOTE( fi.absFilePath() );
+#ifdef USE_DEV_NULL
+       script << ">& /dev/null";
+#endif
+       script << "&&";
+       script << "chmod 777" << QUOTE( fi.absFilePath() );
+#ifdef USE_DEV_NULL
+       script << ">& /dev/null";
+#endif
        ___MESSAGE___( "script = " << script.script().latin1() );
        if ( system( script.script().latin1() ) )
          return false;
@@ -328,7 +338,10 @@ static bool makeDir( const QString& theDir, QString& theCreated )
   if ( !QFileInfo( aDir ).exists() ) {
     // VSR: Create directory, other users should NOT have possibility to remove it!!!
     Script script;
-    script << "mkdir" << QUOTE( aDir ) << ">& /dev/null";
+    script << "mkdir" << QUOTE( aDir );
+#ifdef USE_DEV_NULL
+    script << ">& /dev/null";
+#endif
     ___MESSAGE___( "script = " << script.script().latin1() );
     if ( system( script.script().latin1() ) )
       return false;
@@ -465,7 +478,7 @@ public:
                      .arg( __IW_VERSION_MINOR__ ) \
                      .arg( __IW_VERSION_PATCH__ ) );
     QLabel* copyright = new QLabel( this, "copyright" );
-    copyright->setText( "<b>Copyright</b> &copy; 2007-2009 CEA/DEN" );
+    copyright->setText( "<b>Copyright</b> &copy; 2007-2011 CEA/DEN" );
     QFont font = title->font();
     font.setPointSize( (int)( font.pointSize() * 1.8 ) );
     title->setFont( font );
@@ -559,9 +572,9 @@ SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName,
   addLogo( pixmap( pxLogo ) );
 
   // set defaults
-  setVersion( "5.1.2" );
+  setVersion( "6.4.0" );
   setCaption( tr( "SALOME %1" ).arg( myVersion ) );
-  setCopyright( tr( "<h5>Copyright &copy; 2007-2009 CEA/DEN, EDF R&amp;D, OPEN CASCADE<br></h5>"
+  setCopyright( tr( "<h5>Copyright &copy; 2007-2011 CEA/DEN, EDF R&amp;D, OPEN CASCADE<br></h5>"
                "<h5>Copyright &copy; 2003-2007 OPEN CASCADE,<br>EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&amp;D,<br>LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</h5>" ));
   setLicense( tr( "<h5>GNU LGPL</h5>" ) );
 
@@ -647,7 +660,10 @@ SALOME_InstallWizard::~SALOME_InstallWizard()
   int PID = (int)shellProcess->processIdentifier();
   if ( PID > 0 ) {
     Script script;
-    script << "kill -9" << QString::number( PID ) << ">& /dev/null";
+    script << "kill -9" << QString::number( PID );
+#ifdef USE_DEV_NULL
+    script << ">& /dev/null";
+#endif
     ___MESSAGE___( "script: " << script.script().latin1() );
     if ( system( script.script().latin1() ) ) {
       // error
@@ -2429,7 +2445,9 @@ void SALOME_InstallWizard::onFinishButton()
       script << (*it).script() << "execute";
       script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
       script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
+#ifdef USE_DEV_NULL
       script << ">& /dev/null";
+#endif
       ___MESSAGE___( "script: " << script.script().latin1() );
       if ( (*it).script().isEmpty() || system( script.script().latin1() ) ) {
        QMessageBox::warning( this,
@@ -2544,7 +2562,9 @@ void SALOME_InstallWizard::clean(bool rmDir)
   script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
   script << "remove_tmp.sh" << QUOTE( tempFolder->text().stripWhiteSpace() + TEMPDIRNAME );
   script << QUOTE( getAllProducts( productsMap ) );
+#ifdef USE_DEV_NULL
   script << ">& /dev/null";
+#endif
   ___MESSAGE___( "script = " << script.script().latin1() );
   if ( system( script.script().latin1() ) ) {
     // error
@@ -2554,7 +2574,9 @@ void SALOME_InstallWizard::clean(bool rmDir)
   if ( rmDir && !tmpCreated.isNull() ) {
     script.clear();
     script << "rm -rf" << QUOTE( tmpCreated );
+#ifdef USE_DEV_NULL
     script << ">& /dev/null";
+#endif
     if ( system( script.script().latin1() ) ) {
       // error
     }
@@ -2655,7 +2677,7 @@ void SALOME_InstallWizard::pageChanged( const QString & mytitle)
     }
     // add extra products to install list
     extraProducts.clear();
-    extraProducts.insert( "gcc", "gcc-common.sh" );
+    //extraProducts.insert( "gcc", "gcc-common.sh" );
     if ( refPlatform == commonPlatform && installType == Binaries )
       extraProducts.insert( "DebianLibsForSalome", "DEBIANFORSALOME-3.1.sh" );
   }
@@ -2696,7 +2718,9 @@ void SALOME_InstallWizard::pageChanged( const QString & mytitle)
        script << (*it).script() << "check_enabled";
        script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
        script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
+#ifdef USE_DEV_NULL
        script << ">& /dev/null";
+#endif
        ___MESSAGE___( "script: " << script.script().latin1() );
        (*it).button()->setEnabled( !(*it).script().isEmpty() && !system( script.script().latin1() ) );
       }
@@ -2850,7 +2874,7 @@ void SALOME_InstallWizard::onStart()
     item = (QCheckListItem*)( item->nextSibling() );
   }
   // if something at all is selected
-  if ( (int)toInstall.count() > 1 ) {
+  if ( (int)toInstall.count() > 0 ) {
 
     if ( installType == Compile ) {
       // update status label