// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2008 CEA
+// Copyright : 2002-2009 CEA
#include "globals.h"
#include <qradiobutton.h>
#include <qbuttongroup.h>
#include <qregexp.h>
+#include <qdir.h>
#ifdef WNT
#include <iostream.h>
QString tmpDirName() { return QString( "/INSTALLWORK" ) + QString::number( getpid() ); }
#define TEMPDIRNAME tmpDirName()
+// ================================================================
+/*!
+ * Script
+ * Helper class to generate shell command
+ */
+// ================================================================
+class Script
+{
+public:
+ Script( const QString& cmd = QString::null, const QString& sep = " " ) : mySeparator( sep )
+ {
+ append( cmd );
+ }
+ void append( const QString& cmd )
+ {
+ if ( !cmd.isEmpty() ) myList.append( cmd );
+ }
+ Script& operator<<( const QString& cmd )
+ {
+ append( cmd );
+ return *this;
+ }
+ QString script() const
+ {
+ return myList.join( mySeparator );
+ }
+ void clear()
+ {
+ myList.clear();
+ }
+private:
+ QStringList myList;
+ QString mySeparator;
+};
+
// ================================================================
/*!
* ProcessThread
- * Class for executing systen commands
+ * Class for executing system commands
*/
// ================================================================
static QMutex myMutex(false);
QFileInfo fi( aDir.left( start ) );
if ( !fi.exists() ) {
// VSR: Create directory and set permissions to allow other users to remove it
- QString script = "mkdir " + fi.absFilePath();
- script += "; chmod 777 " + fi.absFilePath();
- script += " > /dev/null";
- if ( system( script.latin1() ) )
+ Script script;
+ script << "mkdir" << QUOTE( fi.absFilePath() ) << ">& /dev/null" << "&&";
+ script << "chmod 777" << QUOTE( fi.absFilePath() ) << ">& /dev/null";
+ ___MESSAGE___( "script = " << script.script().latin1() );
+ if ( system( script.script().latin1() ) )
return false;
// VSR: Remember the top of the created directory (to remove it in the end of the installation)
if ( theCreated.isNull() )
}
if ( !QFileInfo( aDir ).exists() ) {
// VSR: Create directory, other users should NOT have possibility to remove it!!!
- QString script = "mkdir " + aDir;
- script += " > /dev/null";
- if ( system( script.latin1() ) )
+ Script script;
+ script << "mkdir" << QUOTE( aDir ) << ">& /dev/null";
+ ___MESSAGE___( "script = " << script.script().latin1() );
+ if ( system( script.script().latin1() ) )
return false;
// VSR: Remember the top of the created directory (to remove it in the end of the installation)
if ( theCreated.isNull() )
.arg( __IW_VERSION_MINOR__ ) \
.arg( __IW_VERSION_PATCH__ ) );
QLabel* copyright = new QLabel( this, "copyright" );
- copyright->setText( "<b>Copyright</b> © 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE<br><br>"
- "<b>Copyright</b> © 2003-2007 OPEN CASCADE,<br>EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D,<br>LEG, PRINCIPIA R&D, BUREAU VERITAS");
+ copyright->setText( "<b>Copyright</b> © 2007-2009 CEA/DEN" );
QFont font = title->font();
font.setPointSize( (int)( font.pointSize() * 1.8 ) );
title->setFont( font );
addLogo( pixmap( pxLogo ) );
// set defaults
- setVersion( "5.1.0" );
+ setVersion( "5.1.3" );
setCaption( tr( "SALOME %1" ).arg( myVersion ) );
- setCopyright( tr( "<h5>Copyright © 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE<br></h5>"
+ setCopyright( tr( "<h5>Copyright © 2007-2009 CEA/DEN, EDF R&D, OPEN CASCADE<br></h5>"
"<h5>Copyright © 2003-2007 OPEN CASCADE,<br>EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D,<br>LEG, PRINCIPIA R&D, BUREAU VERITAS</h5>" ));
setLicense( tr( "<h5>GNU LGPL</h5>" ) );
SALOME_InstallWizard::~SALOME_InstallWizard()
{
shellProcess->kill(); // kill it for sure
- QString script = "kill -9 ";
int PID = (int)shellProcess->processIdentifier();
if ( PID > 0 ) {
- script += QString::number( PID );
- script += " > /dev/null";
- ___MESSAGE___( "script: " << script.latin1() );
- if ( system( script.latin1() ) ) {
+ Script script;
+ script << "kill -9" << QString::number( PID ) << ">& /dev/null";
+ ___MESSAGE___( "script: " << script.script().latin1() );
+ if ( system( script.script().latin1() ) ) {
+ // error
}
}
delete myThread;
MapXmlFiles xmlMap;
QStringList xmlList;
if ( !aXmlFileName.isEmpty() )
- xmlList.append( aXmlFileName );
+ xmlList.append( QFileInfo( aXmlFileName ).absFilePath() );
else {
QDir dir( rootDirPath() );
- xmlList = dir.entryList( "*.xml", QDir::Files | QDir::Readable );
+ QStringList entries = dir.entryList( "*.xml", QDir::Files | QDir::Readable );
+ if ( entries.remove( "config.xml" ) )
+ entries.append( "config.xml" );
+ for ( uint i = 0; i < entries.count(); i++ )
+ xmlList.append( QDir( rootDirPath() ).filePath( entries[i] ) );
}
- if ( xmlList.remove( "config.xml" ) )
- xmlList.append( "config.xml" );
// XML files parsing
QFile file;
QDomDocument doc( "xml_doc" );
progressView = new ProgressView( widget );
progressView->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
progressView->setMinimumSize( 100, 10 );
+ // possibility to ignore all errors
+ ignoreErrCBox = new QCheckBox( tr( "Ignore errors" ), widget );
+ setAboutInfo( ignoreErrCBox, tr( "Check this option if you want to proceed installation \nprocess even there will be some errors" ) );
+ ignoreErrCBox->setChecked( false );
+ // product installation status bar
statusLab = new QLabel( widget );
statusLab->setFrameShape( QButtonGroup::LineEditPanel );
setAboutInfo( progressView, tr( "Installation status on the selected products" ) );
// layouting
layout->addRowSpacing( 0, 6 );
- layout->addWidget( resultLab, 1, 0 );
- layout->addWidget( progressView, 2, 0 );
- layout->addWidget( statusLab, 3, 0 );
+ layout->addWidget( resultLab, 1, 0 );
+ layout->addWidget( progressView, 2, 0 );
+ layout->addWidget( ignoreErrCBox, 3, 0 );
+ layout->addWidget( statusLab, 4, 0 );
// layouting
pageLayout->addWidget( splitter, 0, 0 );
// adding page
return false;
}
// run script that checks available disk space for installing of products // returns 1 in case of error
+ QDir rd( rootDirPath() );
QFileInfo fi( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) );
- QString script = "./config_files/checkSize.sh '";
- script += fi.absFilePath();
- script += "' ";
- script += QString( "%1" ).arg( totSize );
- ___MESSAGE___( "script = " << script.latin1() );
- if ( system( script ) ) {
+ Script script;
+ script << QUOTE( rd.filePath( "config_files/checkSize.sh" ) );
+ script << QUOTE( fi.absFilePath() ) << QString::number( totSize );
+ ___MESSAGE___( "script = " << script.script().latin1() );
+ if ( system( script.script().latin1() ) ) {
QMessageBox::critical( this,
tr( "Out of space" ),
tr( "There is no available disk space for installing of selected products" ),
// run script that check available disk space for temporary files
// returns 1 in case of error
QFileInfo fit( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) );
- QString tscript = "./config_files/checkSize.sh '";
- tscript += fit.absFilePath();
- tscript += "' ";
- tscript += QString( "%1" ).arg( tempSize );
- ___MESSAGE___( "script = " << tscript.latin1() );
- if ( system( tscript ) ) {
+ Script tscript;
+ tscript << QUOTE( rd.filePath( "config_files/checkSize.sh" ) );
+ tscript << QUOTE( fit.absFilePath() ) << QString::number( tempSize );
+ ___MESSAGE___( "script = " << tscript.script().latin1() );
+ if ( system( tscript.script().latin1() ) ) {
QMessageBox::critical( this,
tr( "Out of space" ),
tr( "There is no available disk space for the temporary files" ),
}
// check installation script existence
else {
- QFileInfo fi( QString("./config_files/") + item->text(2) );
+ QDir rd( rootDirPath() );
+ QFileInfo fi( rd.filePath( QString( "config_files/%1" ).arg( item->text(2) ) ) );
if ( !fi.exists() || !fi.isExecutable() ) {
QMessageBox::warning( this,
tr( "Error" ),
- tr( "The script %1 required for %2 doesn't exist or doesn't have execute permissions.").arg("./config_files/" + item->text(2)).arg(item->text(0)),
+ tr( "The script %1 required for %2 doesn't exist or doesn't have execute permissions.").arg(fi.filePath()).arg(item->text(0)),
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
// ... update status label
statusLab->setText( tr( "Modification of *.la files of SALOME modules..." ) );
// set process arguments
- modifyLaProc->setWorkingDirectory( QDir::cleanDirPath( QFileInfo( "./config_files/" ).absFilePath() ) );
+ modifyLaProc->setWorkingDirectory( QDir( rootDirPath() ).filePath( "config_files" ) );
modifyLaProc->addArgument( "modifyLaFiles.sh" );
modifyLaProc->addArgument( "modify_la_files" );
modifyLaProc->addArgument( QDir::cleanDirPath( QFileInfo( targetFolder->text().stripWhiteSpace() ).absFilePath() ) );
QMessageBox::NoButton );
// enable <Next> button
setNextEnabled( true );
- nextButton()->setText( tr( "&Start" ) );
- setAboutInfo( nextButton(), tr( "Start installation process" ) );
- // reconnect Next button - to use it as Start button
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
// enable <Back> button
setBackEnabled( true );
// ================================================================
/*!
* SALOME_InstallWizard::runCheckFLib
- * Run the Fortran libraries checking
+ * Run the Fortran and other required libraries checking
*/
// ================================================================
void SALOME_InstallWizard::runCheckFLib()
// Check Fortran libraries
checkFLibProc->clearArguments();
// ... update status label
- statusLab->setText( tr( "Check Fortran libraries..." ) );
+ statusLab->setText( tr( "Check Fortran and other required libraries..." ) );
// ... search "not found" libraries
- checkFLibProc->setWorkingDirectory( QDir::cleanDirPath( QFileInfo( "./config_files/" ).absFilePath() ) );
+ checkFLibProc->setWorkingDirectory( QDir( rootDirPath() ).filePath( "config_files" ) );
checkFLibProc->addArgument( "checkFortran.sh" );
checkFLibProc->addArgument( "find_libraries" );
checkFLibProc->addArgument( QDir::cleanDirPath( QFileInfo( targetFolder->text().stripWhiteSpace() ).absFilePath() ) );
// ================================================================
/*!
* SALOME_InstallWizard::checkFLibResult
- * Slot to take result of Fortran libraries checking
+ * Slot to take result of Fortran and other required libraries checking
*/
// ================================================================
void SALOME_InstallWizard::checkFLibResult()
{
if ( checkFLibProc->normalExit() && checkFLibProc->exitStatus() == 1 ) {
- QStringList notFoundLibsList;
+ QStringList notFoundLibsList, notFoundOptLibsList;
QString record = "";
+ QStringList prefOptLibs = getOptionalLibs();
+ // create list of strings with all 'not found' libraries
while ( checkFLibProc->canReadLineStdout() ) {
- record = checkFLibProc->readLineStdout();
- if ( !record.isEmpty() && !notFoundLibsList.contains( record ) )
- notFoundLibsList.append( record );
- }
- QMessageBox::warning( this,
- tr( "Warning" ),
- tr( "The following libraries are absent on current system:\n"
- "%1").arg( notFoundLibsList.join( "\n" ) ),
- QMessageBox::Ok,
- QMessageBox::NoButton,
- QMessageBox::NoButton );
+ record = checkFLibProc->readLineStdout().stripWhiteSpace();
+ if ( !record.isEmpty() ) {
+ record = QStringList::split( " ", record )[0];
+ if ( !notFoundLibsList.contains( record ) &&
+ !notFoundOptLibsList.contains( record ) ) {
+ bool isOptional = false;
+ QStringList::Iterator it_opt;
+ for ( it_opt = prefOptLibs.begin(); it_opt != prefOptLibs.end(); ++it_opt )
+ if ( record.startsWith( (*it_opt).stripWhiteSpace(), false ) ) {
+ isOptional = true;
+ break;
+ }
+ isOptional ? notFoundOptLibsList.append( record ) \
+ : notFoundLibsList.append( record );
+ }
+ }
+ }
+ QString msg = tr( "Some libraries are absent!<br><br>" );
+ if ( !notFoundLibsList.isEmpty() ) {
+ msg += tr( "One or several <b>mandatory</b> libraries listed below are not found. SALOME <u>may not work</u> properly.<br>" );
+ msg += notFoundLibsList.join( "<br>" );
+ msg += "<br><br>";
+ }
+ if ( !notFoundOptLibsList.isEmpty() ) {
+ msg += tr( "One or several <b>optional</b> libraries listed below are not found. This <u>does not affect</u> on the correct work of SALOME platform.<br>" );
+ msg += notFoundOptLibsList.join( "<br>" );
+ }
+ if ( !notFoundLibsList.isEmpty() )
+ QMessageBox::warning( this,
+ tr( "Warning" ),
+ msg,
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
+ QMessageBox::NoButton );
+ else if ( !notFoundOptLibsList.isEmpty() )
+ QMessageBox::information( this,
+ tr( "Information" ),
+ msg,
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
+ QMessageBox::NoButton );
}
// Update GUI and check installation errors
completeInstallation();
QFileInfo fi( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) );
if ( fi.exists() ) {
diskSpaceProc->clearArguments();
- QString script = "./config_files/diskSpace.sh";
- diskSpaceProc->addArgument( script );
+ diskSpaceProc->setWorkingDirectory( QDir( rootDirPath() ).filePath( "config_files" ) );
+ diskSpaceProc->addArgument( "diskSpace.sh" );
diskSpaceProc->addArgument( fi.absFilePath() );
// run script
diskSpaceProc->start();
// fill in script parameters
shellProcess->clearArguments();
// ... script name
- shellProcess->setWorkingDirectory( QDir::cleanDirPath( QFileInfo( "./config_files/" ).absFilePath() ) );
+ shellProcess->setWorkingDirectory( QDir( rootDirPath() ).filePath( "config_files" ) );
if ( !extraProducts.contains( prodProc ) ) {
item = findItem( prodProc );
shellProcess->addArgument( item->text(2) );
}
return;
}
+
+ // else try to find aborted product
+ prodProc = progressView->findStatus( Aborted );
+ if ( !prodProc.isNull() )
+ return; // installation has been aborted
+
___MESSAGE___( "All products have been installed successfully" );
// all products are installed successfully
MapProducts::Iterator mapIter;
if ( item->isOn() && dep.pickUpEnvironment() ) {
statusLab->setText( tr( "Pick-up products environment for " ) + dep.getName().latin1() + "..." );
___MESSAGE___( "... for " << dep.getName().latin1() );
- QString script;
- script += "cd " + QUOTE( QFileInfo( QDir::cleanDirPath( "./config_files/" ) ).absFilePath() ) + "; ";
- script += item->text(2) + " ";
- script += "pickup_env ";
- script += QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() ) + " ";
- script += QUOTE( QFileInfo( QDir::cleanDirPath( QDir( rootDirPath() ).filePath( "Products" ) ) ).absFilePath() ) + " ";
- script += QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() ) + " ";
- script += depproducts + " ";
- script += item->text(0) + " ";
- script += QUOTE( prodSequence.join( " " ) );
- ___MESSAGE___( "... --> " << script.latin1() );
- if ( system( script.latin1() ) ) {
+ QDir rd( rootDirPath() );
+ Script script;
+ script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
+ script << item->text(2) << "pickup_env";
+ script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
+ script << QUOTE( QFileInfo( QDir::cleanDirPath( QDir( rootDirPath() ).filePath( "Products" ) ) ).absFilePath() );
+ script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
+ script << depproducts << item->text(0) << QUOTE( prodSequence.join( " " ) );
+ ___MESSAGE___( "... --> " << script.script().latin1() );
+ if ( system( script.script().latin1() ) ) {
___MESSAGE___( "ERROR" );
}
}
statusLab->setText( tr( "Installation completed" ) );
// <Next> button
setNextEnabled( true );
- nextButton()->setText( tr( "&Next >" ) );
- setAboutInfo( nextButton(), tr( "Move to the next step of the installation procedure" ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ doPostActions( tr( "&Next >" ), tr( "Move to the next step of the installation procedure" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
// <Back> button
setBackEnabled( true );
if ( hasErrors ) {
if ( QMessageBox::warning( this,
tr( "Warning" ),
- tr( "There were some errors and/or warnings during the installation.\n"
+ tr( "There were some errors during the installation.\n"
"Do you want to save the installation log?" ),
tr( "&Save" ),
tr( "&Cancel" ),
ButtonList::Iterator it;
for ( it = buttons.begin(); it != buttons.end(); ++it ) {
if ( (*it).button() && (*it).button() == btn ) {
- QString script;
- script += "( cd " + QUOTE( QFileInfo( QDir::cleanDirPath( "./config_files/" ) ).absFilePath() ) + "; ";
- script += + (*it).script();
- script += " execute ";
- script += QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() ) + " ";
- script += QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() ) + " ";
- script += " > /dev/null )";
- ___MESSAGE___( "script: " << script.latin1() );
- if ( (*it).script().isEmpty() || system( script.latin1() ) ) {
+ QDir rd( rootDirPath() );
+ Script script;
+ script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
+ script << (*it).script() << "execute";
+ script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
+ script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
+ script << ">& /dev/null";
+ ___MESSAGE___( "script: " << script.script().latin1() );
+ if ( (*it).script().isEmpty() || system( script.script().latin1() ) ) {
QMessageBox::warning( this,
tr( "Error" ),
tr( "Can't perform action!"),
myWC.wakeAll();
while ( myThread->running() );
// first remove temporary files
- QString script = "cd ./config_files/; remove_tmp.sh '";
- script += tempFolder->text().stripWhiteSpace() + TEMPDIRNAME;
- script += "' ";
- script += QUOTE(getAllProducts(productsMap));
- script += " > /dev/null";
- ___MESSAGE___( "script = " << script.latin1() );
- if ( system( script.latin1() ) ) {
+ QDir rd( rootDirPath() );
+ Script script;
+ script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
+ script << "remove_tmp.sh" << QUOTE( tempFolder->text().stripWhiteSpace() + TEMPDIRNAME );
+ script << QUOTE( getAllProducts( productsMap ) );
+ script << ">& /dev/null";
+ ___MESSAGE___( "script = " << script.script().latin1() );
+ if ( system( script.script().latin1() ) ) {
+ // error
}
// then try to remove created temporary directory
//script = "rm -rf " + QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME;
if ( rmDir && !tmpCreated.isNull() ) {
- script = "rm -rf " + tmpCreated;
- script += " > /dev/null";
- if ( system( script.latin1() ) ) {
+ script.clear();
+ script << "rm -rf" << QUOTE( tmpCreated );
+ script << ">& /dev/null";
+ if ( system( script.script().latin1() ) ) {
+ // error
}
- ___MESSAGE___( "script = " << script.latin1() );
+ ___MESSAGE___( "script = " << script.script().latin1() );
}
}
// ================================================================
// ================================================================
void SALOME_InstallWizard::pageChanged( const QString & mytitle)
{
- nextButton()->setText( tr( "&Next >" ) );
- setAboutInfo( nextButton(), tr( "Move to the next step of the installation procedure" ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ doPostActions( tr( "&Next >" ), tr( "Move to the next step of the installation procedure" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
cancelButton()->disconnect();
connect( cancelButton(), SIGNAL( clicked()), this, SLOT( reject() ) );
}
// 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" );
}
passedParams->clear();
passedParams->setEnabled( false );
QFont f = parametersLab->font(); f.setBold( false ); parametersLab->setFont( f );
- nextButton()->setText( tr( "&Start" ) );
- setAboutInfo( nextButton(), tr( "Start installation process" ) );
- // reconnect Next button - to use it as Start button
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
setNextEnabled( true );
// reconnect Cancel button to terminate process
ButtonList::Iterator it;
for ( it = buttons.begin(); it != buttons.end(); ++it ) {
if ( (*it).button() ) {
- QString script;
- script += "( cd " + QUOTE( QFileInfo( QDir::cleanDirPath( "./config_files/" ) ).absFilePath() ) + "; ";
- script += + (*it).script();
- script += " check_enabled ";
- script += QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() ) + " ";
- script += QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() ) + " ";
- script += " > /dev/null )";
- ___MESSAGE___( "script: " << script.latin1() );
- (*it).button()->setEnabled( !(*it).script().isEmpty() && !system( script.latin1() ) );
+ QDir rd( rootDirPath() );
+ Script script;
+ script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
+ script << (*it).script() << "check_enabled";
+ script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
+ script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
+ script << ">& /dev/null";
+ ___MESSAGE___( "script: " << script.script().latin1() );
+ (*it).button()->setEnabled( !(*it).script().isEmpty() && !system( script.script().latin1() ) );
}
}
finishButton()->setEnabled( true );
installInfo->setFinished( false );
passedParams->clear();
passedParams->setEnabled( false );
+ // disable 'Ignore errors' checkbox during installation process
+ ignoreErrCBox->setEnabled( false );
QFont f = parametersLab->font(); f.setBold( false ); parametersLab->setFont( f );
// update status label
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
statusLab->setText( tr( "Check Fortran compiler..." ) );
// check Fortran compiler.
- QString script = "./config_files/checkFortran.sh find_compilers";
- script += " " + QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
- ___MESSAGE___( "script = " << script.latin1() );
- if ( system( script ) ) {
+ QDir rd( rootDirPath() );
+ Script script;
+ script << QUOTE( rd.filePath( "config_files/checkFortran.sh" ) ) << "find_compilers";
+ script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
+ ___MESSAGE___( "script = " << script.script().latin1() );
+ if ( system( script.script().latin1() ) ) {
QMessageBox::critical( this,
tr( "Error" ),
tr( "Fortran compiler was not found at current system!\n"
statusLab->setText( tr( "Installation has been aborted" ) );
// enable <Next> button
setNextEnabled( true );
- nextButton()->setText( tr( "&Start" ) );
- setAboutInfo( nextButton(), tr( "Start installation process" ) );
- // reconnect Next button - to use it as Start button
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
// enable <Back> button
setBackEnabled( true );
// create a backup of 'env_build.csh', 'env_build.sh', 'env_products.csh', 'env_products.sh'
// ( backup of 'salome.csh' and 'salome.sh' is made if pick-up environment is called )
- QString script = "./config_files/backupEnv.sh ";
- script += QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
- ___MESSAGE___( "script = " << script.latin1() );
- if ( system( script ) ) {
+ QDir rd( rootDirPath() );
+ Script script;
+ script << QUOTE( rd.filePath( "config_files/backupEnv.sh" ) );
+ script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
+ ___MESSAGE___( "script = " << script.script().latin1() );
+ if ( system( script.script().latin1() ) ) {
if ( QMessageBox::warning( this,
tr( "Warning" ),
tr( "Backup environment files have not been created.\n"
// installation aborted
abort();
statusLab->setText( tr( "Installation has been aborted by user" ) );
- // enable <Next> button
+ // update <Next> button
setNextEnabled( true );
- nextButton()->setText( tr( "&Start" ) );
- setAboutInfo( nextButton(), tr( "Start installation process" ) );
- // reconnect Next button - to use it as Start button
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
// enable <Back> button
setBackEnabled( true );
installInfo->setFinished( true );
// enable <Next> button
setNextEnabled( true );
- nextButton()->setText( tr( "&Start" ) );
- setAboutInfo( nextButton(), tr( "Start installation process" ) );
- // reconnect Next button - to use it as Start button
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
- //nextButton()->setText( tr( "&Next >" ) );
- //setAboutInfo( nextButton(), tr( "Move to the next step of the installation procedure" ) );
- //disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- //disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ //doPostActions( tr( "&Next >" ), tr( "Move to the next step of the installation procedure" ) );
//connect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
// enable <Back> button
setBackEnabled( true );
installInfo->scrollToBottom();
hasErrors = true;
}
+
+ // stop or proceed installation process
+ manageInstProc();
+
// VSR: 10/11/05 - disable answer mode ==>
// passedParams->setEnabled( true );
// passedParams->setFocus();
// VSR: 10/11/05 - disable answer mode <==
}
// ================================================================
+/*!
+ * SALOME_InstallWizard::manageInstProc
+ * QProcess slot: -->stop installation if there is an error in stderr
+ */
+// ================================================================
+void SALOME_InstallWizard::manageInstProc()
+{
+ if ( !hasErrors || ignoreErrCBox->isChecked() )
+ return; //proceed installation process
+
+ // abort the current installation
+ statusLab->setText( tr( "Aborting installation..." ) );
+ abort();
+ statusLab->setText( tr( "Installation has been aborted because some errors" ) );
+ if ( QMessageBox::critical( this,
+ tr( "Error" ),
+ tr( "Installation process has been stopped, because an error occured \n"
+ "during an installation of the current product!\n"
+ "Please see the installation progress view for more details about the error.\n\n"
+ "Do you want to save the installation log?" ),
+ tr( "&Save" ),
+ tr( "&Cancel" ),
+ QString::null,
+ 0,
+ 1 ) == 0 )
+ saveLog();
+ // enable <Next> button
+ setNextEnabled( true );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
+ connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ // enable <Back> button
+ setBackEnabled( true );
+ installInfo->setFinished( true );
+}
+// ================================================================
/*!
* SALOME_InstallWizard::setDependancies
* Sets dependancies for the product item
productsMap[item] = dep;
}
// ================================================================
+/*!
+ * SALOME_InstallWizard::doPostActions
+ * Executes some actions after finish of installation process (successful or not)
+ */
+// ================================================================
+void SALOME_InstallWizard::doPostActions( const QString& btnText,
+ const QString& btnAboutInfo )
+{
+ // update <Next> button
+ nextButton()->setText( btnText );
+ setAboutInfo( nextButton(), btnAboutInfo );
+ // reconnect Next button - to use it as Start button
+ disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
+ disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ // enable 'Ignore errors' checkbox
+ ignoreErrCBox->setEnabled( true );
+}
+// ================================================================
/*!
* SALOME_InstallWizard::addFinishButton
* Add button for the <Finish> page.